]> git.donarmstrong.com Git - rsem.git/blobdiff - rsem-calculate-expression
Added some instructions on how to visualize transcript coordinate BAM/WIG files using IGV
[rsem.git] / rsem-calculate-expression
index 5614ecda945f8fe2b261fff8e3c9ed5bc891979d..2a09c1570ce7cd45a560b7587568ff106766fd75 100755 (executable)
@@ -49,6 +49,7 @@ my $genBamF = 1;  # default is generating transcript bam file
 my $genGenomeBamF = 0;
 my $sampling = 0;
 my $calcCI = 0;
+my $var_opt = 0; # temporarily, only for internal use
 my $quiet = 0;
 my $help = 0;
 
@@ -89,6 +90,7 @@ GetOptions("keep-intermediate-files" => \$keep_intermediate_files,
           "no-bam-output" => sub { $genBamF = 0; },
           "output-genome-bam" => \$genGenomeBamF,
           "sampling-for-bam" => \$sampling,
+          "var" => \$var_opt,
           "calc-ci" => \$calcCI,
           "ci-memory=i" => \$NMB,
           "time" => \$mTime,
@@ -173,7 +175,7 @@ if (!(-d $stat_dir) && !mkdir($stat_dir)) { print "Fail to create folder $stat_d
 
 $imdName = "$temp_dir/$sampleToken";
 
-if (!$is_sam && !$is_bam && $phred33 + $phred64 + $solexa == 0) { $phred33 = 1; }
+if (!$is_sam && !$is_bam && !$no_qual && ($phred33 + $phred64 + $solexa == 0)) { $phred33 = 1; }
 
 my ($mate_minL, $mate_maxL) = (1, $maxL);
 
@@ -184,13 +186,12 @@ my $command = "";
 
 if (!$is_sam && !$is_bam) {
     $command = $bowtie_path."bowtie";
-    if ($read_type == 0 || $read_type == 2) { $command .= " -f"; }
+    if ($no_qual) { $command .= " -f"; }
     else { $command .= " -q"; }
     
     if ($phred33) { $command .= " --phred33-quals"; }
     elsif ($phred64) { $command .= " --phred64-quals"; }
     elsif ($solexa) { $command .= " --solexa-quals"; }
-    else { print "Oh, no!!!"; exit(2); }
     
     $command .= " -n $C -e $E -l $L";
     if ($read_type == 2 || $read_type == 3) { $command .= " -I $minL -X $maxL"; }
@@ -292,12 +293,15 @@ if ($mTime) { $time_end = time(); $time_rsem = $time_end - $time_start; }
 
 if ($mTime) { $time_start = time(); }
 
-if ($calcCI) {
+if ($calcCI || $var_opt) {
     $command = $dir."rsem-run-gibbs $refName $sampleName $sampleToken $BURNIN $NCV $SAMPLEGAP";
     $command .= " -p $nThreads";
+    if ($var_opt) { $command .= " --var"; }
     if ($quiet) { $command .= " -q"; }
     &runCommand($command);
+}
 
+if ($calcCI) {
     system("mv $sampleName.isoforms.results $imdName.isoforms.results.bak1");
     system("mv $sampleName.genes.results $imdName.genes.results.bak1");
     &collectResults("$imdName.iso_res", "$sampleName.isoforms.results"); # isoform level