-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added shared conda env location
- Loading branch information
Showing
7 changed files
with
278 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
groups ids tags distances next minFindsG maxFindsG locations | ||
Fwd Fwd_01 TAGATCGC 0 {{Rev}} 1 1 0:0:12 | ||
Fwd Fwd_02 CTCTCTAT 0 {{Rev}} 1 1 0:0:12 | ||
Rev Rev_01 TCGCCTTA 0 - 1 1 0:-12:0 | ||
Rev Rev_02 CTAGTACG 0 - 1 1 0:-12:0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Fwd_01 | ||
Fwd_02 | ||
Rev_01 | ||
Rev_02 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
// This module was written by WEHI Research Computing | ||
// see https://github.com/WEHIGenomicsRnD/demultiplex-paired-end-library | ||
|
||
process GenerateSelectFile { | ||
label 'CreateSFile' | ||
queue 'regular' | ||
cpus 2 | ||
memory 1.GB | ||
time '1h' | ||
publishDir "${params.outdir}/", mode: 'copy' | ||
|
||
input: | ||
path primer_template_file | ||
|
||
output: | ||
path "select.txt" | ||
|
||
|
||
script: | ||
""" | ||
#!/usr/bin/env bash | ||
primer_template=\$(cat ${primer_template_file}) | ||
fwd_primers=\$(cat ${primer_template_file} |tr -d '\r'| awk -F ',' '{print \$1}' | grep Fwd) | ||
rev_primers=\$(cat ${primer_template_file} |tr -d '\r'| awk -F ',' '{print \$1}' | grep Rev) | ||
> select.txt | ||
for fwd_primer in \${fwd_primers[@]}; do | ||
for rev_primer in \${rev_primers[@]}; do | ||
echo -e "\${fwd_primer},\${rev_primer}\t\${fwd_primer}-\${rev_primer}" >> select.txt | ||
done | ||
done | ||
""" | ||
} | ||
|
||
process CreateConfigFile { | ||
|
||
label 'CreateCFile' | ||
queue 'regular' | ||
cpus 2 | ||
memory 1.GB | ||
time '1h' | ||
|
||
tag "${sampleId}" | ||
publishDir "${params.outdir}/", mode: 'copy' | ||
|
||
input: | ||
path(configtxt) | ||
|
||
output: | ||
path('config.txt') | ||
|
||
script: | ||
""" | ||
echo -e "groups\tids\ttags\tdistances\tnext\tminFindsG\tmaxFindsG\tlocations\n\$(cat ${configtxt})" > config.txt | ||
""" | ||
|
||
} | ||
process SplitCode{ | ||
label 'SplitCode' | ||
|
||
if ( "${workflow.stubRun}" == "false" ) { | ||
queue 'regular' | ||
cpus 16 | ||
memory { 8.GB * task.attempt } | ||
errorStrategy { 'retry' } | ||
maxRetries 5 | ||
time '24h' | ||
} | ||
|
||
tag "${reads.getSimpleName()}" | ||
publishDir "${params.outdir}/split/${reads.getSimpleName()}", mode: 'copy' | ||
container 'oras://ghcr.io/wehi-researchcomputing/splitcode_container:latest' | ||
|
||
|
||
input: | ||
path(reads) | ||
path(config) | ||
path(select) | ||
|
||
|
||
output: | ||
path "*.fastq*" | ||
path "*.txt" | ||
|
||
|
||
script: | ||
""" | ||
splitcode -c ${config} --keep=${select} -t ${task.cpus} --nFastqs=1 \ | ||
--assign --summary summary.txt -o out.fastq --gzip \ | ||
--no-outb --mapping mapping.txt --seq-names \ | ||
--mod-names --com-names --unassigned=unmapped.fastq.gz \ | ||
${reads} | ||
for file in *_0.fastq.gz; do | ||
newname="\${file/_0.fastq.gz/.fastq.gz}" | ||
mv "\$file" "\$newname" | ||
done | ||
""" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters