Skip to content

Commit 92f5838

Browse files
committed
adding in sylph profiling of unmapped reads, still much to do
1 parent 2006a41 commit 92f5838

16 files changed

Lines changed: 315 additions & 15 deletions

File tree

conf/test.config

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ params {
7373
skip_sqanti_all = true
7474
skip_gffcompare = false
7575
extra_gffcompare_options = null
76+
// CONTAMINATION / UNMAPPED READ PROFILING
77+
skip_sylph = true
78+
sylph_database_url = ''
79+
sylph_database_name = ''
7680
skip_sqanti_qc = true
7781
sqanti_qc_reference = 'human'
7882
sqanti_qc_cage = true

conf/test_full.config

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ params {
1818
config_profile_description = 'Full test dataset to check pipeline function'
1919

2020
// Input data
21-
//input = "test/samplesheets/samplesheet_test_local.csv"
22-
input = "test/samplesheets/samplesheet_test_local_bam.csv"
21+
input = "test/samplesheets/samplesheet_test_local.csv"
22+
//input = "test/samplesheets/samplesheet_test_local_bam.csv"
2323
sequencing_type = "ont-cdna" // sequencing molecule [ont-drna OR ont-cdna]
24-
bam_input = true
24+
bam_input = false
2525
// Genome references
2626
// These channel names have to match those in the full workflow also
2727
genome_fasta = "assets/fulltest_data/hg38.analysisSet.fa.gz"
@@ -33,7 +33,7 @@ params {
3333
annotation_gtf = "assets/fulltest_data/Homo_sapiens.GRCh38.112_chr.gtf.gz"
3434
skip_prepare_reference = false
3535
skip_mapping = false
36-
transcriptome_mapping = false
36+
transcriptome_mapping = true
3737
skip_bam_to_bigwig = false
3838
skip_qc = false
3939
skip_bam_qc = false
@@ -66,6 +66,10 @@ params {
6666
// TRANSCRIPTOME ASSESSMENT
6767
skip_gffcompare = false
6868
extra_gffcompare_options = null
69+
// CONTAMINATION / UNMAPPED READ PROFILING
70+
skip_sylph = false
71+
sylph_database_url = "http://faust.compbio.cs.cmu.edu/sylph-stuff/gtdb-r226-c1000-dbv1.syldb"
72+
sylph_database_name = "GTDB_r226"
6973
skip_sqanti_all = true
7074
skip_sqanti_qc = true
7175
sqanti_qc_reference = 'human'

conf/test_gzipped.config

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ params {
7272
skip_sqanti_all = true
7373
skip_gffcompare = false
7474
extra_gffcompare_options = null
75+
// CONTAMINATION / UNMAPPED READ PROFILING
76+
skip_sylph = true
77+
sylph_database_url = ""
78+
sylph_database_name = ""
7579
skip_sqanti_qc = true
7680
sqanti_qc_reference = 'human'
7781
sqanti_qc_cage = true

modules/local/curl/curl/main.nf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ process CURL {
55
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
66
'docker://ricsanfre/docker-curl-jq:latest':
77
'docker://ricsanfre/docker-curl-jq:latest' }"
8-
//'curl/curl:8.14.1':
9-
//'alpine/curl:8.14.1'}"
108
//'docker://quay.io/curl/curl:8.14.1' }"
119

1210
input:
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
process SAMTOOLS_VIEW {
2+
tag "$meta.id"
3+
label 'process_low'
4+
5+
conda "bioconda::samtools=1.20-0"
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("*.bam") , emit: unmapped_bam
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 ?: '-h -f 4 -b'
22+
def prefix = task.ext.prefix ?: "${meta.id}_${meta.replicate}"
23+
24+
"""
25+
samtools \\
26+
view \\
27+
$args \\
28+
-@ ${task.cpus-1} \\
29+
${bam} \\
30+
-o "$prefix"_unmapped.bam
31+
32+
cat <<-END_VERSIONS > versions.yml
33+
"${task.process}":
34+
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
35+
END_VERSIONS
36+
"""
37+
38+
stub:
39+
def args = task.ext.args ?: '-h -f 4 -b'
40+
def prefix = task.ext.prefix ?: "${meta.id}_${meta.replicate}"
41+
42+
"""
43+
touch "${prefix}"_ummapped.bam
44+
45+
cat <<-END_VERSIONS > versions.yml
46+
"${task.process}":
47+
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
48+
END_VERSIONS
49+
"""
50+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
process {
2+
withName: 'SAMTOOLS_VIEW' {
3+
publishDir = [
4+
path: { "${params.outdir}/mapping/${meta.id}_${meta.replicate}" },
5+
//mode: params.publish_dir_mode
6+
]
7+
}
8+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
process SYLPH_PREPARE_REFERENCE {
2+
tag "SYLPH_REFERENCE"
3+
label 'process_low'
4+
conda "${moduleDir}/environment.yml"
5+
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
6+
'docker://ricsanfre/docker-curl-jq:latest':
7+
'docker://ricsanfre/docker-curl-jq:latest' }"
8+
9+
input:
10+
val url
11+
12+
output:
13+
path("*.syldb"), emit: database
14+
path "versions.yml", emit: versions
15+
16+
when:
17+
task.ext.when == null || task.ext.when
18+
19+
script:
20+
def args = task.ext.args ?: ''
21+
//def retry = task.ext.retry ?: '--retry 5'
22+
def mimic_browser = task.ext.mimic_browser ?: '-A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"'
23+
//def extension = ( archive.toString() - '.gz' ).tokenize('.')[-1]
24+
//def name = archive.toString() - '.gz' - ".$extension"
25+
//def prefix = task.ext.prefix ?: name
26+
//gunzip = prefix + ".$extension"
27+
"""
28+
curl \\
29+
$mimic_browser \\
30+
-L $url
31+
32+
cat <<-END_VERSIONS > versions.yml
33+
"${task.process}":
34+
curl: \$(curl --version | cut -d" " -f2 | head -n1)
35+
END_VERSIONS
36+
"""
37+
38+
stub:
39+
def args = task.ext.args ?: ''
40+
//def retry = task.ext.args ?: '--retry 5'
41+
def mimic_browser = task.ext.mimic_browser ?: '-A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"'
42+
//def extension = ( archive.toString() - '.gz' ).tokenize('.')[-1]
43+
//def name = archive.toString() - '.gz' - ".$extension"
44+
//def prefix = task.ext.prefix ?: name
45+
//gunzip = prefix + ".$extension"
46+
"""
47+
touch "*.syldb"
48+
cat <<-END_VERSIONS > versions.yml
49+
"${task.process}":
50+
curl: \$(curl --version | cut -d" " -f2 | head -n1)
51+
END_VERSIONS
52+
"""
53+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
process {
2+
withName: 'SYLPH_PREPARE_REFERENCE' {
3+
publishDir = [
4+
path: { "${params.outdir}/profile_unmapped_reads/sylph_database" },
5+
//mode: params.publish_dir_mode
6+
]
7+
}
8+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
process SYLPH_PROFILE {
2+
tag "SYLPH_PROFILE"
3+
label 'process_low'
4+
conda "${moduleDir}/environment.yml"
5+
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
6+
'https://depot.galaxyproject.org/singularity/sylph:0.9.0--ha6fb395_0' :
7+
'biocontainers/sylph:0.9.0--ha6fb395_0' }"
8+
9+
input:
10+
tuple val(meta), path(sample)
11+
path sylph_database
12+
13+
output:
14+
tuple val(meta), path("*.tsv") , emit: sylph_profile
15+
path "versions.yml" , emit: versions
16+
17+
when:
18+
task.ext.when == null || task.ext.when
19+
20+
script:
21+
def prefix = task.ext.prefix ?: "${meta.id}_${meta.replicate}"
22+
23+
"""
24+
sylph profile \\
25+
$sylph_database \\
26+
$sample \\
27+
$task.cpus \\
28+
-o ${prefix}_sylph.tsv
29+
30+
cat <<-END_VERSIONS > versions.yml
31+
"${task.process}":
32+
sylph_profile: \$(sylph --version | cut -d" " -f2')
33+
END_VERSIONS
34+
"""
35+
36+
stub:
37+
def prefix = task.ext.prefix ?: "${meta.id}_${meta.replicate}"
38+
39+
"""
40+
touch ${prefix}_sylph.tsv
41+
cat <<-END_VERSIONS > versions.yml
42+
"${task.process}":
43+
sylph_profile: \$(sylph --version | cut -d" " -f2')
44+
END_VERSIONS
45+
"""
46+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
process {
2+
withName: 'SYLPH_PREPARE_REFERENCE' {
3+
publishDir = [
4+
path: { "${params.outdir}/profile_unmapped_reads/sylph" },
5+
//mode: params.publish_dir_mode
6+
]
7+
}
8+
}

0 commit comments

Comments
 (0)