- 
                Notifications
    
You must be signed in to change notification settings  - Fork 929
 
feat: addition of vembrane sort module #9294
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
          
     Open
      
      
            mkatsanto
  wants to merge
  9
  commits into
  nf-core:master
  
    
      
        
          
  
    
      Choose a base branch
      
     
    
      
        
      
      
        
          
          
        
        
          
            
              
              
              
  
           
        
        
          
            
              
              
           
        
       
     
  
        
          
            
          
            
          
        
       
    
      
from
mkatsanto:vembrane_sort
  
      
      
   
  
    
  
  
  
 
  
      
    base: master
Could not load branches
            
              
  
    Branch not found: {{ refName }}
  
            
                
      Loading
              
            Could not load tags
            
            
              Nothing to show
            
              
  
            
                
      Loading
              
            Are you sure you want to change the base?
            Some commits from the old base branch may be removed from the timeline,
            and old review comments may become outdated.
          
          
  
     Open
                    Changes from 8 commits
      Commits
    
    
            Show all changes
          
          
            9 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      66588fc
              
                fix: linting error
              
              
                 fd659e3
              
                fix: add conda snapshot
              
              
                 28d37a0
              
                fix: test path specification and removed test prefix
              
              
                 a3e35a2
              
                Merge branch 'master' of https://github.com/nf-core/modules into vemb…
              
              
                 bb1bdec
              
                feat: addition of vembrane sort module
              
              
                 0a0f4f1
              
                fix: remove the vembrane table from this branch
              
              
                 12570bc
              
                fix: vembrane sort fixes  like the table module
              
              
                 d574f23
              
                Merge branch 'master' of https://github.com/nf-core/modules into vemb…
              
              
                 c7fd05c
              
                fix: apply code review fixes
              
              
                 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::vembrane=2.4.0 | 
  
    
      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,54 @@ | ||
| process VEMBRANE_SORT { | ||
| tag "${meta.id}" | ||
| label 'process_low' | ||
| 
     | 
||
| conda "${moduleDir}/environment.yml" | ||
| container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container | ||
| ? 'https://depot.galaxyproject.org/singularity/vembrane:2.4.0--pyhdfd78af_0' | ||
| : 'biocontainers/vembrane:2.4.0--pyhdfd78af_0'}" | ||
| 
     | 
||
| input: | ||
| tuple val(meta), path(vcf) | ||
| val expression | ||
| 
     | 
||
| output: | ||
| tuple val(meta), path("*.vcf*"), emit: vcf | ||
| 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 suffix = args.contains('--output-fmt vcf.gz') ? 'vcf.gz' : | ||
| args.contains('--output-fmt bcf') ? 'bcf' : | ||
| args.contains('--output-fmt bcf.gz') ? 'bcf.gz' : 'vcf' | ||
| """ | ||
| vembrane sort \\ | ||
| ${args} \\ | ||
| --output ${prefix}.${suffix} \\ | ||
| '${expression}' \\ | ||
| ${vcf} | ||
| 
     | 
||
| cat <<-END_VERSIONS > versions.yml | ||
| "${task.process}": | ||
| vembrane: \$(vembrane --version 2>&1 | head -n1 | sed 's/vembrane //') | ||
| END_VERSIONS | ||
| """ | ||
| 
     | 
||
| stub: | ||
| def args = task.ext.args ?: '' | ||
| def prefix = task.ext.prefix ?: "${meta.id}" | ||
| def suffix = args.contains('--output-fmt vcf.gz') ? 'vcf.gz' : | ||
| args.contains('--output-fmt bcf') ? 'bcf' : | ||
| args.contains('--output-fmt bcf.gz') ? 'bcf.gz' : 'vcf' | ||
| """ | ||
| touch ${prefix}.${suffix} | ||
| 
     | 
||
| cat <<-END_VERSIONS > versions.yml | ||
| "${task.process}": | ||
| vembrane: \$(vembrane --version 2>&1 | head -n1 | sed 's/vembrane //') | ||
| 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,63 @@ | ||||||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json | ||||||
| name: "vembrane_sort" | ||||||
| description: Sort VCF/BCF files by custom Python expressions for variant prioritization | ||||||
| keywords: | ||||||
| - vcf | ||||||
| - bcf | ||||||
| - sort | ||||||
| - genomics | ||||||
| - variant | ||||||
| - prioritization | ||||||
| tools: | ||||||
| - "vembrane": | ||||||
| description: "Filter VCF/BCF files with Python expressions" | ||||||
| homepage: "https://vembrane.github.io/" | ||||||
| documentation: "https://github.com/vembrane/vembrane/blob/main/docs/sort.md" | ||||||
| tool_dev_url: "https://github.com/vembrane/vembrane" | ||||||
| doi: "10.1093/bioinformatics/btac810" | ||||||
| licence: ["MIT"] | ||||||
| identifier: biotools:vembrane | ||||||
| args_id: "$args" | ||||||
| 
     | 
||||||
| input: | ||||||
| - - meta: | ||||||
| type: map | ||||||
| description: | | ||||||
| Groovy Map containing sample information | ||||||
| e.g. `[ id:'sample1', single_end:false ]` | ||||||
| - vcf: | ||||||
| type: file | ||||||
| description: VCF/BCF file to sort | ||||||
| pattern: "*.{vcf,vcf.gz,bcf,bcf.gz}" | ||||||
| ontologies: | ||||||
| - edam: http://edamontology.org/format_3016 # VCF | ||||||
| - expression: | ||||||
| type: string | ||||||
| description: Python expression (or tuple of expressions) returning orderable values to sort by | ||||||
| 
     | 
||||||
| output: | ||||||
| vcf: | ||||||
| - - meta: | ||||||
| type: map | ||||||
| description: | | ||||||
| Groovy Map containing sample information | ||||||
| e.g. `[ id:'sample1', single_end:false ]` | ||||||
| - "*.vcf*": | ||||||
| type: file | ||||||
| description: Sorted VCF file (can be compressed) | ||||||
| pattern: "*.{vcf,vcf.gz}" | ||||||
| 
         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
       
    
  | 
||||||
| ontologies: | ||||||
| - edam: http://edamontology.org/format_3016 # VCF | ||||||
| versions: | ||||||
| - versions.yml: | ||||||
| type: file | ||||||
| description: File containing software versions | ||||||
| pattern: "versions.yml" | ||||||
| ontologies: | ||||||
| - edam: http://edamontology.org/format_3750 # YAML | ||||||
| authors: | ||||||
| - "@mkatsanto" | ||||||
| - "@trangdo-hsc" | ||||||
| maintainers: | ||||||
| - "@mkatsanto" | ||||||
| - "@trangdo-hsc" | ||||||
  
    
      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,209 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| nextflow_process { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 
     | 
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name "Test Process VEMBRANE_SORT" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| script "../main.nf" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| process "VEMBRANE_SORT" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 
     | 
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tag "modules" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tag "modules_nfcore" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tag "vembrane" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tag "vembrane/sort" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 
     | 
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| test("homo_sapiens - [vcf] - vcf - quality_sort") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 
     | 
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| when { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| process { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| input[0] = [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [ id:'test' ], // meta map | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/test.rnaseq.vcf', checkIfExists: true) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| input[1] = 'QUAL' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 
     | 
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| then { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| assertAll( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { assert process.success }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { assert snapshot(process.out).match() } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 
     | 
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| test("homo_sapiens - [vcf] - vcf - position_sort") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 
     | 
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| config "./nextflow.config" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 
     | 
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| when { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| params { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| vembrane_args = '--output-fmt vcf' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| process { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| input[0] = [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [ id:'test' ], // meta map | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/test.rnaseq.vcf', checkIfExists: true) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| input[1] = 'CHROM, POS' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 
     | 
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| then { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| assertAll( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { assert process.success }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { assert snapshot(process.out).match() } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 
     | 
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| test("homo_sapiens - [vcf] - vcf - descending_sort") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 
     | 
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| config "./nextflow.config" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 
     | 
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| when { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| params { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| vembrane_args = '--preserve-annotation-order' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| process { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| input[0] = [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [ id:'test' ], // meta map | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/test.rnaseq.vcf', checkIfExists: true) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| input[1] = 'desc(QUAL)' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 
     | 
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| then { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| assertAll( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { assert process.success }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { assert snapshot(process.out).match() } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 
     | 
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 
     | 
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| test("homo_sapiens - [vcf] - vcf - compressed_output") { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 
     | 
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| config "./nextflow.config" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 
     | 
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| when { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| params { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| vembrane_args = '--output-fmt vcf.gz' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| process { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| input[0] = [ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [ id:'test_gz' ], // meta map | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/test.rnaseq.vcf', checkIfExists: true) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| input[1] = 'QUAL' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| """ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 
     | 
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| then { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| assertAll( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { assert process.success }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { assert snapshot(process.out).match() } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
                
       | 
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| test("homo_sapiens - [vcf] - vcf - compressed_output") { | |
| config "./nextflow.config" | |
| when { | |
| params { | |
| vembrane_args = '--output-fmt vcf.gz' | |
| } | |
| process { | |
| """ | |
| input[0] = [ | |
| [ id:'test_gz' ], // meta map | |
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/test.rnaseq.vcf', checkIfExists: true) | |
| ] | |
| input[1] = 'QUAL' | |
| """ | |
| } | |
| } | |
| 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.
Can you run
please? :)