-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added IQtree and core to rename fasta headers for use with IQtree
- Loading branch information
1 parent
4b92bba
commit a381e6b
Showing
5 changed files
with
96 additions
and
3 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
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,39 @@ | ||
process IQTREE2 { | ||
tag "$alignment" | ||
label 'process_medium' | ||
|
||
conda "bioconda::iqtree=2.1.4_beta" | ||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'https://depot.galaxyproject.org/singularity/iqtree:2.1.4_beta--hdcc8f71_0' : | ||
'biocontainers/iqtree:2.1.4_beta--hdcc8f71_0' }" | ||
|
||
input: | ||
tuple val(meta), path(alignment) | ||
val constant_sites | ||
|
||
output: | ||
tuple val(meta), path("*.treefile"), emit: phylogeny | ||
path "versions.yml" , emit: versions | ||
|
||
when: | ||
task.ext.when == null || task.ext.when | ||
|
||
script: | ||
def args = task.ext.args ?: '' | ||
def fconst_args = constant_sites ? "-fconst $constant_sites" : '' | ||
def memory = task.memory.toString().replaceAll(' ', '') | ||
""" | ||
iqtree2 \\ | ||
$fconst_args \\ | ||
$args \\ | ||
-s $alignment \\ | ||
-nt AUTO \\ | ||
-ntmax $task.cpus \\ | ||
-mem $memory \\ | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
iqtree: \$(echo \$(iqtree -version 2>&1) | sed 's/^IQ-TREE multicore version //;s/ .*//') | ||
END_VERSIONS | ||
""" | ||
} |
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,31 @@ | ||
process RENAMECOREGENEHEADERS { | ||
tag "$ref_meta.id" | ||
label 'process_single' | ||
|
||
conda "conda-forge::coreutils=9.1" | ||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'https://depot.galaxyproject.org/singularity/ubuntu:20.04' : | ||
'ubuntu:20.04' }" | ||
|
||
input: | ||
tuple val(ref_meta), path(feat_seqs) | ||
|
||
output: | ||
tuple val(ref_meta), path("${prefix}_feat_seqs_renamed"), emit: feat_seqs | ||
|
||
when: | ||
task.ext.when == null || task.ext.when | ||
|
||
script: | ||
prefix = task.ext.prefix ?: "${ref_meta.id}" | ||
""" | ||
# Create folder for output | ||
mkdir ${prefix}_feat_seqs_renamed | ||
# Rename headers to just sample ID | ||
for file in ${feat_seqs}/*.fasta | ||
do | ||
sed 's/>.*genome:\\(.*\\)gene.*/>\\1/g' \$file > ${prefix}_feat_seqs_renamed/\$(basename \$file) | ||
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