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

Module language server fixes #592

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### `Changed`

- [#591](https://github.com/genomic-medicine-sweden/nallo/pull/591) - Updated version to 0.6.0dev
- [#592](https://github.com/genomic-medicine-sweden/nallo/pull/592) - Updated local and nf-core modules to fix Nextflow language server issues

### `Removed`

Expand Down
8 changes: 4 additions & 4 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
},
"bcftools/view": {
"branch": "master",
"git_sha": "666652151335353eef2fcd58880bcef5bc2928e1",
"git_sha": "ede1e20af42e2f736638efae1b79762293a6a98a",
"installed_by": ["modules"]
},
"bedtools/merge": {
Expand Down Expand Up @@ -162,7 +162,7 @@
},
"longphase/phase": {
"branch": "master",
"git_sha": "22fc6d90be8eca2cf6afe5d10b3c5cffcdbcb19c",
"git_sha": "f303120bb5ee191c815bc7a756ab57576afe4c90",
"installed_by": ["modules"]
},
"minimap2/align": {
Expand Down Expand Up @@ -229,7 +229,7 @@
},
"samtools/view": {
"branch": "master",
"git_sha": "b13f07be4c508d6ff6312d354d09f2493243e208",
"git_sha": "b21df1b4e806f7bf3aff0eb41d84453a0025b43e",
"installed_by": ["modules"]
},
"severus": {
Expand Down Expand Up @@ -267,7 +267,7 @@
},
"svdb/merge": {
"branch": "master",
"git_sha": "a8ad84b7ee0cda0b001490e95d9ed277e687e368",
"git_sha": "95185f269ec10a33cde61d294fcd4ba7c66bc6b8",
"installed_by": ["modules"]
},
"svdb/query": {
Expand Down
9 changes: 4 additions & 5 deletions modules/local/create_pedigree_file/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@ process CREATE_PEDIGREE_FILE {
a.family_id <=> b.family_id ?: a.id <=> b.id } : sample_metas
outfile_text = ['#family_id', 'sample_id', 'father', 'mother', 'sex', 'phenotype'].join('\\t')
def samples_list = []
for(int i = 0; i<samples.size(); i++) {
sample_name = samples[i].id
if (!samples_list.contains(sample_name)) {
outfile_text += "\\n" + [samples[i].family_id, sample_name, samples[i].paternal_id, samples[i].maternal_id, samples[i].sex, samples[i].phenotype].join('\\t')
samples_list.add(sample_name)
samples.each { sample ->
if (!samples_list.contains(sample.id)) {
outfile_text += "\\n" + [sample.family_id, sample.id, sample.paternal_id, sample.maternal_id, sample.sex, sample.phenotype].join('\\t')
samples_list.add(sample.id)
}
}
"""
Expand Down
29 changes: 27 additions & 2 deletions modules/local/create_pedigree_file/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ nextflow_process {
process {
"""
input[0] = Channel.of(
[ 'project',
[ [ 'id': 'project' ],
[
[id:'HG002.Revio', family_id:'family', paternal_id:0, maternal_id:0, sex:0, phenotype:2, project:'project', n_files:1, single_end:true]
]
Expand All @@ -40,7 +40,7 @@ nextflow_process {
process {
"""
input[0] = Channel.of(
[ 'test',
[ [ 'id': 'test' ],
[
[id:'HG002_Revio_AB', family_id:'FAM2', paternal_id:0, maternal_id:0, sex:0, phenotype:1, project:'test', n_files:1, single_end:true],
[id:'HG002_Revio_AA', family_id:'FAM2', paternal_id:0, maternal_id:0, sex:0, phenotype:1, project:'test', n_files:1, single_end:true],
Expand All @@ -64,4 +64,29 @@ nextflow_process {
}
}

test("create_pedigree_file - one sample -stub") {

options "-stub"

when {
process {
"""
input[0] = Channel.of(
[ [ 'id': 'project' ],
[
[id:'HG002.Revio', family_id:'family', paternal_id:0, maternal_id:0, sex:0, phenotype:2, project:'project', n_files:1, single_end:true]
]
])
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}
}

}
18 changes: 9 additions & 9 deletions modules/local/echtvar/anno/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ process ECHTVAR_ANNO {
task.ext.when == null || task.ext.when

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

modifiedList = []
for (element in databases) {
modifiedList.add("-e")
modifiedList.add(element)
}
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"
def input = databases.collectMany { file -> ["-e", file] }.join(" ")
"""
echtvar anno ${args} ${modifiedList.join(" ")} ${vcf} ${prefix}.bcf.gz
echtvar \\
anno \\
${args} \\
${input} \\
${vcf} \\
${prefix}.bcf.gz

cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
44 changes: 21 additions & 23 deletions modules/local/hiphase/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -35,31 +35,31 @@ process HIPHASE {
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"

def vcfInputs = []
def vcfOutputs = []
def bamNames = []
def vcfNames = []
for (vcf in vcfs) {
vcfInputs.add('--vcf')
vcfInputs.add(vcf)
vcfOutputs.add('--output-vcf')
vcfOutputs.add("${prefix}_phased.vcf.gz")

def vcfs_input = vcfs.collectMany { file ->
[
"--vcf",
file,
"--output-vcf",
"${prefix}_phased.vcf.gz"
] }.join(" ")

def bams_input = bams.collectMany { file ->
[
"--bam",
file,
output_bam ? '--output-bam' : '',
output_bam ? "${prefix}_haplotagged.bam" : ''
] }.join(" ")

vcfs.each { vcf ->
vcfNames.add(vcf.getName())
}

def bamInputs = []
def bamOutputs = []
def bamNames = []
for (bam in bams) {
bamInputs.add('--bam')
bamInputs.add("${bam}")

bams.each { bam ->
bamNames.add(bam.getName())

if(output_bam) {
bamOutputs.add('--output-bam')
bamOutputs.add("${prefix}_haplotagged.bam")
}
}

def uniqueVcfNames = new HashSet(vcfNames);
Expand All @@ -79,10 +79,8 @@ process HIPHASE {
$args \
--threads ${task.cpus} \\
--reference ${fasta} \\
${bamInputs.join(' ')} \\
${bamOutputs.join(' ')} \\
${vcfInputs.join(' ')} \\
${vcfOutputs.join(' ')}
${bams_input} \\
${vcfs_input}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
2 changes: 2 additions & 0 deletions modules/nf-core/bcftools/view/environment.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 5 additions & 6 deletions modules/nf-core/bcftools/view/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions modules/nf-core/longphase/phase/environment.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 2 additions & 7 deletions modules/nf-core/longphase/phase/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions modules/nf-core/samtools/view/environment.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion modules/nf-core/samtools/view/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions modules/nf-core/svdb/merge/environment.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions modules/nf-core/svdb/merge/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.