diff --git a/astrocyte_pkg.yml b/astrocyte_pkg.yml index 4f3b981164bccfbf0025cc5e3c928a1789bccded..5194f24d84a89965fdbfdcf9c464050d00b6ce8d 100644 --- a/astrocyte_pkg.yml +++ b/astrocyte_pkg.yml @@ -108,6 +108,34 @@ workflow_parameters: read length, and then starts another round of reading from the opposite end of the fragment. + - id: chrM + type: select + required: true + choices: + - [ 'true', 'True'] + - [ 'false', 'False'] + description: | + In ATAC-seq and DNase-seq, mitochondrial reads are overrepresented. + We recomend filtering these reads out for further downstream analysis. + + - id: tn5 + type: select + required: true + choices: + - [ 'true', 'True'] + - [ 'false', 'False'] + description: | + ATAC-seq leverages the hyperactive Tn5 transposase, + preloaded with sequencing adaptors, to simultaneously + fragment transposase-accessible DNA and tag the + fragmented DNA with the sequencing adaptors, a + process called tagmentation. The Tn5 transposase has been shown to function as a + dimer and inserts the two sequencing adaptors into + target regions separated by 9 bp. For downstream + analysis, such as peak-calling and footprint analysis, + coordinates of all read alignments in the filtered + BAM file thus need to be shifted. + - id: design type: file required: true diff --git a/workflow/main.nf b/workflow/main.nf index 869063614555bf520a03b4227d96d275bc930188..02a15c0740bf63a7b2e68e197e160392c59b479b 100644 --- a/workflow/main.nf +++ b/workflow/main.nf @@ -6,6 +6,8 @@ // Define Input variables params.reads = "$baseDir/../test_data/*.fastq.gz" params.pairedEnd = false +params.chrM = true +params.tn5 = true params.designFile = "$baseDir/../test_data/design_ENCSR265ZXX_SE.txt" params.genome = 'GRCm38' params.genomes = [] @@ -32,6 +34,8 @@ readsList = Channel // Define regular variables pairedEnd = params.pairedEnd +chrM = params.chrM +tn5 = params.tn5 designFile = params.designFile genomeSize = params.genomeSize chromSizes = params.chromSizes @@ -218,14 +222,48 @@ process convertReads { script: if (pairedEnd) { - """ - python3 $baseDir/scripts/convert_reads.py -b $deduped -p - """ + if (tn5 && chrM){ + """ + python3 $baseDir/scripts/convert_reads.py -b $deduped -p -m -t + """ + } + else if (tn5){ + """ + python3 $baseDir/scripts/convert_reads.py -b $deduped -p -t + """ + } + else if (chrM){ + """ + python3 $baseDir/scripts/convert_reads.py -b $deduped -p -m + """ + } + else{ + """ + python3 $baseDir/scripts/convert_reads.py -b $deduped -p + """ + } } else { - """ - python3 $baseDir/scripts/convert_reads.py -b $deduped - """ + if (tn5 && chrM){ + """ + python3 $baseDir/scripts/convert_reads.py -b $deduped -m -t + """ + } + else if (tn5){ + """ + python3 $baseDir/scripts/convert_reads.py -b $deduped -t + """ + } + else if (chrM){ + """ + python3 $baseDir/scripts/convert_reads.py -b $deduped -m + """ + } + else{ + """ + python3 $baseDir/scripts/convert_reads.py -b $deduped + """ + } } } diff --git a/workflow/scripts/convert_reads.py b/workflow/scripts/convert_reads.py index 0d515666f356983bfc6e7cd3d561d6ea92ec9c55..4c89170622941cffe76bceac4218132918047ea7 100644 --- a/workflow/scripts/convert_reads.py +++ b/workflow/scripts/convert_reads.py @@ -45,10 +45,10 @@ def get_args(): default=True, action='store_true') - parser.add_argument('-t', '--tn5' - help='Enable TN5 shifting for ATAC-Seq.' - default=True, - action='store_true') + parser.add_argument('-t', '--tn5' + help='Enable TN5 shifting for ATAC-Seq.' + default=True, + action='store_true') args = parser.parse_args() return args