mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-22 19:18:17 +00:00
commit
deb0a103db
3 changed files with 31 additions and 11 deletions
|
@ -5,7 +5,7 @@ params.options = [:]
|
||||||
def options = initOptions(params.options)
|
def options = initOptions(params.options)
|
||||||
|
|
||||||
process SALMON_INDEX {
|
process SALMON_INDEX {
|
||||||
tag "$fasta"
|
tag "$transcript_fasta"
|
||||||
label "process_medium"
|
label "process_medium"
|
||||||
publishDir "${params.outdir}",
|
publishDir "${params.outdir}",
|
||||||
mode: params.publish_dir_mode,
|
mode: params.publish_dir_mode,
|
||||||
|
@ -15,21 +15,33 @@ process SALMON_INDEX {
|
||||||
container "quay.io/biocontainers/salmon:1.3.0--hf69c8f4_0"
|
container "quay.io/biocontainers/salmon:1.3.0--hf69c8f4_0"
|
||||||
|
|
||||||
input:
|
input:
|
||||||
path fasta
|
path genome_fasta
|
||||||
|
path transcript_fasta
|
||||||
|
|
||||||
output:
|
output:
|
||||||
path "salmon" , emit: index
|
path "salmon" , emit: index
|
||||||
path "*.version.txt", emit: version
|
path "*.version.txt", emit: version
|
||||||
|
|
||||||
script:
|
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 \\
|
salmon \\
|
||||||
index \\
|
index \\
|
||||||
--threads $task.cpus \\
|
--threads $task.cpus \\
|
||||||
-t $fasta \\
|
-t gentrome.fa \\
|
||||||
|
-d decoys.txt \\
|
||||||
$options.args \\
|
$options.args \\
|
||||||
-i salmon
|
-i salmon
|
||||||
salmon --version | sed -e "s/salmon //g" > ${software}.version.txt
|
salmon --version | sed -e "s/salmon //g" > ${software}.version.txt
|
||||||
"""
|
"""
|
||||||
}
|
}
|
|
@ -18,16 +18,24 @@ process SALMON_QUANT {
|
||||||
tuple val(meta), path(reads)
|
tuple val(meta), path(reads)
|
||||||
path index
|
path index
|
||||||
path gtf
|
path gtf
|
||||||
|
path transcript_fasta
|
||||||
|
val alignment_mode
|
||||||
|
|
||||||
output:
|
output:
|
||||||
tuple val(meta), path("${prefix}"), emit: results
|
tuple val(meta), path("${prefix}"), emit: results
|
||||||
path "*.version.txt" , emit: version
|
path "*.version.txt" , emit: version
|
||||||
|
|
||||||
script:
|
script:
|
||||||
def software = getSoftwareName(task.process)
|
def software = getSoftwareName(task.process)
|
||||||
prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
|
prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
|
||||||
def endedness = meta.single_end ? "-r $reads" : "-1 ${reads[0]} -2 ${reads[1]}"
|
|
||||||
|
|
||||||
|
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'
|
def strandedness = meta.single_end ? 'U' : 'IU'
|
||||||
if (meta.strandedness == 'forward') {
|
if (meta.strandedness == 'forward') {
|
||||||
strandedness = meta.single_end ? 'SF' : 'ISF'
|
strandedness = meta.single_end ? 'SF' : 'ISF'
|
||||||
|
@ -39,8 +47,8 @@ process SALMON_QUANT {
|
||||||
--geneMap $gtf \\
|
--geneMap $gtf \\
|
||||||
--threads $task.cpus \\
|
--threads $task.cpus \\
|
||||||
--libType=$strandedness \\
|
--libType=$strandedness \\
|
||||||
--index $index \\
|
$reference \\
|
||||||
$endedness \\
|
$input_reads \\
|
||||||
$options.args \\
|
$options.args \\
|
||||||
-o $prefix
|
-o $prefix
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ def options = initOptions(params.options)
|
||||||
|
|
||||||
def VERSION = '377'
|
def VERSION = '377'
|
||||||
|
|
||||||
process UCSC_BEDRAPHTOBIGWIG {
|
process UCSC_BEDGRAPHTOBIGWIG {
|
||||||
tag "$meta.id"
|
tag "$meta.id"
|
||||||
label 'process_medium'
|
label 'process_medium'
|
||||||
publishDir "${params.outdir}",
|
publishDir "${params.outdir}",
|
||||||
|
|
Loading…
Reference in a new issue