Skip to content

Commit 3bbe235

Browse files
committed
included code to allow for the mapping to the transcriptome, as well as using cDNA rather than dRNA in minimap, but both are untested
1 parent f3d0390 commit 3bbe235

File tree

9 files changed

+19
-105
lines changed

9 files changed

+19
-105
lines changed

docs/usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ CONTROL1,2,data/long_reads_2.fastq.gz
2828
| ----------- | -------------------------- |
2929
| `sample` | Sample name. |
3030
| `replicate` | Technical replicate number |
31-
| `reads` | Full path to fastq reads. |
31+
| `reads` | Full path to fastq reads. |
3232

3333
An [example samplesheet](../assets/samplesheet.csv) has been provided with the pipeline.
3434

modules/local/minimap2/align/main.nf

Lines changed: 8 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,10 @@ process MINIMAP2_ALIGN {
99
input:
1010
tuple val(meta), path(fastq)
1111
path(genome_index)
12-
// tuple val(meta2), path(reference)
13-
// val bam_format
14-
// val bam_index_extension
15-
// val cigar_paf_format
16-
// val cigar_bam
1712

1813
output:
19-
//tuple val(meta), path("*.paf") , optional: true, emit: paf
20-
tuple val(meta), path("*.sam") , optional: true, emit: sam
21-
//tuple val(meta), path("*.bam.${bam_index_extension}"), optional: true, emit: index
22-
path "versions.yml" , emit: versions
14+
tuple val(meta), path("*.sam") , optional: true, emit: sam
15+
path "versions.yml" , emit: versions
2316

2417
when:
2518
task.ext.when == null || task.ext.when
@@ -28,29 +21,13 @@ process MINIMAP2_ALIGN {
2821
// This can be expanded eventually to allow cDNA mapping, etc.
2922
def args = task.ext.args ?: ''
3023
def prefix = task.ext.prefix ?: "${meta.id}_${meta.replicate}_minimap2"
31-
def dRNA_preset = task.ext.dRNA_preset ?: "-ax splice -uf"
32-
def kmer = task.ext.kmer ?: "-k 14"
33-
//def mismatch_tag = (params.talon ) ? "--MD"
34-
/*
35-
def args2 = task.ext.args2 ?: ''
36-
def args3 = task.ext.args3 ?: ''
37-
def args4 = task.ext.args4 ?: ''
38-
def bam_index = bam_index_extension ? "${prefix}.bam##idx##${prefix}.bam.${bam_index_extension} --write-index" : "${prefix}.bam"
39-
def bam_output = bam_format ? "-a | samtools sort -@ ${task.cpus-1} -o ${bam_index} ${args2}" : "-o ${prefix}.paf"
40-
def cigar_paf = cigar_paf_format && !bam_format ? "-c" : ''
41-
def set_cigar_bam = cigar_bam && bam_format ? "-L" : ''
42-
def bam_input = "${reads.extension}".matches('sam|bam|cram')
43-
def samtools_reset_fastq = bam_input ? "samtools reset --threads ${task.cpus-1} $args3 $reads | samtools fastq --threads ${task.cpus-1} $args4 |" : ''
44-
def query = bam_input ? "-" : reads
45-
def target = reference ?: (bam_input ? error("BAM input requires reference") : reads)
46-
*/
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" : ""
4727

48-
//$samtools_reset_fastq \\
49-
// $set_cigar_bam \\
50-
// $bam_output
5128
"""
5229
minimap2 \\
53-
${dRNA_preset} \\
30+
${preset} \\
5431
${kmer} \\
5532
-t ${task.cpus} \\
5633
${genome_index} \\
@@ -66,12 +43,8 @@ process MINIMAP2_ALIGN {
6643

6744
stub:
6845
def prefix = task.ext.prefix ?: "${meta.id}_${meta.replicate}_minimap2"
69-
def dRNA_preset = task.ext.dRNA_preset ?: "-ax splice -uf"
70-
def kmer = task.ext.kmer ?: "-k 14"
71-
//def output_file = bam_format ? "${prefix}.bam" : "${prefix}.paf"
72-
//def bam_index = bam_index_extension ? "touch ${prefix}.bam.${bam_index_extension}" : ""
73-
//def bam_input = "${reads.extension}".matches('sam|bam|cram')
74-
//def target = reference ?: (bam_input ? error("BAM input requires reference") : reads)
46+
def preset = (params.sequencing_type == 'ont-drna') ?: "-ax splice -uf" : "-ax splice"
47+
def kmer = (params.sequencing_type == 'ont-drna') ?: "-k 14" : ""
7548

7649
"""
7750
touch ${prefix}.sam

nextflow.config

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ plugins {
1414
params {
1515
// Input options
1616
input = 'assets/samplesheet.csv'
17-
sequencing_type = "ont-drna" // sequencing molecule [ont-drna OR ont-cdna]
18-
bam_input = false
17+
sequencing_type = "ont-drna" // sequencing library [ont-drna OR ont-cdna]
18+
bam_input = false // input premapped bam files. default: [false]
1919
// References
2020
genome_fasta = null //'data/hg38.analysisSet.fa.gz'
2121
genome_fasta_index = null //'data/hg38.analysisSet.fa.fai'
2222
genome_fasta_sizes = null
2323
//custom_genome = false // only when providing novel genomes
2424
skip_prepare_reference = false // even if paths are hardcoded, files need to be unzipped and so on
2525
genome_minimap2_index = null
26-
transcriptome_fasta = null //'data/gencode.v46.transcripts.fa.gz'
26+
transcriptome_fasta = null // e.g. 'data/gencode.v46.transcripts.fa.gz'
2727
transcriptome_minimap2_index = null
28-
annotation_gtf = null // 'data/Homo_sapiens.GRCh38.112.gtf.gz'
28+
annotation_gtf = null // e.g. 'data/Homo_sapiens.GRCh38.112.gtf.gz'
2929

3030
//igenomes
3131
//igenomes_base = 's3://ngi-igenomes/igenomes/'
@@ -59,6 +59,7 @@ params {
5959
//extra_ngs_bits_options = null
6060

6161
// MAPPING
62+
transcriptome_mapping = false
6263
// minimap2 options
6364
skip_mapping = false
6465
//extra_minimap2_options = null
@@ -141,14 +142,6 @@ params {
141142
//max_memory = '32.GB'
142143
//max_cpus = 10
143144
//max_time = '48.h'
144-
145-
// Schema validation default options
146-
//validationFailUnrecognisedParams = false
147-
//validationLenientMode = false
148-
//validationSchemaIgnoreParams = 'genomes,igenomes_base'
149-
//validationShowHiddenParams = false
150-
//validate_params = true
151-
152145
}
153146

154147
validation {

nextflow_schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
"type": "string",
8383
"default": "ont-drna",
8484
"description": "Type of Oxford Nanopore library.",
85-
"help_text": "Type of Oxford nanopore library. Either 'ont-drna' or 'ont-cdna'",
85+
"help_text": "Type of Oxford nanopore library. Either 'ont-drna' or 'ont-cdna'.",
8686
"fa_icon": "fas fa-font"
8787
}
8888
}

0 commit comments

Comments
 (0)