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

Initial Commit Help Pages #48

Merged
merged 6 commits into from
May 16, 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
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
'0.2.0'
8 changes: 8 additions & 0 deletions eval.nf
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
//load in help function
File data_class_file = new File("./src/data_class.groovy");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you please rename that file into something like Helppages.groovy? This describes the purpose of the class more intuitively.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Same for the variable's name data_class_file -> helppages_class_file

Class groovyClass = new GroovyClassLoader(getClass().getClassLoader()).parseClass(data_class_file);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same: groovyClass -> HelppagesClass

GroovyObject data_class = (GroovyObject) groovyClass.newInstance();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same: data_class -> help


if (params.help) { exit 0, data_class.helpEval(workflow.manifest.version) }
Copy link
Collaborator

Choose a reason for hiding this comment

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

Needs then adjustment to new name


// include modules - here, modules are single processes
include { SAMTOOLS_FAIDX } from './modules/samtools/faidx/main.nf'
include { HAPPY } from './modules/happy/main.nf'
Expand Down Expand Up @@ -50,3 +57,4 @@ workflow{

SOMPY_SUMMARY(ch_csv.collect())
}

7 changes: 7 additions & 0 deletions hap.nf
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
//load in help function
File data_class_file = new File("./src/data_class.groovy");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same as in eval.nf

Class groovyClass = new GroovyClassLoader(getClass().getClassLoader()).parseClass(data_class_file);
GroovyObject data_class = (GroovyObject) groovyClass.newInstance();

if (params.help) { exit 0, data_class.helpHap(workflow.manifest.version, params) }

// include modules - here, modules are single processes
//include { AMPLISIM } from './modules/amplisim/main.nf'
include { MASON_SIMULATOR } from './modules/mason/simulator/main.nf'
Expand Down
3 changes: 2 additions & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ manifest {
description = 'A workflow for a simple, streamlined and rapid evaluation of variant callsets '
author = 'Thomas Krannich'
nextflowVersion = '>=20.04.0'
version = '0.2.0'
version = new File('./VERSION').text.trim()
}

// Parameters that are accessible in the pipeline script
Expand All @@ -15,6 +15,7 @@ params {
read_type = 'ngs'

// General parameters
help = false
seed = 479
outdir = 'results'

Expand Down
77 changes: 77 additions & 0 deletions src/data_class.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
class Helper {
def helpEval(version){
String c_green = "\033[0;32m";
String c_reset = "\033[0m";
String c_yellow = "\033[0;33m";
String c_blue = "\033[0;34m";
String c_red = "\u001B[31m";
String c_dim = "\033[2m";
log.info """
____________________________________________________________________________________________

${c_blue}Robert Koch Institute, MF1 Bioinformatics${c_reset}

Workflow: cievad (${version})

${c_yellow}Minimal Usage Examples:${c_reset}

nextflow run eval.nf -profile local,conda --callsets_dir <path/to/callsets>
or
nextflow run eval.nf -profile local,conda --sample_sheet <path/to/sample_sheet>

${c_yellow}Data Input, required:${c_reset}

${c_green} --callsets_dir ${c_reset} Directory containing variant callsets for evaluation (naming format: callset_<X>.vcf[.gz]).
OR
${c_green} --sample_sheet ${c_reset} Sample sheet (.csv) with the header ("index","truthset","callset"), mapping corresponding truth- and callsets.
"""
}

def helpHap(version,params){
String c_green = "\033[0;32m";
String c_reset = "\033[0m";
String c_yellow = "\033[0;33m";
String c_blue = "\033[0;34m";
String c_red = "\u001B[31m";
String c_dim = "\033[2m";
log.info """
____________________________________________________________________________________________

${c_blue}Robert Koch Institute, MF1 Bioinformatics${c_reset}

Workflow: cievad (${version})

${c_yellow}Minimal Usage Example:${c_reset}

nextflow run hap.nf -profile local,conda

${c_yellow}Individual Parameter, required:${c_reset}

${c_green} --n ${c_reset} number of synthetic samples to be generated
${c_green} --reference ${c_reset} reference used for the generation of synthetic sequencing data
${c_green} --read_type ${c_reset} type of resulting WGS synthetic reads (options: ngs, ont)

${c_yellow}Output Directory, required:${c_reset}

${c_green} --outdir ${c_reset} directory to save results in

${c_yellow}Next Generation Sequencing (WGS) Parameter, required if [--read_type ngs] supplied ${c_reset}

${c_green} --nb_frag ${c_reset} number of fragments per sample [default: ${params.nb_frag}]
${c_green} --fragment_min_size ${c_reset} minimum size of fragments [default: ${params.fragment_min_size}]
${c_green} --fragment_max_size ${c_reset} maximum size of fragments [default: ${params.fragment_max_size}]
${c_green} --fragment_mean_size ${c_reset} mean size of fragments [default: ${params.fragment_mean_size}]
${c_green} --fragment_size_std_dev ${c_reset} standard deviation for fragment size [default: ${params.fragment_size_std_dev}]
${c_green} --illumina_read_length ${c_reset} read length of synthetic illumina reads [default: ${params.illumina_read_length}]

${c_yellow}Nanopore Sequencing (WGS) Parameter, required if [--read_type ont] supplied ${c_reset}

${c_green} --dna_type ${c_reset} used DNA type [default: ${params.dna_type}]
${c_green} --model_prefix ${c_reset} path and prefix of the used model (e.g.: ${params.model_prefix})
${c_green} --model_caller ${c_reset} algorithm to conduct the basecalling [default: ${params.model_caller}]
${c_green} --median_length ${c_reset} median length of the resulting synthetic reads [default: ${params.median_length}]
${c_green} --sd_length ${c_reset} standard deviation length of the resulting synthetic reads [default: ${params.sd_length}]
${c_green} --nb_reads ${c_reset} number of synthetic reads [default: ${params.nb_reads}]
"""
}
}