-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9b2b5b9
commit 11662e7
Showing
18 changed files
with
174 additions
and
43 deletions.
There are no files selected for viewing
File renamed without changes.
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,17 @@ | ||
process phage_references_blastDB { | ||
if (params.cloudProcess) { | ||
publishDir "${params.cloudDatabase}/", mode: 'copy', pattern: "blast_phage_DB" | ||
} | ||
else { | ||
storeDir "nextflow-autodownload-databases/" | ||
} | ||
label 'metaphinder' | ||
input: | ||
file(references) | ||
output: | ||
file("blast_phage_DB/") | ||
script: | ||
""" | ||
makeblastdb -in ${references} -dbtype nucl -parse_seqids -out blast_phage_DB/phage_db -title phage_db | ||
""" | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,27 @@ | ||
process filter_metaphinder { | ||
publishDir "${params.output}/${name}/metaphinder", mode: 'copy', pattern: "metaphinder_*.txt" | ||
label 'ubuntu' | ||
input: | ||
tuple val(name), file(results) | ||
output: | ||
tuple val(name), file("metaphinder_*.txt") | ||
script: | ||
""" | ||
rnd=${Math.random()} | ||
cat *.list | sort -g -k4,4 | awk '{if(\$2=="phage"){print \$1}}' | tail -n+2 > metaphinder_\${rnd//0.}.txt | ||
""" | ||
} | ||
|
||
process filter_metaphinder_own_DB { | ||
publishDir "${params.output}/${name}/metaphinder-own-DB", mode: 'copy', pattern: "metaphinder-own-DB_*.txt" | ||
label 'ubuntu' | ||
input: | ||
tuple val(name), file(results) | ||
output: | ||
tuple val(name), file("metaphinder-own-DB_*.txt") | ||
script: | ||
""" | ||
rnd=${Math.random()} | ||
cat *.list | sort -g -k4,4 | awk '{if(\$2=="phage"){print \$1}}' | tail -n+2 > metaphinder-own-DB_\${rnd//0.}.txt | ||
""" | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,36 @@ | ||
process shuffle_reads_nts { | ||
//publishDir "${params.output}/${name}/sh", mode: 'copy', pattern: "${name}_pos_ctg.fa" | ||
label 'ruby' | ||
input: | ||
tuple val(name), file(reads) | ||
output: | ||
tuple val(name), file("${name}_shuffled.fastq") | ||
script: | ||
""" | ||
#!/usr/bin/env ruby | ||
fastq = File.open("${reads}", 'r') | ||
shuffled = File.open("${name}_shuffled.fastq", 'w') | ||
i = 0 | ||
out = '' | ||
fastq.each do |line| | ||
i += 1 | ||
if i == 1 || i == 3 || i == 4 | ||
out << line | ||
end | ||
if i == 2 | ||
out << line.chomp.split("").shuffle.join << "\\n" | ||
end | ||
if i == 4 | ||
shuffled << out if out.length > 1 | ||
out = '' | ||
end | ||
end | ||
shuffled.close | ||
fastq.close | ||
""" | ||
} | ||
|
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