Skip to content

Commit

Permalink
Merge pull request #51 from ZaahidShaik/add_help_option
Browse files Browse the repository at this point in the history
Add --help flag for displaying usage information to users.
  • Loading branch information
hyunhwan-bcm authored Aug 14, 2024
2 parents 6d8759c + 7546d7b commit 07c75e0
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ nextflow run . -params-file params.yaml
```
NOTE: You need to create `params.yaml` by copying [params.yaml.example](params.yaml.example) file and follow the instruction.


For more information on usage and parameters which are open for modification, please use `--help` option as shown below.

```
nextflow run main.nf --help
```


## License
AI-MARRVEL is licensed under GPL-3.0. You are welcomed to use it for research purpose.
For business purpose, please contact us for licensing.
Expand Down
41 changes: 41 additions & 0 deletions docs/source/nf_usage.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Usage:

nextflow run main.nf [All Args] [Options]

Example:

nextflow run main.nf --ref_dir path/to/aim_data_dependencies \
--input_vcf path/to/sample.vcf.gz \
--input_hpo path/to/sample/hpos.txt \
--outdir path/to/sample/Output \
--run_id [Sample ID] \
--ref_ver [hg19/hg38]

Args:
--input_vcf Path to input VCF file.
--input_hpo Path to input HPO file.
--ref_dir Path to aim pipeline dependencies directory.
--outdir Output directory.
--run_id Unique identifier for this run. (default: 1)
--ref_ver Reference genome version [hg38 or hg19] (default: hg19)


Options:
--exome_filter Enable exonic filter. Addition will filter out variants outside of exonic region (default: false)
--help Displays the usage information.

Reference Files:
--ref_loc Path to reference location file
--ref_to_sym Path to reference to symbol file
--ref_sorted_sym Path to reference sorted symbol file
--ref_exonic_filter_bed Path to exonic filter BED file

VEP Annotation:
--vep_dir_cache Path to VEP cache directory
--vep_dir_plugins Path to VEP plugins directory
--vep_custom_gnomad Path to custom gnomAD file for VEP
--vep_custom_clinvar Path to custom ClinVar file for VEP
--vep_custom_hgmd Path to custom HGMD file for VEP

For detailed information about each process,
please refer to the documentation. https://ai-marrvel.readthedocs.io/en/latest/
14 changes: 13 additions & 1 deletion main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,20 @@ process PREDICTION {
"""
}

def SHOW_USEAGE() {
if (params.help) {
def helpFile = file(params.usage_file) // Specify your Markdown file path here
if (helpFile.exists()) {
println helpFile.text
} else {
println "Sorry something went wrong, usage file not found! please vist our website for more info : https://ai-marrvel.readthedocs.io/en/latest/"
}
exit 0
}
}

workflow {
workflow {
SHOW_USEAGE()
INDEX_VCF(params.input_vcf)
VCF_PRE_PROCESS(INDEX_VCF.out, params.chrmap)

Expand Down
7 changes: 7 additions & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
params {
run_id = 1
help = false
ref_ver = "hg19"
bed_filter = ""
exome_filter = false

// Will add exceptions in validations.
ref_dir = "NOT_PROVIDED"

ref_assembly = params.ref_ver == "hg19" ? "grch37" : "grch38"

Expand Down Expand Up @@ -59,6 +63,9 @@ params {
vep_plugin_dbnsfp = "${ref_dir}/vep/${ref_ver}/${vep_dbnsfp_name}"
vep_idx = "${ref_dir}/vep/${ref_ver}/*.tbi"

// Documentation
usage_file = "${projectDir}/docs/source/nf_usage.txt"

script_chunking = "${projectDir}/scripts/split_chunks.py"
script_annot = "${projectDir}/scripts/annotation/*.py"

Expand Down

0 comments on commit 07c75e0

Please sign in to comment.