You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## How to add new input files and options to the reference sheet
4
+
5
+
To add new input files or options to the reference sheet, you have to complete all the following steps.
6
+
7
+
### Single-reference input workflow
8
+
9
+
1. Add your new parameter to nextflow.config.
10
+
2. Add parameter description to schema (nf-core schema build).
11
+
3. Read in new parameter (params.<NEW>) as input within the reference_indexing_single local subworkflow.
12
+
1. Add new line to the large `.map{}` operation starting on [line 80(https://github.com/nf-core/eager/blob/d4211582f349cc30c88202c12942218f99006041/subworkflows/local/reference_indexing_single.nf#L80)] and add check if the file exists.
2. Add <PARAM_NAME> to the result of the map operation. Double-check the order!
15
+
3. With the `ch_ref_index_single.multiMap{}` below you add the reference name as a meta. You can also combine your new parameter with others if useful for the workflow step.
16
+
`<NEW_SUBCHANNE>: [ meta, <PARAM_NAME> ]`
17
+
4. Add your ch_ref_index_single.<NEW_SUBCHANNEL> to the final emit.
1. Add new column named <SOFTWARE_FILETYPE> and test data to the test reference sheet (https://github.com/nf-core/test-datasets/blob/eager/reference/reference_sheet_multiref.csv).
23
+
2. Read in new input within the reference_indexing_multi local subworkflow.
24
+
1. Add new line to the large `.map{}` operation starting on [line 30](https://github.com/nf-core/eager/blob/d4211582f349cc30c88202c12942218f99006041/subworkflows/local/reference_indexing_multi.nf#L30). Add check if the file exists if appropriate.
2. Add <PARAM_NAME> to the result of the `.map{}` operation. Double-check the order!
27
+
3. With the `ch_input_from_referencesheet.multiMap{}` below you add the reference name as a meta. You can also combine your new parameter with others if useful for the workflow step.
28
+
`<NEW_SUBCHANNEL>: [ meta, <PARAM_NAME> ]`
29
+
4. Add ch_input_from_referencesheet.<NEW_SUBCHANNEL> to the final emit.
## PMD filtering with fasta masking for 1 of 2 references
628
+
## Expect: damage_manipulation directory with hs37d5_chr21-MT.masked.fa and bam and bai and flagstat per library and reference (22 files total). hs37d5_chr21-MT first masked with 1240K.pos.list_hs37d5.0based.bed.gz from reference sheet, PMD filtering run with masked reference fasta for hs37d5 and non-masked reference fasta for Mammoth_MT
629
+
nextflow run . -profile test_multiref,docker --run_pmd_filtering --outdir ./results
Copy file name to clipboardexpand all lines: docs/output.md
+2
Original file line number
Diff line number
Diff line change
@@ -464,11 +464,13 @@ Be advised that this process introduces reference bias in the resulting rescaled
464
464
465
465
-`*_pmdfiltered.bam`: Reads aligned to a reference genome that pass the post-mortem-damage threshold, in BAM format.
466
466
-`*_pmdfiltered.bam.{bai,csi}`: Index file corresponding to the BAM file.
467
+
-`*_pmdfiltered.flagstat`: Statistics of aligned reads after from SAMtools `flagstat`, after filtering for post-mortem damage.
467
468
468
469
</details>
469
470
470
471
[pmdtools](https://github.com/pontussk/PMDtools) implements a likelihood framework incorporating a postmortem damage (PMD) score, base quality scores and biological polymorphism to identify degraded DNA sequences that are unlikely to originate from modern contamination. Using the model, each sequence is assigned a PMD score, for which positive values indicate support for the sequence being genuinely ancient.
471
472
By filtering a BAM file for damaged reads in this way, it is possible to ameliorate the effects of present-day contamination, and isolate sequences of likely ancient origin to be used downstream.
473
+
By default, all positions are assessed for damage, but it is possible to provide a FASTA file masked for specific references (`--damage_manipulation_pmdtools_masked_reference`) or a BED file to mask the reference FASTA within nf-core/eager (`--damage_manipulation_pmdtools_reference_mask`). This can alleviate reference bias when running PMD filtering on capture data, where you might not want the allele of a SNP to be counted as damage when it is a transition.
Copy file name to clipboardexpand all lines: nextflow_schema.json
+14-4
Original file line number
Diff line number
Diff line change
@@ -780,12 +780,20 @@
780
780
"description": "Specify PMDScore threshold for PMDtools.",
781
781
"help_text": "Specifies the PMDScore threshold to use in the pipeline when filtering BAM files for DNA damage. Only reads which surpass this damage score are considered for downstream DNA analysis.\n\n> Modifies PMDtools parameter: `--threshold`"
"help_text": "Supplying a FASTA file will use this file as reference for `samtools calmd` prior to PMD filtering. /nSetting the SNPs that are part of the used capture set as `N` can alleviate reference bias when running PMD filtering on capture data, where you might not want the allele of a SNP to be counted as damage when it is a transition.",
787
+
"description": "Specify a masked FASTA file with positions to be used with pmdtools.",
788
+
"pattern": "^\\S+\\.fa?(\\sta)$",
789
+
"format": "file-path"
790
+
},
783
791
"damage_manipulation_pmdtools_reference_mask": {
784
792
"type": "string",
785
793
"fa_icon": "fas fa-mask",
786
794
"help_text": "Supplying a bedfile to this parameter activates masking of the reference fasta at the contained sites prior to running PMDtools. Positions that are in the provided bedfile will be replaced by Ns in the reference genome. \nThis can alleviate reference bias when running PMD filtering on capture data, where you might not want the allele of a transition SNP to be counted as damage. Masking of the reference is done using `bedtools maskfasta`.",
787
795
"description": "Specify a bedfile to be used to mask the reference fasta prior to running pmdtools.",
Copy file name to clipboardexpand all lines: subworkflows/local/manipulate_damage.nf
+51-14
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,7 @@
2
2
// Calculate PMD scores, trim, or rescale DNA damage from mapped reads.
3
3
//
4
4
5
+
include { BEDTOOLS_MASKFASTA } from '../../modules/nf-core/bedtools/maskfasta/main'
5
6
include { MAPDAMAGE2 } from '../../modules/nf-core/mapdamage2/main'
6
7
include { PMDTOOLS_FILTER } from '../../modules/nf-core/pmdtools/filter/main'
7
8
include { BAMUTIL_TRIMBAM } from '../../modules/nf-core/bamutil/trimbam/main'
@@ -13,8 +14,9 @@ include { SAMTOOLS_FLAGSTAT as SAMTOOLS_FLAGSTAT_DAMAGE_FILTERED } from '../../
13
14
// TODO: Add required channels and channel manipulations for reference-dependent bed masking before pmdtools. Requires multi-ref support before implementation.
14
15
workflow MANIPULATE_DAMAGE {
15
16
take:
16
-
ch_bam_bai // [ [ meta ], bam , bai ]
17
-
ch_fasta // [ [ meta ], fasta ]
17
+
ch_bam_bai // [ [ meta ], bam , bai ]
18
+
ch_fasta // [ [ meta ], fasta ]
19
+
ch_pmd_masking // [ [ meta ], masked_fasta, bed_for_masking ]
18
20
19
21
main:
20
22
ch_versions =Channel.empty()
@@ -35,7 +37,7 @@ workflow MANIPULATE_DAMAGE {
35
37
// Prepend a new meta that contains the meta.reference value as the new_meta.reference attribute
0 commit comments