ClaiRO is a low-bias method to detect and quantify exon-defining units from paired-end RNA-Seq alignments. ClaiRO searches for read-pairs from cDNA fragments which span internal exons. We refere to these read-pairs are known as exon-defining units (ExoDUs)
* Exon-defining unit (ExoDU) are cDNA fragments which span internal exons on protein-coding transcripts. Paired-end sequencing alignments contain numerous pairs which span ExoDU, termed exon-defining unit spanners (ExoDUs)
.
* ClaiRO searches for ExoDUs . ClaiRO is a low-bias method to detect and quantify exon-defining units from paired-end RNA-Seq alignments.
# test that all the requisite packages are avialable in path
# define a function that returns status 1 if a package isn't available
function checkAvailable {
builtin type-P"$1" &> /dev/null
}
# iterate over the required packages
for targetMod in samtools bedtools parallel java julia;do
checkAvailable $targetMod|| die "cannot locate package $targetMod in user PATH"
done
# specify the default verbosity and threadcount
export threadCount="8"
# initilalize bamcount and mode
export bamCount=0
export MODE="die"
# process the input arguments
ARGS=""
while[$# -gt 0 ]
do
unset OPTIND
unset OPTARG
while getopts a:b:o:t:v:m: options
do
case$optionsin
a)# annotation
[-d${OPTARG}]&&export input="${OPTARG}"&&inputFiles=`ls-d${OPTARG}/*.*`|| die "cannot fetch input files"# get a list of files in the primary input
gunzipCount=$(echo$inputFiles | grep-c-e".gz");if[${gunzipCount}-gt"0"];then ssec "unzipping ${gunzipCount} files in ${1}";for i in${1}/*;do gunzip${i}|| die "cannot unzip ${i} " & done;wait;fi# unzip any .gz files if they are present
fastaCount=$(echo$inputFiles | tr" ""\n" | grep-v".fai" | grep-c-e".fasta"-e".fa"-e"fna");[${fastaCount}-eq"1"]|| die "did not identify a single input fasta in ${1}"# check that a fasta of some sort is present
GTFCount=$(echo$inputFiles | grep-c".gtf");["${GTFCount}"-eq"1"]|| die "did not identify a single input gtf in ${1}"# check that a single gtf is present
[-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}"
;;
o)# output directory
export outputDirectory="${OPTARG}"
mkdir-p${outputDirectory} 2>/dev/null
[-d${outputDirectory}]|| die "cannot access the user-specified output directory, '${outputDirectory}'"
;;
t)# threadCount
if[!-z"${OPTARG}"];then[["${OPTARG}"=~ ^-?[0-9]+$ ]]&&export threadCount="${OPTARG}"&& ssec "set threadcount to ${threadCount}"|| die "detected that user supplied invalid threadcount";else export threadCount="4"&& ssec "setting threadCount to 4 by default";fi
;;
m)# runmode; test if we want to run the entire index or just a specific region
echo"doing runmode test ${OPTARG}"
if[[${OPTARG}=="intron"]];then
export MODE="intron"
echo"shrek"
else die "could not parse the user provided runmode, ${OPTARG}";fi