Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Orthofinder #6288

Merged
merged 19 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 18 additions & 9 deletions modules/nf-core/orthofinder/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ process ORTHOFINDER {

input:
tuple val(meta), path(fastas, stageAs: 'input/')
path(prior_run)

output:
tuple val(meta), path("$prefix") , emit: orthofinder
Expand All @@ -18,22 +19,28 @@ process ORTHOFINDER {
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"
def include_command = prior_run ? "-b $prior_run" : ''

"""
mkdir temp_pickle

orthofinder \\
$args \\
-t $task.cpus \\
-a $task.cpus \\
-p temp_pickle \\
-f input \\
-n $prefix
-n $prefix \\
$include_command $args
chriswyatt1 marked this conversation as resolved.
Show resolved Hide resolved

if [ -e input/OrthoFinder/Results_$prefix ]; then
mv input/OrthoFinder/Results_$prefix $prefix
fi

mv \\
input/OrthoFinder/Results_$prefix \\
$prefix
if [ -e WorkingDirectory/OrthoFinder/Results_$prefix ]; then
chriswyatt1 marked this conversation as resolved.
Show resolved Hide resolved
mv WorkingDirectory/OrthoFinder/Results_$prefix $prefix
fi

cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand All @@ -42,8 +49,10 @@ process ORTHOFINDER {
"""

stub:
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"
def include_command = prior_run ? "-b $prior_run" : ''

"""
mkdir -p $prefix/Comparative_Genomics_Statistics
mkdir $prefix/Gene_Duplication_Events
Expand Down
50 changes: 47 additions & 3 deletions modules/nf-core/orthofinder/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ nextflow_process {
[ id:'test', single_end:false ],
[ file_a, file_b ]
]
input[1] = []
"""
}
}
Expand All @@ -41,8 +42,6 @@ nextflow_process {
all_files << file
}

def all_file_names = all_files.collect { it.name }.sort(false)

def stable_file_names = [
'Statistics_PerSpecies.tsv',
'SpeciesTree_Gene_Duplications_0.5_Support.txt',
Expand All @@ -52,7 +51,51 @@ nextflow_process {
def stable_files = all_files.findAll { it.name in stable_file_names }

assert snapshot(
all_file_names,
stable_files,
chriswyatt1 marked this conversation as resolved.
Show resolved Hide resolved
process.out.versions[0]
).match()
}

}


test("sarscov2 - candidatus_portiera_aleyrodidarum - proteome - resume") {

when {
process {
"""
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/proteome.fasta', checkIfExists: true)
.copyTo("${workDir}/sarscov2.fasta")

def file_a = file("https://raw.githubusercontent.com/nf-core/test-datasets/proteinfold/testdata/sequences/H1065.fasta")
def file_c = file("s3://temporary-nfcore-module-data/test/WorkingDirectory")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line will change to :

def file_c = file("https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/delete_me/orthofinder/WorkingDirectory")

ONce the PR is through on test datasets

input[0] = [
[ id:'test_2', single_end:false ],
[ file_a ]
]
input[1] = file_c
"""
}
}

then {
assert process.success

def all_files = []

file(process.out.orthofinder[0][1]).eachFileRecurse (FileType.FILES) { file ->
all_files << file
}

def stable_file_names = [
'Statistics_PerSpecies.tsv',
'OrthologuesStats_Totals.tsv',
'Duplications_per_Species_Tree_Node.tsv'
]

def stable_files = all_files.findAll { it.name in stable_file_names }

assert snapshot(
stable_files,
process.out.versions[0]
).match()
Expand Down Expand Up @@ -80,6 +123,7 @@ nextflow_process {
[ id:'test', single_end:false ],
[ file_a, file_b ]
]
input[1] = []
"""
}
}
Expand Down
Loading
Loading