Merge pull request #92 from drpatelh/salmon

Update Salmon modules
This commit is contained in:
Harshil Patel 2020-12-09 23:01:06 +00:00 committed by GitHub
commit deb0a103db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 11 deletions

View file

@ -5,7 +5,7 @@ params.options = [:]
def options = initOptions(params.options)
process SALMON_INDEX {
tag "$fasta"
tag "$transcript_fasta"
label "process_medium"
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
@ -15,19 +15,31 @@ process SALMON_INDEX {
container "quay.io/biocontainers/salmon:1.3.0--hf69c8f4_0"
input:
path fasta
path genome_fasta
path transcript_fasta
output:
path "salmon" , emit: index
path "*.version.txt", emit: version
script:
def software = getSoftwareName(task.process)
def software = getSoftwareName(task.process)
def get_decoy_ids = "grep '^>' $genome_fasta | cut -d ' ' -f 1 > decoys.txt"
def gentrome = "gentrome.fa"
if (genome_fasta.endsWith('.gz')) {
get_decoy_ids = "grep '^>' <(gunzip -c $genome_fasta) | cut -d ' ' -f 1 > decoys.txt"
gentrome = "gentrome.fa.gz"
}
"""
$get_decoy_ids
sed -i.bak -e 's/>//g' decoys.txt
cat $transcript_fasta $genome_fasta > $gentrome
salmon \\
index \\
--threads $task.cpus \\
-t $fasta \\
-t gentrome.fa \\
-d decoys.txt \\
$options.args \\
-i salmon
salmon --version | sed -e "s/salmon //g" > ${software}.version.txt

View file

@ -18,15 +18,23 @@ process SALMON_QUANT {
tuple val(meta), path(reads)
path index
path gtf
path transcript_fasta
val alignment_mode
output:
tuple val(meta), path("${prefix}"), emit: results
path "*.version.txt" , emit: version
script:
def software = getSoftwareName(task.process)
prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def endedness = meta.single_end ? "-r $reads" : "-1 ${reads[0]} -2 ${reads[1]}"
def software = getSoftwareName(task.process)
prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
def reference = "--index $index"
def input_reads = meta.single_end ? "-r $reads" : "-1 ${reads[0]} -2 ${reads[1]}"
if (alignment_mode) {
reference = "-t $transcript_fasta"
input_reads = "-a $reads"
}
def strandedness = meta.single_end ? 'U' : 'IU'
if (meta.strandedness == 'forward') {
@ -39,8 +47,8 @@ process SALMON_QUANT {
--geneMap $gtf \\
--threads $task.cpus \\
--libType=$strandedness \\
--index $index \\
$endedness \\
$reference \\
$input_reads \\
$options.args \\
-o $prefix

View file

@ -6,7 +6,7 @@ def options = initOptions(params.options)
def VERSION = '377'
process UCSC_BEDRAPHTOBIGWIG {
process UCSC_BEDGRAPHTOBIGWIG {
tag "$meta.id"
label 'process_medium'
publishDir "${params.outdir}",