diff --git a/CHANGELOG.md b/CHANGELOG.md index 39caca1..cded945 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### `Fixed` +- [#118](https://github.com/mskcc/forte/pull/119) - change script error behavior in METAFUSION_RUN process + ### `Dependencies` ### `Deprecated` diff --git a/bin/Metafusion_forte.sh b/bin/Metafusion_forte.sh index 22f901e..d61511f 100755 --- a/bin/Metafusion_forte.sh +++ b/bin/Metafusion_forte.sh @@ -1,4 +1,7 @@ #!/bin/bash + +set -eo pipefail + #STEPS # __author__ = "Alexandria Dymun" @@ -7,7 +10,6 @@ # __version__ = "0.0.1" # __status__ = "Dev" - output_ANC_RT_SG=1 RT_call_filter=1 blck_filter=1 @@ -60,15 +62,17 @@ if [[ ! $cff || ! $gene_info || ! $gene_bed ]]; then usage fi +env | grep -i tmp -mkdir $outdir +mkdir -p $outdir #Check CFF file format: #Remove entries with nonconformming chromosome name all_gene_bed_chrs=`awk -F '\t' '{print $1}' $gene_bed | sort | uniq | sed 's/chr//g '` awk -F " " -v arr="${all_gene_bed_chrs[*]}" 'BEGIN{OFS = "\t"; split(arr,arr1); for(i in arr1) dict[arr1[i]]=""} $1 in dict && $4 in dict' $cff > $outdir/$(basename $cff).cleaned_chr -grep -v -f $outdir/$(basename $cff).cleaned_chr $cff > problematic_chromosomes.cff +head $outdir/$(basename $cff).cleaned_chr +grep -v -f $outdir/$(basename $cff).cleaned_chr $cff > problematic_chromosomes.cff || test $? = 1 cff=$outdir/$(basename $cff).cleaned_chr #Rename cff @@ -116,10 +120,10 @@ fi #ReadThrough Callerfilter if [ $RT_call_filter -eq 1 ]; then echo ReadThrough, callerfilter $num_tools - cat $cluster | grep ReadThrough > $outdir/$(basename $cluster).ReadThrough + cat $cluster | grep ReadThrough > $outdir/$(basename $cluster).ReadThrough || test $? = 1 callerfilter_num.py --cluster $cluster --num_tools $num_tools > $outdir/$(basename $cluster).callerfilter.$num_tools callerfilter_excluded=$(comm -13 <(cut -f 22 $outdir/$(basename $cluster).callerfilter.$num_tools | sort | uniq) <(cut -f 22 $cluster | sort | uniq)) - grep -v ReadThrough $outdir/$(basename $cluster).callerfilter.$num_tools > $outdir/$(basename $cluster).RT_filter.callerfilter.$num_tools + grep -v ReadThrough $outdir/$(basename $cluster).callerfilter.$num_tools > $outdir/$(basename $cluster).RT_filter.callerfilter.$num_tools || test $? = 1 cluster_RT_call=$outdir/$(basename $cluster).RT_filter.callerfilter.$num_tools fi # Blocklist Filter diff --git a/modules/local/metafusion/run/main.nf b/modules/local/metafusion/run/main.nf index 022ff71..bd1d8fa 100644 --- a/modules/local/metafusion/run/main.nf +++ b/modules/local/metafusion/run/main.nf @@ -29,6 +29,7 @@ process METAFUSION_RUN { args = task.ext.args ?: "" def sample = "${meta.sample}" """ + export TMPDIR=\$TMPDIR Metafusion_forte.sh \\ --cff $cff \\ --outdir . \\