X-Git-Url: https://git.donarmstrong.com/?p=rsem.git;a=blobdiff_plain;f=rsem-plot-transcript-wiggles;h=25e8b355dae5992cfd003bb3a659a0d28662f29a;hp=5054f5bc0d4fa3256bc4ac4899162c4b4e570847;hb=1b2999c4407ef8419fb89b66b843b7141caff4da;hpb=6eec553ba4ab1cb1c6f48cd14d9e5c92c7d85798 diff --git a/rsem-plot-transcript-wiggles b/rsem-plot-transcript-wiggles index 5054f5b..25e8b35 100755 --- a/rsem-plot-transcript-wiggles +++ b/rsem-plot-transcript-wiggles @@ -19,8 +19,12 @@ pod2usage(-msg => "Invalid number of arguments!", -exitval => 2, -verbose => 2) my ($fn, $dir, $suf) = fileparse($0); my $command = ""; +unless (-e "$ARGV[0].transcript.sorted.bam") { + $command = $dir."sam/samtools sort $ARGV[0].transcript.bam $ARGV[0].transcript.sorted"; + &runCommand($command); +} unless (-e "$ARGV[0].transcript.readdepth") { - $command = $dir."rsem-bam2readdepth $ARGV[0].transcript.sorted.bam > $ARGV[0].transcript.readdepth"; + $command = $dir."rsem-bam2readdepth $ARGV[0].transcript.sorted.bam $ARGV[0].transcript.readdepth"; &runCommand($command); } @@ -34,7 +38,7 @@ if ($show_unique) { &runCommand($command); } unless (-e "$ARGV[0].uniq.transcript.readdepth") { - $command = $dir."rsem-bam2readdepth $ARGV[0].uniq.transcript.sorted.bam > $ARGV[0].uniq.transcript.readdepth"; + $command = $dir."rsem-bam2readdepth $ARGV[0].uniq.transcript.sorted.bam $ARGV[0].uniq.transcript.readdepth"; &runCommand($command); } }