Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/metafusion script error exiting behavior #119

Merged
merged 5 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
14 changes: 9 additions & 5 deletions bin/Metafusion_forte.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash

set -eo pipefail

#STEPS

# __author__ = "Alexandria Dymun"
Expand All @@ -7,7 +10,6 @@
# __version__ = "0.0.1"
# __status__ = "Dev"


output_ANC_RT_SG=1
RT_call_filter=1
blck_filter=1
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions modules/local/metafusion/run/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ process METAFUSION_RUN {
args = task.ext.args ?: ""
def sample = "${meta.sample}"
"""
export TMPDIR=\$TMPDIR
Metafusion_forte.sh \\
--cff $cff \\
--outdir . \\
Expand Down
Loading