]> git.donarmstrong.com Git - rsem.git/blobdiff - rsem-calculate-expression
Updated EBSeq to v1.1.4
[rsem.git] / rsem-calculate-expression
index 955a7f5c540ee71ff4b4e94f1238c62524397b5e..4d1b70a8a4dca169ccb0702caf32d2bb30caaa2f 100755 (executable)
@@ -3,7 +3,6 @@
 use Getopt::Long;
 use Pod::Usage;
 use File::Basename;
-use Switch;
 use strict;
 
 #const
@@ -63,6 +62,8 @@ my $keep_intermediate_files = 0;
 
 my $strand_specific = 0;
 
+my $version = 0;
+
 my $mTime = 0;
 my ($time_start, $time_end, $time_alignment, $time_rsem, $time_ci) = (0, 0, 0, 0, 0);
 
@@ -106,11 +107,14 @@ GetOptions("keep-intermediate-files" => \$keep_intermediate_files,
           "calc-ci" => \$calcCI,
           "ci-memory=i" => \$NMB,
           "time" => \$mTime,
+          "version" => \$version,
           "q|quiet" => \$quiet,
           "h|help" => \$help) or pod2usage(-exitval => 2, -verbose => 2);
 
-pod2usage(-verbose => 2) if ($help == 1);
+my ($fn, $dir, $suf) = fileparse($0);
 
+pod2usage(-verbose => 2) if ($help == 1);
+&showVersionInfo($dir) if ($version == 1);
 
 #check parameters and options
 
@@ -187,7 +191,6 @@ my ($mate_minL, $mate_maxL) = (1, $maxL);
 
 if ($bowtie_path ne "") { $bowtie_path .= "/"; }
 
-my ($fn, $dir, $suf) = fileparse($0);
 my $command = "";
 
 if (!$is_sam && !$is_bam) {
@@ -246,12 +249,11 @@ if ($quiet) { $command .= " -q"; }
 &runCommand($command);
 
 $command = $dir."rsem-build-read-index $gap"; 
-switch($read_type) {
-    case 0  { $command .= " 0 $quiet $imdName\_alignable.fa"; }
-    case 1  { $command .= " 1 $quiet $imdName\_alignable.fq"; }
-    case 2  { $command .= " 0 $quiet $imdName\_alignable_1.fa $imdName\_alignable_2.fa"; }
-    case 3  { $command .= " 1 $quiet $imdName\_alignable_1.fq $imdName\_alignable_2.fq"; }
-}
+if ($read_type == 0) { $command .= " 0 $quiet $imdName\_alignable.fa"; }
+elsif ($read_type == 1) { $command .= " 1 $quiet $imdName\_alignable.fq"; }
+elsif ($read_type == 2) { $command .= " 0 $quiet $imdName\_alignable_1.fa $imdName\_alignable_2.fa"; }
+elsif ($read_type == 3) { $command .= " 1 $quiet $imdName\_alignable_1.fq $imdName\_alignable_2.fq"; }
+else { print "Impossible! read_type is not in [1,2,3,4]!\n"; exit(-1); }
 &runCommand($command);
 
 my $doesOpen = open(OUTPUT, ">$imdName.mparams");
@@ -352,7 +354,7 @@ sub runCommand {
     if ($status != 0) {
         my $errmsg = "";
         if (scalar(@_) > 1) { $errmsg .= $_[1]."\n"; }
-        $errmsg .= "\"$_[0]\" failed! Plase check if you provide correct parameters/options for the pipeline!\n";
+        $errmsg .= "\"$_[0]\" failed! Please check if you provide correct parameters/options for the pipeline!\n";
         print $errmsg;
         exit(-1);
     }
@@ -407,6 +409,16 @@ sub collectResults {
     close(OUTPUT);
 }
 
+# dir
+sub showVersionInfo {
+    open(INPUT, "$_[0]\WHAT_IS_NEW");
+    my $line = <INPUT>;
+    chomp($line);
+    close(INPUT);
+    print "$line\n";
+    exit(0);
+}
+
 __END__
 
 =head1 NAME