-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Plink2 hwe #8227
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
Merged
Merged
Plink2 hwe #8227
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
eb60cd7
Add plink2/filter
jodennehy 7eeb1a9
Update plink2/filter
jodennehy 5bc448d
add maf exit filter
jodennehy 654fbee
edit maf
jodennehy 0e5795e
maf running update
jodennehy d35a85b
Add new module plink2/maf
jodennehy 2110ac6
Add new module plink2/maf
jodennehy c113e4c
Add plink2/maf module
jodennehy b926581
Update modules/nf-core/plink2/maf/main.nf
jodennehy 85cf2e6
Add plink2/maf module
jodennehy 87a0a49
Add plink2 HWE module
jodennehy 514fec6
Update modules/nf-core/plink2/hwe/main.nf
jodennehy 8394501
Update modules/nf-core/plink2/hwe/main.nf
jodennehy 7b9b322
Update modules/nf-core/plink2/hwe/meta.yml
jodennehy d80ac92
Merge branch 'master' into plink2_hwe
famosab 7b0a0d5
post review edit plink2 HWE module
jodennehy 82080df
edit plink2 HWE
jodennehy 173b65b
Merge branch 'master' into plink2_hwe
famosab File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,7 @@ | ||
| --- | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json | ||
| channels: | ||
| - conda-forge | ||
| - bioconda | ||
| dependencies: | ||
| - bioconda::plink2=2.00a5.10 |
This file contains hidden or 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,62 @@ | ||
| process PLINK2_HWE { | ||
| tag "$meta.id" | ||
| label 'process_medium' | ||
|
|
||
| conda "${moduleDir}/environment.yml" | ||
| container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
| 'https://depot.galaxyproject.org/singularity/plink2:2.00a5.10--h4ac6f70_0': | ||
| 'biocontainers/plink2:2.00a5.10--h4ac6f70_0' }" | ||
|
|
||
| input: | ||
| tuple val(meta), path(plink_genotype_file), path(plink_variant_file), path(plink_sample_file) | ||
| val (hwe) | ||
|
|
||
| output: | ||
| tuple val(meta), path("*.bim"), emit: bim, optional: true | ||
| tuple val(meta), path("*.bed"), emit: bed, optional: true | ||
| tuple val(meta), path("*.fam"), emit: fam, optional: true | ||
| tuple val(meta), path("*.pgen"), emit: pgen, optional: true | ||
| tuple val(meta), path("*.psam"), emit: psam, optional: true | ||
| tuple val(meta), path("*.pvar"), emit: pvar, optional: true | ||
| path "versions.yml", emit: versions | ||
|
|
||
| when: | ||
| task.ext.when == null || task.ext.when | ||
|
|
||
| script: | ||
| def args = task.ext.args ?: '' | ||
| def prefix = task.ext.prefix ?: "${meta.id}" | ||
| def mode = plink_genotype_file.extension == 'pgen' ? '--pfile' : '--bfile' | ||
| def outtype = plink_genotype_file.extension == "pgen" ? '--make-pgen' : '--make-bed' | ||
| def input = "${plink_genotype_file.getBaseName()}" | ||
| if( "${input}" == "${prefix}" ) error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" | ||
| """ | ||
| plink2 \\ | ||
| $mode $input \\ | ||
| $args \\ | ||
| --hwe $hwe \\ | ||
| --threads $task.cpus \\ | ||
| $outtype \\ | ||
| --out $prefix | ||
|
|
||
| cat <<-END_VERSIONS > versions.yml | ||
| "${task.process}": | ||
| plink2: \$(plink2 --version 2>&1 | sed 's/^PLINK v//; s/ 64.*\$//' ) | ||
| END_VERSIONS | ||
| """ | ||
|
|
||
| stub: | ||
| def args = task.ext.args ?: '' | ||
| def prefix = task.ext.prefix ?: "${meta.id}" | ||
| def trio = plink_genotype_file.extension == 'pgen' ? "${prefix}.pgen ${prefix}.psam ${prefix}.pvar" : "${prefix}.bed ${prefix}.bim ${prefix}.fam" | ||
| if( "${plink_genotype_file.getBaseName()}" == "${prefix}" ) error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" | ||
| """ | ||
| touch ${trio} | ||
|
|
||
| cat <<-END_VERSIONS > versions.yml | ||
| "${task.process}": | ||
| plink2: \$(plink2 --version 2>&1 | sed 's/^PLINK v//; s/ 64.*\$//' ) | ||
| END_VERSIONS | ||
| """ | ||
|
|
||
| } |
This file contains hidden or 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,126 @@ | ||||||
| --- | ||||||
| name: "plink2_hwe" | ||||||
| description: Filters plink bfiles or pfiles with maf filters | ||||||
| keywords: | ||||||
| - plink2 | ||||||
| - filter | ||||||
| - samples | ||||||
| - variants | ||||||
| - hwe | ||||||
| - qualty | ||||||
| tools: | ||||||
| - "plink2": | ||||||
| description: | | ||||||
| Whole genome association analysis toolset, designed to perform a range | ||||||
| of basic, large-scale analyses in a computationally efficient manner | ||||||
| homepage: http://www.cog-genomics.org/plink/2.0/ | ||||||
| documentation: http://www.cog-genomics.org/plink/2.0/general_usage | ||||||
| doi: "10.1186/s13742-015-0047-8" | ||||||
| licence: ["GPL v3"] | ||||||
| identifier: "" | ||||||
|
|
||||||
| input: | ||||||
| - - meta: | ||||||
| type: map | ||||||
| description: | | ||||||
| Groovy Map containing sample information | ||||||
| e.g. [ id:'test' ] | ||||||
| - plink_genotype_file: | ||||||
| type: file | ||||||
| description: PLINK binary genotype table file or PLINK 2 binary genotype table file | ||||||
| pattern: "*.{bed,pgen}" | ||||||
| ontologies: | ||||||
| - edam: http://edamontology.org/format_3003 | ||||||
| - plink_variant_file: | ||||||
| type: file | ||||||
| description: PLINK extended MAP file or PLINK 2 variant information file | ||||||
| pattern: "*.{bim,pvar}" | ||||||
| - plink_sample_file: | ||||||
| type: file | ||||||
| description: PLINK sample information file or PLINK 2 sample information file | ||||||
| pattern: "*.{fam,psam}" | ||||||
| - - hwe: | ||||||
| type: float | ||||||
| description: Threshold to use for maf filtering | ||||||
|
|
||||||
| output: | ||||||
| - bed: | ||||||
| - meta: | ||||||
| type: map | ||||||
| description: | | ||||||
| Groovy Map containing sample information | ||||||
| e.g. [ id:'test', single_end:false ] | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
you could remove the single_end when its not applicable :) |
||||||
| - "*.bed": | ||||||
| type: file | ||||||
| description: PLINK binary allelic genotype table | ||||||
| pattern: "*.bed" | ||||||
| ontologies: | ||||||
| - edam: http://edamontology.org/format_3003 | ||||||
| - bim: | ||||||
| - meta: | ||||||
| type: map | ||||||
| description: | | ||||||
| Groovy Map containing sample information | ||||||
| e.g. [ id:'test', single_end:false ] | ||||||
| - "*.bim": | ||||||
| type: file | ||||||
| description: PLINK extended map file | ||||||
| pattern: "*.bim" | ||||||
| ontologies: [] | ||||||
| - fam: | ||||||
| - meta: | ||||||
| type: map | ||||||
| description: | | ||||||
| Groovy Map containing sample information | ||||||
| e.g. [ id:'test', single_end:false ] | ||||||
| - "*.fam": | ||||||
| type: file | ||||||
| description: PLINK sample information file | ||||||
| pattern: "*.fam" | ||||||
| ontologies: [] | ||||||
| - pgen: | ||||||
| - meta: | ||||||
| type: map | ||||||
| description: | | ||||||
| Groovy Map containing sample information | ||||||
| e.g. [ id:'test', single_end:false ] | ||||||
| - "*.pgen": | ||||||
| type: file | ||||||
| description: PLINK 2 binary genotype table | ||||||
| pattern: "*.pgen" | ||||||
| ontologies: | ||||||
| - edam: http://edamontology.org/format_3003 | ||||||
| - pvar: | ||||||
| - meta: | ||||||
| type: map | ||||||
| description: | | ||||||
| Groovy Map containing sample information | ||||||
| e.g. [ id:'test', single_end:false ] | ||||||
| - "*.pvar": | ||||||
| type: file | ||||||
| description: PLINK 2 variant information file | ||||||
| pattern: "*.pvar" | ||||||
| ontologies: [] | ||||||
| - psam: | ||||||
| - meta: | ||||||
| type: map | ||||||
| description: | | ||||||
| Groovy Map containing sample information | ||||||
| e.g. [ id:'test', single_end:false ] | ||||||
| - "*.psam": | ||||||
| type: file | ||||||
| description: PLINK 2 sample information file | ||||||
| pattern: "*.psam" | ||||||
| ontologies: [] | ||||||
| - versions: | ||||||
| - versions.yml: | ||||||
| type: file | ||||||
| description: File containing software versions | ||||||
| pattern: "versions.yml" | ||||||
| ontologies: [] | ||||||
|
|
||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. two versions entrance |
||||||
|
|
||||||
| authors: | ||||||
| - "@jodennehy" | ||||||
| maintainers: | ||||||
| - "@jodennehy" | ||||||
This file contains hidden or 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,117 @@ | ||
| nextflow_process { | ||
|
|
||
| name "Test Process PLINK2_HWE" | ||
| script "../main.nf" | ||
| process "PLINK2_HWE" | ||
|
|
||
| tag "modules" | ||
| tag "modules_nfcore" | ||
| tag "plink2" | ||
| tag "plink2/hwe" | ||
|
|
||
| test("plink2 - plink1_input - hwe") { | ||
|
|
||
| when { | ||
| process { | ||
|
|
||
| """ | ||
|
|
||
| input[0] = [ | ||
| [id:"test"], | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.bed', checkIfExists: true), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.bim', checkIfExists: true), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.fam', checkIfExists: true) | ||
| ] | ||
| input[1] = 0.01 | ||
| """ | ||
| } | ||
| } | ||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot(process.out).match() } | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| test("plink2 - plink2_input - hwe") { | ||
|
|
||
| when { | ||
| process { | ||
|
|
||
| """ | ||
|
|
||
| input[0] = [ | ||
| [id:"test"], | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.pgen', checkIfExists: true), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.pvar', checkIfExists: true), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.psam', checkIfExists: true) | ||
| ] | ||
| input[1] = 0.01 | ||
| """ | ||
| } | ||
| } | ||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot(process.out).match() } | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| test("plink2 - plink1_input - hwe - stub") { | ||
|
|
||
| options "-stub" | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
|
|
||
| input[0] = [ | ||
| [id:"test"], | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.bed', checkIfExists: true), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.bim', checkIfExists: true), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.fam', checkIfExists: true) | ||
| ] | ||
| input[1] = 0.01 | ||
| """ | ||
| } | ||
| } | ||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot(process.out).match() } | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| test("plink2 - plink2_input - hwe - stub") { | ||
|
|
||
| options "-stub" | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [id:"test"], | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.pgen', checkIfExists: true), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.pvar', checkIfExists: true), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.psam', checkIfExists: true) | ||
| ] | ||
| input[1] = 0.01 | ||
| """ | ||
| } | ||
| } | ||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot(process.out).match() } | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
meta is being inherited from the input should be the same