Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove trimming #208

Merged
merged 5 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### `Added`

- [#206](https://github.com/nf-core/demultiplex/pull/206) Add test with uncompressed data.
- [#208](https://github.com/nf-core/demultiplex/pull/208) Added parameter for removing adapter information from samplesheets.

## 1.4.1 - 2024-02-27

Expand Down
1 change: 1 addition & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ params {

// Options: trimming
trim_fastq = true // [true, false]
remove_adapter = true // [true, false]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I first read this parameter, I interpret as trimming it, like removing from the sequence.

Reading the rest I know it refers to removing from the samplesheet to avoid trimmimg.

But, I just wanted to bring this up, as maybe the parameter can be more explicit to avoid such confusion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your feedback. I understand the possible confusion about the parameter name. Since this parameter follows 10x's recommended method and is usually left as default, most users won't need to change it. If users do want to change it, they will likely have to read the documentation for details, so I don't think it should be too much of an issue.


// Options: tooling
skip_tools = [] // list [fastp, fastqc]
Expand Down
5 changes: 5 additions & 0 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,11 @@
"description": "Custom MultiQC yaml file containing HTML including a methods description.",
"fa_icon": "fas fa-cog"
},
"remove_adapter": {
"type": "boolean",
"description": "Boolean whether to remove adapter information from Illumina samplesheet. If adapter information is present, the various bcl conversion tools will perform adapter trimming already at the demultiplexing step.",
"default": "true"
},
"validate_params": {
"type": "boolean",
"description": "Boolean whether to validate parameters against the schema at runtime",
Expand Down
16 changes: 14 additions & 2 deletions tests/pipeline/bclconvert.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,25 @@
"Quality_Metrics.csv:md5,6614accb1bb414fe312b17b81f5521f7",
"Quality_Tile_Metrics.csv:md5,cdc89fd2962bdd4a24f71e186112118a",
"RunInfo.xml:md5,03038959f4dd181c86bc97ae71fe270a",
"SampleSheet.csv:md5,2df2e405991814571c021dc8749c2a89",
"SampleSheet.csv:md5,ee5db2e12754e069998b0a96e535238c",
"Top_Unknown_Barcodes.csv:md5,2e2faba761137f228e56bd3428453ccc",
"fastq_list.csv:md5,05bc84f51840f5754cfb8381b36f2cb0"
]
],
"timestamp": "2023-12-11T16:38:54.135338"
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.0"
},
"timestamp": "2024-07-23T22:32:32.517671192"
},
"software_versions": {
"content": [
"{BCLCONVERT={bclconvert=00.000.000.4.2.7}, FALCO={falco=1.2.1}, FASTP={fastp=0.23.4}, MD5SUM={md5sum=8.3}, Workflow={nf-core/demultiplex=v1.5.0dev}}"
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.0"
},
"timestamp": "2024-05-16T08:36:09.489747"
},
"multiqc": {
Expand All @@ -34,6 +42,10 @@
"multiqc_fastp.txt:md5,d65cc0ccd033e949132c2e46b1f81717",
"multiqc_bclconvert_bysample.txt:md5,07048c9b73ed85bdac03c476b192c4e3"
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.0"
},
"timestamp": "2024-05-15T01:34:10.988849"
}
}
60 changes: 50 additions & 10 deletions tests/pipeline/skip_tools.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
"content": [
"{BCLCONVERT={bclconvert=00.000.000.4.2.7}, FALCO={falco=1.2.1}, FASTP={fastp=0.23.4}, MD5SUM={md5sum=8.3}, Workflow={nf-core/demultiplex=v1.5.0dev}}"
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.0"
},
"timestamp": "2024-05-16T08:39:34.361632"
},
"skip_fastqc": {
Expand All @@ -20,12 +24,16 @@
"Quality_Metrics.csv:md5,6614accb1bb414fe312b17b81f5521f7",
"Quality_Tile_Metrics.csv:md5,cdc89fd2962bdd4a24f71e186112118a",
"RunInfo.xml:md5,03038959f4dd181c86bc97ae71fe270a",
"SampleSheet.csv:md5,2df2e405991814571c021dc8749c2a89",
"SampleSheet.csv:md5,ee5db2e12754e069998b0a96e535238c",
"Top_Unknown_Barcodes.csv:md5,2e2faba761137f228e56bd3428453ccc",
"fastq_list.csv:md5,05bc84f51840f5754cfb8381b36f2cb0"
]
],
"timestamp": "2023-12-11T16:45:17.736105"
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.0"
},
"timestamp": "2024-07-23T22:27:37.881306832"
},
"skip_fastp": {
"content": [
Expand All @@ -42,12 +50,16 @@
"Quality_Metrics.csv:md5,6614accb1bb414fe312b17b81f5521f7",
"Quality_Tile_Metrics.csv:md5,cdc89fd2962bdd4a24f71e186112118a",
"RunInfo.xml:md5,03038959f4dd181c86bc97ae71fe270a",
"SampleSheet.csv:md5,2df2e405991814571c021dc8749c2a89",
"SampleSheet.csv:md5,ee5db2e12754e069998b0a96e535238c",
"Top_Unknown_Barcodes.csv:md5,2e2faba761137f228e56bd3428453ccc",
"fastq_list.csv:md5,05bc84f51840f5754cfb8381b36f2cb0"
]
],
"timestamp": "2023-12-11T16:43:54.005346"
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.0"
},
"timestamp": "2024-07-23T22:25:35.140271903"
},
"skip_multiqc": {
"content": [
Expand All @@ -64,12 +76,16 @@
"Quality_Metrics.csv:md5,6614accb1bb414fe312b17b81f5521f7",
"Quality_Tile_Metrics.csv:md5,cdc89fd2962bdd4a24f71e186112118a",
"RunInfo.xml:md5,03038959f4dd181c86bc97ae71fe270a",
"SampleSheet.csv:md5,2df2e405991814571c021dc8749c2a89",
"SampleSheet.csv:md5,ee5db2e12754e069998b0a96e535238c",
"Top_Unknown_Barcodes.csv:md5,2e2faba761137f228e56bd3428453ccc",
"fastq_list.csv:md5,05bc84f51840f5754cfb8381b36f2cb0"
]
],
"timestamp": "2023-12-11T16:47:17.03681"
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.0"
},
"timestamp": "2024-07-23T22:30:34.614021228"
},
"skip_fastp_fastqc": {
"content": [
Expand All @@ -86,35 +102,55 @@
"Quality_Metrics.csv:md5,6614accb1bb414fe312b17b81f5521f7",
"Quality_Tile_Metrics.csv:md5,cdc89fd2962bdd4a24f71e186112118a",
"RunInfo.xml:md5,03038959f4dd181c86bc97ae71fe270a",
"SampleSheet.csv:md5,2df2e405991814571c021dc8749c2a89",
"SampleSheet.csv:md5,ee5db2e12754e069998b0a96e535238c",
"Top_Unknown_Barcodes.csv:md5,2e2faba761137f228e56bd3428453ccc",
"fastq_list.csv:md5,05bc84f51840f5754cfb8381b36f2cb0"
]
],
"timestamp": "2023-12-11T16:46:00.460287"
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.0"
},
"timestamp": "2024-07-23T22:28:46.845866763"
},
"software_versions_skip_fastqc": {
"content": [
"{BCLCONVERT={bclconvert=00.000.000.4.2.7}, FALCO={falco=1.2.1}, FASTP={fastp=0.23.4}, MD5SUM={md5sum=8.3}, Workflow={nf-core/demultiplex=v1.5.0dev}}"
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.0"
},
"timestamp": "2024-05-16T08:41:12.480795"
},
"software_versions_skip_fastp_fastqc": {
"content": [
"{BCLCONVERT={bclconvert=00.000.000.4.2.7}, FALCO={falco=1.2.1}, MD5SUM={md5sum=8.3}, Workflow={nf-core/demultiplex=v1.5.0dev}}"
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.0"
},
"timestamp": "2024-05-16T08:41:37.617916"
},
"software_versions_skip_multiqc": {
"content": [
"{BCLCONVERT={bclconvert=00.000.000.4.2.7}, FALCO={falco=1.2.1}, FASTP={fastp=0.23.4}, MD5SUM={md5sum=8.3}, Workflow={nf-core/demultiplex=v1.5.0dev}}"
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.0"
},
"timestamp": "2024-05-16T08:42:46.504885"
},
"software_versions_skip_fastp": {
"content": [
"{BCLCONVERT={bclconvert=00.000.000.4.2.7}, FALCO={falco=1.2.1}, MD5SUM={md5sum=8.3}, Workflow={nf-core/demultiplex=v1.5.0dev}}"
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.0"
},
"timestamp": "2024-05-16T08:40:02.626844"
},
"skip_trimming": {
Expand All @@ -132,11 +168,15 @@
"Quality_Metrics.csv:md5,6614accb1bb414fe312b17b81f5521f7",
"Quality_Tile_Metrics.csv:md5,cdc89fd2962bdd4a24f71e186112118a",
"RunInfo.xml:md5,03038959f4dd181c86bc97ae71fe270a",
"SampleSheet.csv:md5,2df2e405991814571c021dc8749c2a89",
"SampleSheet.csv:md5,ee5db2e12754e069998b0a96e535238c",
"Top_Unknown_Barcodes.csv:md5,2e2faba761137f228e56bd3428453ccc",
"fastq_list.csv:md5,05bc84f51840f5754cfb8381b36f2cb0"
]
],
"timestamp": "2023-12-11T16:43:15.513271"
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.0"
},
"timestamp": "2024-07-23T22:23:53.234471432"
}
}
33 changes: 33 additions & 0 deletions workflows/demultiplex.nf
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,39 @@ workflow DEMULTIPLEX {
ch_multiqc_files = Channel.empty()
ch_multiqc_reports = Channel.empty()

// Remove adapter from Illumina samplesheet to avoid adapter trimming in demultiplexer tools
if (params.remove_adapter && (params.demultiplexer in ["bcl2fastq", "bclconvert", "mkfastq"])) {
ch_samplesheet_no_adapter = ch_samplesheet
.map{meta,samplesheet,flowcell,lane ->
def samplesheet_out = new File("${samplesheet.getSimpleName()}_no_adapters.csv")
samplesheet_out.delete()
samplesheet_out.createNewFile()

def lines_out = ''
def new_line = ''
def removal_checker = false
samplesheet
.readLines()
.each { line ->
if ( line =~ /Adapter,[ACGT]+,/ ) {
new_line = line.replaceAll(/Adapter,[ACGT]+,/, 'Adapter,,')
removal_checker = true
} else if ( line =~ /AdapterRead2,[ACGT]+,/ ) {
new_line = line.replaceAll(/AdapterRead2,[ACGT]+,/, 'AdapterRead2,,')
removal_checker = true
} else {
new_line = line
}
lines_out = lines_out + new_line + '\n'
}
if (!removal_checker) {log.warn("Parameter 'remove_adapter' was set to true but no adapters were found in samplesheet")}

samplesheet_out.text=lines_out
[meta,file(samplesheet_out),flowcell,lane]
}
ch_samplesheet = ch_samplesheet_no_adapter
}

// Convenience
ch_samplesheet.dump(tag: 'DEMULTIPLEX::inputs', {FormattingService.prettyFormat(it)})

Expand Down
Loading