Skip to content

Commit 7881bd6

Browse files
committed
testing bam input and mapping to transcriptome
1 parent f9c5123 commit 7881bd6

16 files changed

Lines changed: 304 additions & 89 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
XM_047445126.1 7618 115 70 71

conf/test.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ params {
3232
genome_fasta_sizes = "assets/test_data/KCMF1_hg38.fa.sizes"
3333
genome_minimap2_index = "assets/test_data/KCMF1_hg38_k14.mmi"
3434
transcriptome_fasta = "assets/test_data/KCMF1_hg38_transcript.fa"
35+
transcriptome_fasta_index = "assets/test_data/KCMF1_hg38_transcript.fa.fai"
3536
transcriptome_minimap2_index = "assets/test_data/KCMF1_hg38_transcript_k14.mmi"
3637
annotation_gtf = "assets/test_data/KCMF1_hg38_transcript.gtf"
3738
skip_prepare_reference = true

conf/test_full.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ params {
2929
genome_fasta_sizes = null
3030
genome_minimap2_index = null
3131
transcriptome_fasta = "assets/fulltest_data/Homo_sapiens.GRCh38.112_chr_transcripts.fa.gz"
32+
transcriptome_fasta_index = null
3233
transcriptome_minimap2_index = null
3334
annotation_gtf = "assets/fulltest_data/Homo_sapiens.GRCh38.112_chr.gtf.gz"
3435
skip_prepare_reference = false
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
process SAMTOOLS_FASTA {
2+
tag "$meta.id"
3+
label 'process_low'
4+
5+
conda "${moduleDir}/environment.yml"
6+
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
7+
'https://depot.galaxyproject.org/singularity/samtools:1.20--h50ea8bc_0' :
8+
'biocontainers/samtools:1.20--h50ea8bc_0' }"
9+
10+
input:
11+
tuple val(meta), path(bam)
12+
13+
output:
14+
tuple val(meta), path("*.fasta"), emit: fasta
15+
path "versions.yml", emit: versions
16+
17+
when:
18+
task.ext.when == null || task.ext.when
19+
20+
script:
21+
def args = task.ext.args ?: ''
22+
def prefix = task.ext.prefix ?: "${meta.id}_${meta.replicate}_unmapped"
23+
24+
"""
25+
samtools fasta \\
26+
-f 4 \\
27+
-@ $task.cpus \\
28+
${bam} \\
29+
> ${prefix}.fasta \\
30+
31+
cat <<-END_VERSIONS > versions.yml
32+
"${task.process}":
33+
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
34+
END_VERSIONS
35+
"""
36+
37+
stub:
38+
def args = task.ext.args ?: ''
39+
def prefix = task.ext.prefix ?: "${meta.id}_${meta.replicate}_unmapped"
40+
41+
"""
42+
touch ${prefix}.fasta
43+
cat <<-END_VERSIONS > versions.yml
44+
"${task.process}":
45+
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
46+
END_VERSIONS
47+
"""
48+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
process {
2+
withName: 'SAMTOOLS_FASTA' {
3+
publishDir = [
4+
path: { "${params.outdir}/mapping/unmapped_reads/${meta.id}_${meta.replicate}" },
5+
//mode: params.publish_dir_mode
6+
]
7+
}
8+
}

modules/local/sylph/profile/main.nf

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,12 @@ process SYLPH_PROFILE {
2323
"""
2424
sylph profile \\
2525
$sylph_database \\
26-
$sample \\
27-
$task.cpus \\
26+
-r $sample \\
2827
-o ${prefix}_sylph.tsv
2928
3029
cat <<-END_VERSIONS > versions.yml
3130
"${task.process}":
32-
sylph_profile: \$(sylph --version | cut -d" " -f2')
31+
sylph_profile: \$(sylph --version | cut -d" " -f2)
3332
END_VERSIONS
3433
"""
3534

@@ -40,7 +39,7 @@ process SYLPH_PROFILE {
4039
touch ${prefix}_sylph.tsv
4140
cat <<-END_VERSIONS > versions.yml
4241
"${task.process}":
43-
sylph_profile: \$(sylph --version | cut -d" " -f2')
42+
sylph_profile: \$(sylph --version | cut -d" " -f2)
4443
END_VERSIONS
4544
"""
4645
}

modules/local/sylph/tax/main.nf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ process SYLPH_TAX {
2121
def prefix = task.ext.prefix ?: "${meta.id}_${meta.replicate}"
2222

2323
"""
24+
sylph-tax download --download-to .
25+
2426
sylph-tax taxprof \\
2527
$sylph_profile \\
2628
-t $database_name \\

nextflow.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ params {
2424
skip_prepare_reference = false // even if paths are hardcoded, files need to be unzipped and so on
2525
genome_minimap2_index = null
2626
transcriptome_fasta = null // e.g. 'data/gencode.v46.transcripts.fa.gz'
27+
transcriptome_fasta_index = null
2728
transcriptome_minimap2_index = null
2829
annotation_gtf = null // e.g. 'data/Homo_sapiens.GRCh38.112.gtf.gz'
2930

nextflow_schema.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
"type": "string",
3636
"description": "Path to transcriptome fasta sequence."
3737
},
38+
"transcriptome_fasta_index": {
39+
"type": "string",
40+
"description": "Path to transcriptome fasta index."
41+
},
3842
"transcriptome_minimap2_index": {
3943
"type": "string",
4044
"description": "Path to transcriptome minimap2 index."

0 commit comments

Comments
 (0)