Skip to content

Commit

Permalink
adding support to salmon and skewer
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacozzuto committed May 16, 2018
1 parent 596bb3f commit f674aa1
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 2 deletions.
21 changes: 19 additions & 2 deletions lib/Misc.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@

/*
* Function for running fastQC on input samples
*/

*/
static def samtoolSort(bamfile, sortedfile, cpus="1", debug="no") {

"""
Expand All @@ -21,6 +20,24 @@
fi
"""
}

/*
* Function for running fastQC on input samples
*/
static def getTranscriptsFromGTF(genome_file, annotation, output="transcript.fa", debug="no") {

"""
if [ `echo ${debug} == "debug"` ]; then print="echo "; else print=""; fi
if [ `echo ${genome_file} | grep ".gz"` ]; then
\$print zcat ${genome_file} > `basename ${genome_file} .gz`
\$print gffread -g `basename ${genome_file} .gz` -w ${output} ${annotation}
\$print rm `basename ${genome_file} .gz`
else \$print gffread -g ${genome_file} -w ${output} ${annotation}
fi
"""
}





Expand Down
32 changes: 32 additions & 0 deletions lib/NGSaligner.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,38 @@
fi
"""
}

/*
* Indexing a transcriptome with Salmon mapper. It reads both gzipped and plain fasta
*/

static def indexWithSalmon( transcript_file, indexname="transcript.index", kmer, cpus, extrapars="", debug="no") {

"""
if [ `echo ${transcript_file} | grep ".gz"` ]; then
zcat ${transcript_file} > `basename ${transcript_file} .gz`;
salmon index -t `basename ${transcript_file} .gz` -i ${indexname} --type quasi -k ${kmer} ${extrapars} -p ${cpus};
rm `basename ${transcript_file} .gz`;
else salmon index -t ${transcript_file} -i ${indexname} --type quasi -k ${kmer} ${extrapars} -p ${cpus}
fi
"""
}

/*
* Mapping to a transcriptome index with Salmon mapper.
*/

static def mapPEWithSalmon( transcript_index, readsA, readsB, output, libtype="ISF", cpus, extrapars="", debug="no") {

"""
if [ `echo ${readsA} | grep ".gz"` ]; then
salmon quant -i ${transcript_index} --gcBias -l ${libtype} -1 <(gunzip -c ${readsA}) -2 <(gunzip -c ${readsB}) ${extrapars} -o ${output}
else salmon quant -i ${transcript_index} --gcBias -l ${libtype} -1 ${readsA} -2 ${readsB} ${extrapars} -o ${output}
fi
"""
}


/*
* Mapping SE and PE reads with Bowtie2. Reads can be both gzipped and plain fastq
Expand Down

0 comments on commit f674aa1

Please sign in to comment.