Skip to content

Commit 992461c

Browse files
committed
successfully tested mapping to transcriptome on minmimal test dataset, and using bam input on minimal test data, both working, assets/schema_input.json adjusted to reflect samplesheet inputs, so far so good, needs testing on full size datasets and more proofchecking
1 parent 3bbe235 commit 992461c

10 files changed

Lines changed: 44 additions & 29 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
<!-- Additionally, it performs post transcriptome reconstruction assessment, and recovery. -->
1818

19-
The pipeline currently _only_ accepts sequencing data from directRNA Oxford
19+
The pipeline accepts sequencing data from both directRNA and cDNA Oxford
2020
Nanopore Technologies (ONT) libraries. It is recommended to provide raw FASTQ
2121
files to the pipeline, however, it will also accept already mapped sequencing
2222
reads in BAM format. These are provided to the samplesheet as input.

assets/schema_input.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"type": "string",
2424
"format": "file-path",
2525
"exists": true,
26-
"pattern": "^\\S+\\.f(ast)?q\\.gz$",
26+
"pattern": "^\\S+\\.(?:f(ast)?q\\.gz|bam)$",
2727
"errorMessage": "FastQ/BAM file must be provided, cannot contain spaces and must have extension '.fq.gz', '.fastq.gz' or '.bam'"
2828
}
2929
},
3.52 MB
Binary file not shown.

conf/test.config

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ params {
2121
max_time = '12.h'
2222

2323
// Input data
24-
input = 'test/samplesheets/samplesheet_test_dRNA.csv'
25-
sequencing_type = "ont-drna" // sequencing molecule [ont-drna OR ont-cdna]
26-
bam_input = false
24+
input = 'test/samplesheets/samplesheet_test_bam.csv'
25+
//input = 'test/samplesheets/samplesheet_test_dRNA.csv'
26+
sequencing_type = "ont-cdna" // sequencing molecule [ont-drna OR ont-cdna]
27+
bam_input = true
2728
// Genome references
2829
// These channel names have to match those in the full workflow also
2930
genome_fasta = "assets/test_data/KCMF1_hg38.fa"
@@ -40,6 +41,7 @@ params {
4041
// Skip processes for test
4142
// Give any required params for the test so that command line flags are not needed
4243
skip_mapping = false
44+
transcriptome_mapping = true
4345
skip_bam_to_bigwig = false
4446
skip_qc = false
4547
skip_bam_qc = false

conf/test_full.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ params {
3232
annotation_gtf = "assets/fulltest_data/Homo_sapiens.GRCh38.112_chr.gtf.gz"
3333
skip_prepare_reference = false
3434
skip_mapping = false
35+
transcriptome_mapping = false
3536
skip_bam_to_bigwig = false
3637
skip_qc = false
3738
skip_bam_qc = false

conf/test_gzipped.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ params {
4040
// Skip processes for test
4141
// Give any required params for the test so that command line flags are not needed
4242
skip_mapping = false
43+
transcriptome_mapping = false
4344
skip_bam_to_bigwig = false
4445
skip_qc = false
4546
skip_bam_qc = false

modules/local/minimap2/align/main.nf

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,10 @@ process MINIMAP2_ALIGN {
1818
task.ext.when == null || task.ext.when
1919

2020
script:
21-
// This can be expanded eventually to allow cDNA mapping, etc.
2221
def args = task.ext.args ?: ''
2322
def prefix = task.ext.prefix ?: "${meta.id}_${meta.replicate}_minimap2"
24-
//def dRNA_preset = task.ext.dRNA_preset ?: "-ax splice -uf"
25-
def preset = (params.sequencing_type == 'ont-drna') ?: "-ax splice -uf" : "-ax splice"
26-
def kmer = (params.sequencing_type == 'ont-drna') ?: "-k 14" : ""
23+
def preset = (params.sequencing_type == 'ont-drna') ? "-ax splice -uf" : "-ax splice"
24+
def kmer = (params.sequencing_type == 'ont-drna') ? "-k 14" : ""
2725

2826
"""
2927
minimap2 \\
@@ -39,12 +37,11 @@ process MINIMAP2_ALIGN {
3937
minimap2: \$(minimap2 --version 2>&1)
4038
END_VERSIONS
4139
"""
42-
//samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
4340

4441
stub:
4542
def prefix = task.ext.prefix ?: "${meta.id}_${meta.replicate}_minimap2"
46-
def preset = (params.sequencing_type == 'ont-drna') ?: "-ax splice -uf" : "-ax splice"
47-
def kmer = (params.sequencing_type == 'ont-drna') ?: "-k 14" : ""
43+
def preset = (params.sequencing_type == 'ont-drna') ? "-ax splice -uf" : "-ax splice"
44+
def kmer = (params.sequencing_type == 'ont-drna') ? "-k 14" : ""
4845

4946
"""
5047
touch ${prefix}.sam

nextflow_schema.json

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
"type": "string",
2828
"description": "Path to reference genome minimap2 index."
2929
},
30+
"transcriptome_mapping": {
31+
"type": "boolean",
32+
"description": "Map to reference transcriptome instead of genome."
33+
},
3034
"transcriptome_fasta": {
3135
"type": "string",
3236
"description": "Path to transcriptome fasta sequence."
@@ -44,7 +48,13 @@
4448
"description": "Skip the preparation of the reference files."
4549
}
4650
},
47-
"required": ["genome_fasta", "transcriptome_fasta", "annotation_gtf"],
51+
"required": [
52+
"genome_fasta",
53+
"transcriptome_fasta",
54+
"annotation_gtf",
55+
"transcriptome_mapping",
56+
"skip_prepare_reference"
57+
],
4858
"fa_icon": "fas fa-book-open"
4959
},
5060
"input_output_options": {
@@ -381,7 +391,8 @@
381391
"type": "boolean",
382392
"description": "Skip OARFISH transcript quantification."
383393
}
384-
}
394+
},
395+
"required": ["bam_input"]
385396
}
386397
},
387398
"allOf": [
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
sample,replicate,reads
2+
KCMF1,1,assets/test_data/KCMF1_1_sorted.bam

workflows/directrna.nf

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -173,18 +173,20 @@ workflow DIRECTRNA{
173173

174174
// QC of fastq files
175175
/// MODULES: NANOQ & SEQUALI
176-
if (!params.skip_qc || !params_bam_input) {
177-
if (!params.skip_nanoq) {
178-
NANOQ( ch_sample )
179-
ch_nanoq_stats = NANOQ.out.stats.collect{it[1]}.flatten()
180-
ch_multiqc_files = ch_multiqc_files.mix(ch_nanoq_stats.ifEmpty([]))
181-
ch_versions = ch_versions.mix(NANOQ.out.versions.first())
182-
}
183-
if (!params.skip_sequali) {
184-
SEQUALI( ch_sample )
185-
ch_sequali_stats = SEQUALI.out.sequali_json.collect{it[1]}.flatten()
186-
ch_multiqc_files = ch_multiqc_files.mix(ch_sequali_stats.ifEmpty([]))
187-
ch_versions = ch_versions.mix(SEQUALI.out.versions.first())
176+
if (!params.skip_qc) {
177+
if (!params.bam_input) {
178+
if (!params.skip_nanoq) {
179+
NANOQ( ch_sample )
180+
ch_nanoq_stats = NANOQ.out.stats.collect{it[1]}.flatten()
181+
ch_multiqc_files = ch_multiqc_files.mix(ch_nanoq_stats.ifEmpty([]))
182+
ch_versions = ch_versions.mix(NANOQ.out.versions.first())
183+
}
184+
if (!params.skip_sequali) {
185+
SEQUALI( ch_sample )
186+
ch_sequali_stats = SEQUALI.out.sequali_json.collect{it[1]}.flatten()
187+
ch_multiqc_files = ch_multiqc_files.mix(ch_sequali_stats.ifEmpty([]))
188+
ch_versions = ch_versions.mix(SEQUALI.out.versions.first())
189+
}
188190
}
189191
}
190192

@@ -252,7 +254,7 @@ workflow DIRECTRNA{
252254
// SUBWORKFLOW: MAPPING
253255
// TODO mapping to transcriptome
254256
if (!params.bam_input) {
255-
MAPPING( ch_sample, ch_genome_fasta, ch_genome_minimap2_index,
257+
MAPPING( ch_sample, ch_genome_minimap2_index,
256258
ch_transcriptome_minimap2_index )
257259
ch_bam = MAPPING.out.bam
258260
ch_bam_index = MAPPING.out.bai
@@ -263,8 +265,7 @@ workflow DIRECTRNA{
263265
ch_bam = ch_sample
264266
SAMTOOLS_INDEX( ch_bam )
265267
ch_bam_index = SAMTOOLS_INDEX.out.bai
266-
ch_bam_index_path = MAPPING.out.bai.flatten().last()
267-
ch_mixed_bam = ch_bam.combine(ch_bam_index_path)
268+
ch_mixed_bam = ch_bam.combine(ch_bam_index)
268269
}
269270

270271
// BAM TO BIGWIG for visualisation

0 commit comments

Comments
 (0)