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

Support for changing output directory #7

Merged
merged 6 commits into from
Mar 26, 2021
Merged
Changes from 5 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
17 changes: 9 additions & 8 deletions src/main/docker/RNApeg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ REFFLAT=""
REFGENE=""
# optional refFlat for final gene annotation step only, if not specified REFFLAT
# will be used.
OUTPUT_DIR=/results
OUTPUT_DIR=""

usage() {
echo "RNApeg.sh [-h] -b bamfile -f fasta -r refflat [-rg refflat]"
echo "RNApeg.sh [-h] -b bamfile -f fasta -r refflat [-rg refflat] [-O output_dir]"
}

while [ ! -z "$1" ]; do
Expand All @@ -23,6 +23,7 @@ while [ ! -z "$1" ]; do
-b) BAMFILE=$2; shift;;
-r) REFFLAT=$2; shift;;
-f) FASTA=$2; shift;;
-O) OUTPUT_DIR=$2; shift;;
jordan-rash marked this conversation as resolved.
Show resolved Hide resolved
-rg) REFGENE=$2; shift;;
-version) echo 20191119; exit 1;;
*) echo "ERROR: unrecognized parameter $1"; usage; exit 1; shift;;
Expand Down Expand Up @@ -54,10 +55,6 @@ elif [[ ! -f $FASTA.fai ]]; then
>&2 echo "ERROR: FASTA index file '$FASTA.fai' DNE; see samtools faidx command"
usage
exit 1
elif [[ ! -d "$OUTPUT_DIR" ]]; then
usage
>&2 echo "ERROR: Output directory '$OUTPUT_DIR' does not exist; need mountpoint?"
exit 1
fi

if [[ -z "$REFGENE" ]]; then
Expand All @@ -78,6 +75,10 @@ fi
##################

echo "[*] Running junction_extraction_wrapper.pl"
junction_extraction_wrapper.pl -no-config -bam $BAMFILE -o $OUTPUT_DIR -fasta $FASTA -refflat $REFFLAT -refgene $REFGENE -now

if [[ -z "$OUTPUT_DIR" ]]; then
junction_extraction_wrapper.pl -no-config -bam $BAMFILE -fasta $FASTA -refflat $REFFLAT -refgene $REFGENE -now
else
mkdir -p $OUTPUT_DIR
junction_extraction_wrapper.pl -no-config -bam $BAMFILE -o $OUTPUT_DIR -fasta $FASTA -refflat $REFFLAT -refgene $REFGENE -now
fi
jordan-rash marked this conversation as resolved.
Show resolved Hide resolved