You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The latest Lofreq modification implements a cleaner and more maintainable approach to utilize bundled scripts in "src". Our original approach meant that each script had to be specified in the config. The new structure for the config is shown below.
lcr-modules:
lofreq:
inputs:
# Available wildcards: {seq_type} {genome_build} {sample_id}
sample_bam: "__UPDATE__"
sample_bai: "__UPDATE__"
src_dir: "{MODSDIR}/src" #prepended to PATH to make bundled scripts available without needing the specify the path to each script
The value of src_dir is then used in the module as follows.
#Near top of module file
CFG = op.setup_module(
name = "lofreq",
version = "1.0",
subdirectories = ["inputs", "lofreq", "combined", "filtered", "outputs"],
)
#set variable for prepending to PATH based on config
SCRIPT_PATH = CFG['inputs']['src_dir']
#simplified example from lofreq showing use of bundled lofreq_filter.sh
shell:
op.as_one_line("""
PATH={SCRIPT_PATH}:$PATH;
SCRIPT=$(which lofreq_filter.sh); #debugging lines. Unnecessary but sometimes helpful
echo $SCRIPT; #debugging lines. Unnecessary but sometimes helpful
lofreq_filter.sh {input.vcf_all} | bgzip > {output.vcf_all_clean}
&& tabix -p vcf {output.vcf_all_clean}
&&
lofreq_filter.sh {input.vcf_all_filtered} | bgzip > {output.vcf_all_filtered_clean}
&& tabix -p vcf {output.vcf_all_filtered_clean}
""")
In order to implement this in existing modules we will need to do away with the subdirectory structure of src (i.e. all scripts are in the top-level src directory). These scripts will also need to be made executable and have a shebang line (ideally using "/usr/bin/env" for maximal portability.
The text was updated successfully, but these errors were encountered:
The latest Lofreq modification implements a cleaner and more maintainable approach to utilize bundled scripts in "src". Our original approach meant that each script had to be specified in the config. The new structure for the config is shown below.
The value of src_dir is then used in the module as follows.
In order to implement this in existing modules we will need to do away with the subdirectory structure of src (i.e. all scripts are in the top-level src directory). These scripts will also need to be made executable and have a shebang line (ideally using "/usr/bin/env" for maximal portability.
The text was updated successfully, but these errors were encountered: