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)
|
||||
|
||||
process SALMON_INDEX {
|
||||
tag "$fasta"
|
||||
tag "$transcript_fasta"
|
||||
label "process_medium"
|
||||
publishDir "${params.outdir}",
|
||||
mode: params.publish_dir_mode,
|
||||
|
@ -15,7 +15,8 @@ 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
|
||||
|
@ -23,11 +24,22 @@ process SALMON_INDEX {
|
|||
|
||||
script:
|
||||
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
|
||||
|
|
|
@ -18,6 +18,8 @@ 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
|
||||
|
@ -26,7 +28,13 @@ process SALMON_QUANT {
|
|||
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 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
|
||||
|
||||
|
|
|
@ -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}",
|
||||
|
|
Loading…
Reference in a new issue