]> git.donarmstrong.com Git - rsem.git/blobdiff - rsem-generate-ngvector
Added support for DE analysis on multiple conditions via running EBSeq
[rsem.git] / rsem-generate-ngvector
index c4d26a8f067efead6eb652e04a9cb31bfe6bf9ea..68fe664e5dd69a9dae2ca8a20e91e9bf0bf8430e 100755 (executable)
@@ -2,9 +2,12 @@
 
 use Getopt::Long;
 use Pod::Usage;
-use File::Basename;
+use FindBin;
+use lib $FindBin::Bin;
 use strict;
 
+use rsem_perl_utils;
+
 my $k = 25;
 my $help = 0;
 
@@ -14,29 +17,15 @@ GetOptions("k=i" => \$k,
 pod2usage(-verbose => 2) if ($help == 1);
 pod2usage(-msg => "Invalid number of arguments!", -exitval => 2, -verbose => 2) if (scalar(@ARGV) != 2);
 
-my ($fn, $dir, $suf) = fileparse($0);
+my $dir = "$FindBin::Bin/";
 my $command = "";
 
-$command = $dir."rsem-for-ebseq-calculate-clustering-info $k $ARGV[0] $ARGV[1].ump";
+$command = $dir."EBSeq/rsem-for-ebseq-calculate-clustering-info $k $ARGV[0] $ARGV[1].ump";
 &runCommand($command);
 
-$command = $dir."rsem-for-ebseq-generate-ngvector-from-clustering-info $ARGV[1].ump $ARGV[1].ngvec";
+$command = $dir."EBSeq/rsem-for-ebseq-generate-ngvector-from-clustering-info $ARGV[1].ump $ARGV[1].ngvec";
 &runCommand($command);
 
-# command, {err_msg}
-sub runCommand {
-    print $_[0]."\n";
-    my $status = system($_[0]);
-    if ($status != 0) {
-        my $errmsg;
-        if (scalar(@_) > 1) { $errmsg = $_[1]; }
-        else { $errmsg = "\"$command\" failed! Plase check if you provide correct parameters/options for the pipeline!"; }
-        print $errmsg."\n";
-        exit(-1);
-    }
-    print "\n";
-}
-
 __END__
 
 =head1 NAME
@@ -45,11 +34,7 @@ rsem-generate-ngvector
 
 =head1 SYNOPSIS
 
-=over
-
- rsem-generate-ngvector [options] input_fasta_file output_name
-
-=back
+rsem-generate-ngvector [options] input_fasta_file output_name
 
 =head1 ARGUMENTS