Permalink
Browse files

fixed tophat output naming

  • Loading branch information...
1 parent ea8a846 commit f96b5c9fcbb564c6d715799341ba92986b7a214c @wpoehlm wpoehlm committed Dec 5, 2016
Showing with 9 additions and 9 deletions.
  1. +9 −9 tools/tophat
View
@@ -18,24 +18,24 @@ PART=$5
COMMON_NAME=$6
# make sure we have empty output files in case of errors
-touch $COMMON_NAME-out.txt
-touch $COMMON_NAME-accepted_hits.bam
-touch $COMMON_NAME-align_summary.txt
+touch $BASE_NAME-$COMMON_NAME-out.txt
+touch $BASE_NAME-$COMMON_NAME-accepted_hits.bam
+touch $BASE_NAME-$COMMON_NAME-align_summary.txt
java -Xmx512m \
-jar trimmomatic-0.36.jar PE -threads 1 -phred33 \
- forward-$COMMON_NAME reverse-$COMMON_NAME \
+ $BASE_NAME-forward-$COMMON_NAME $BASE_NAME-reverse-$COMMON_NAME \
left_result.paired_trim.forward_$COMMON_NAME.fastq left_result.unpaired_trim.forward_$COMMON_NAME.fastq \
right_result.paired_trim.reverse_$COMMON_NAME.fastq right_result.unpaired_trim.reverse_$COMMON_NAME.fastq \
ILLUMINACLIP:fasta_adapter.txt:2:40:15 LEADING:3 TRAILING:6 SLIDINGWINDOW:4:15 MINLEN:50 \
- 2>&1 | tee $COMMON_NAME-trimmomatic.txt
+ 2>&1 | tee $BASE_NAME-$COMMON_NAME-trimmomatic.txt
# empty outputs?
LEFT_SIZE=`ls -l left_result.paired_trim.forward_$COMMON_NAME.fastq | cut -d ' ' -f 5`
RIGHT_SIZE=`ls -l right_result.paired_trim.reverse_$COMMON_NAME.fastq | cut -d ' ' -f 5`
if [ $LEFT_SIZE -lt 50 -o $RIGHT_SIZE -lt 50 ]; then
echo "Warning: trimmomatic output was 0 sequences"
- touch $COMMON_NAME-accepted_hits.bam
+ touch $BASE_NAME-$COMMON_NAME-accepted_hits.bam
exit 0
fi
@@ -47,13 +47,13 @@ tophat2 --no-coverage-search --no-novel-juncs --no-novel-indels --no-coverage-se
--transcriptome-index=transcriptome_data/$REF_PREFIX -o work-$$ ./$REF_PREFIX \
left_result.paired_trim.forward_$COMMON_NAME.fastq \
right_result.paired_trim.reverse_$COMMON_NAME.fastq \
- | tee $COMMON_NAME-out.txt
+ | tee $BASE_NAME-$COMMON_NAME-out.txt
echo
find work-$$
echo
# we only need the accepted hits, but it needs a unique name
-mv work-$$/accepted_hits.bam $COMMON_NAME-accepted_hits.bam
-mv work-$$/align_summary.txt $COMMON_NAME-align_summary.txt
+mv work-$$/accepted_hits.bam $BASE_NAME-$COMMON_NAME-accepted_hits.bam
+mv work-$$/align_summary.txt $BASE_NAME-$COMMON_NAME-align_summary.txt

0 comments on commit f96b5c9

Please sign in to comment.