Commit eced96ec authored by A.J. Sethi's avatar A.J. Sethi

adding whippet support

parent 290fe98d
......@@ -57,7 +57,7 @@ do
unset OPTIND
unset OPTARG
while getopts a:b:o:t:v:m: options
while getopts a:n:c:o:t:v:m:w: options
do
case $options in
......@@ -71,12 +71,17 @@ do
export myAnnotation="${input}/$(ls ${OPTARG} | grep -e ".gtf")"
;;
b) # binary alignments
[ -d ${OPTARG} ] && export bamDir="${OPTARG}" && bamList=`ls -d ${OPTARG}/*.*` || die "cannot fetch input files" # get a list of files in the primary input
bamCount=$(echo $bamList | grep -c -e ".bam")
[ ${bamCount} -gt "0" ] || die "no binary alignments found in ${bamDir}"
n) # nacent RNA alignments
[ -d ${OPTARG} ] && export nbamDir="${OPTARG}" && nbamList=`ls -d ${OPTARG}/*.*` || die "cannot fetch input files" # get a list of files in the primary input
nbamCount=$(echo $nbamList | grep -c -e ".bam")
[ ${nbamCount} -gt "0" ] || die "no binary alignments found in ${nbamDir}"
;;
c) # cytoplasmic RNA alignments
[ -d ${OPTARG} ] && export cbamDir="${OPTARG}" && cbamList=`ls -d ${OPTARG}/*.*` || die "cannot fetch input files" # get a list of files in the primary input
cbamCount=$(echo $cbamList | grep -c -e ".bam")
[ ${cbamCount} -gt "0" ] || die "no binary alignments found in ${cbamDir}"
;;
o) # output directory
export outputDirectory="${OPTARG}"
mkdir -p ${outputDirectory} 2>/dev/null
......@@ -108,6 +113,8 @@ do
else die "could not parse the user provided runmode, ${OPTARG}"; fi
;;
w) # path to whippet index
esac;
done
shift $((OPTIND-1))
......@@ -123,7 +130,6 @@ done
vsec "your annotation is ${myAnnotation}"
vsec "your reference sequence is ${myReferenceSequence}"
# validate the binary alignments
[ "${bamCount}" -gt "0" ] || die "did not detect any bam files in the input"
ssec "detected ${bamCount} bam files"
......@@ -131,6 +137,7 @@ ssec "detected ${bamCount} bam files"
# validate output directory
[ -d "${outputDirectory}" ] || die "cannot access your output directory"
vsec "Your output directory is ${outputDirectory}"
export od=${outputDirectory}
# validate threadCount
ssec "proceeding with ${threadCount} threads"
......@@ -141,5 +148,16 @@ ssec "your runmode is ${MODE}"
vsec "completed housekeeping; parsing GTF"
####################################################################################################
####################################################################################################
####################################
# generate on the fly whippet index using mature bams
# first, merge the mature bams
matureSamMerge="${od}/matureSamMerge"; mkdir -p ${matureSamMerge} 2>/dev/null
cd ${cbamDir} && samtools merge -@ ${threadCount} ${matureSamMerge}/merged.bam `ls *.bam` || die "cannot merge the cytoplasmic RNA alignments"
samtools sort -@ ${threadCount} ${matureSamMerge}/merged.bam > ${matureSamMerge}/sorted.merged.bam || die "cannot sort your bam"
samtools index -@ ${threadCount} ${matureSamMerge}/sorted.merged.bam || die "cannot index your merged bam"
# next, generate on-the-fly whippet index
julia bin/whippet-index.jl
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment