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

fix producing provenance #23

Merged
merged 1 commit into from
Jun 1, 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
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,14 @@ nextflow run BCCDC-PHL/alignment-variants \

...which would produce files named: `test_fastp.csv` and `test_qualimap_bamqc.csv`.

If long reads are available, they can be included with the `--fastq_input_long` flag:
If long reads are available, they can be included with the `--fastq_input_long` and `--align_long_reads` flags:

```
nextflow run BCCDC-PHL/alignment-variants \
--ref /path/to/ref.fa \
--fastq_input /path/to/fastqs \
--fastq_input_long /path/to/long_fastqs \
--align_long_reads \
--outdir /path/to/outputs
```

Expand Down
15 changes: 6 additions & 9 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ workflow {
ch_nanopore_fastq = Channel.fromPath( params.fastq_nanopore_search_path ).map{ it -> [it.getName().split('_')[0], it] }.unique{ it -> it[0] }
}



main:
ch_illumina_sample_ids = ch_illumina_fastq.map{ it -> it[0] }
Expand Down Expand Up @@ -113,17 +112,15 @@ workflow {
// [sample_id, [provenance_file_1.yml, provenance_file_2.yml, provenance_file_3.yml...]]
// At each step, we add another provenance file to the list using the << operator...
// ...and then concatenate them all together in the 'collect_provenance' process.
ch_provenance = ch_provenance.combine(ch_pipeline_provenance).map{ it -> [it[0], [it[1]]] }
ch_provenance = ch_provenance.join(hash_ref.out.provenance).map{ it -> [it[0], it[1] << it[2]] }
ch_provenance = ch_provenance.combine(ch_pipeline_provenance).map{ it -> [it[0], [it[1]]] }
ch_provenance = ch_provenance.join(hash_ref.out.provenance).map{ it -> [it[0], it[1] << it[2]] }
ch_provenance = ch_provenance.join(hash_fastq_short.out.provenance).map{ it -> [it[0], it[1] << it[2]] }
// Check the length of the collected nanopore sample IDs to determine if we need to collect nanopore provenance
// I need to pull the value out of the channel and convert it to a list to get the length
ch_illumina_sample_ids.toList().size().view()
if (false) {
ch_provenance = ch_provenance.join(fastp.out.provenance).map{ it -> [it[0], it[1] << it[2]] }
if (params.align_long_reads) {
ch_provenance = ch_provenance.join(hash_fastq_long.out.provenance).map{ it -> [it[0], it[1] << it[2]] }
}
ch_provenance = ch_provenance.join(bwa_mem.out.provenance).map{ it -> [it[0], it[1] << it[2]] }
if (false) {
ch_provenance = ch_provenance.join(bwa_mem.out.provenance).map{ it -> [it[0], it[1] << it[2]] }
if (params.align_long_reads) {
ch_provenance = ch_provenance.join(nanoq_pre_filter.out.provenance).map{ it -> [it[0], it[1] << it[2]] }
ch_provenance = ch_provenance.join(filtlong.out.provenance).map{ it -> [it[0], it[1] << it[2]] }
ch_provenance = ch_provenance.join(nanoq_post_filter.out.provenance).map{ it -> [it[0], it[1] << it[2]] }
Expand Down
1 change: 1 addition & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ params {
coverage_by_depth_limit = 500
qualimap_memory = '4G'
skip_alignment_cleaning = false
align_long_reads = false
ref = 'NO_FILE'
outdir = 'results'
collect_outputs = false
Expand Down