Skip to content

Commit

Permalink
rename config variables
Browse files Browse the repository at this point in the history
  • Loading branch information
vasicek58 committed Feb 16, 2024
1 parent 64cef61 commit 3ea0aa8
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
16 changes: 8 additions & 8 deletions Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ WORKING_DIR_NAME_VAR = config['working_dir_name_var']
rule all:
input:
final_fasta=config['final_fasta_file'],
var_table=expand('{proxy}', proxy=[config['var_table_file']] if config["include_var"] else []),
haplo_table=expand('{proxy}', proxy=[config['haplo_table_file']] if config["include_haplo"] else []),
var_fasta=expand('{proxy}', proxy=[config['var_fasta_file']] if config["include_var"] else []),
haplo_fasta=expand('{proxy}', proxy=[config['haplo_fasta_file']] if config["include_haplo"] else []),
var_table=expand('{proxy}', proxy=[config['var_table_file']] if config["use_ProVar"] else []),
haplo_table=expand('{proxy}', proxy=[config['haplo_table_file']] if config["use_ProHap"] else []),
var_fasta=expand('{proxy}', proxy=[config['var_fasta_file']] if config["use_ProVar"] else []),
haplo_fasta=expand('{proxy}', proxy=[config['haplo_fasta_file']] if config["use_ProHap"] else []),

rule download_vcf:
output:
Expand Down Expand Up @@ -294,15 +294,15 @@ rule mix_with_reference_proteome:
input:
in1="data/fasta/ensembl_reference_proteinDB_" + str(config['ensembl_release']) + "_clean.fa",
in2="data/fasta/crap_tagged.fa",
in3=expand('{proxy}', proxy=["results/variants_all_clean.fa"] if config["include_var"] else []),
in4=expand('{proxy}', proxy=["results/haplo_all_clean.fa"] if config["include_haplo"] else []),
in3=expand('{proxy}', proxy=["results/variants_all_clean.fa"] if config["use_ProVar"] else []),
in4=expand('{proxy}', proxy=["results/haplo_all_clean.fa"] if config["use_ProHap"] else []),
output:
temp("results/ref_contam_vcf_haplo_all_clean.fa")
run:
shell("cat {input.in1} {input.in2} > {output}; ")
if config["include_var"]:
if config["use_ProVar"]:
shell("cat {input.in3} >> {output}")
if config["include_haplo"]:
if config["use_ProHap"]:
shell("cat {input.in4} >> {output}")

rule merge_duplicate_seq:
Expand Down
2 changes: 1 addition & 1 deletion config_example1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ haplo_fasta_file: "results/example1_haplotype_translations.fa"
haplo_table_file: "results/example1_haplotypes.tsv"

# ---------------- ProVar parameters ----------------
include_var: False
use_ProVar: False
variant_vcf: {}

working_dir_name_var: variants_tmp
Expand Down
4 changes: 2 additions & 2 deletions config_file_example
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ ensembl_release: 108
custom_transcript_list: "data/transcripts_reference_108.csv" # Path to the CSV file containing transcript IDs to be included in the datavase. Give an empty string ("") to ignore.
included_transcript_biotypes: "protein_coding" # Comma-separated list of transcript biotypes to be included (e.g. "protein_coding,retained_intron,protein_coding_LoF"). Ignored when custom_transcript_list is given. Default: "protein_coding". Refer to Gencode for biotype names: https://www.gencodegenes.org/pages/biotypes.html

include_haplo: True # boolean value - True or False - whether or not to compute haplotypes (run ProHap). Default: True
include_var: False # boolean value - True or False - whether or not to compute individual variants (run ProVar). Default: False
use_ProHap: True # boolean value - True or False - whether or not to compute haplotypes (run ProHap). Default: True
use_ProVar: False # boolean value - True or False - whether or not to compute individual variants (run ProVar). Default: False

final_fasta_file: <resulting fasta filename>

Expand Down
16 changes: 8 additions & 8 deletions docs/configBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function setGeneralParams(ensemblRelease, custom_tr_list, transcript_biotypes, f
return general_config_html
}

function setProVarParams(include_variants, VCF_data, var_require_start, var_fasta_file, var_table_file) {
function setProVarParams(use_ProVar, VCF_data, var_require_start, var_fasta_file, var_table_file) {
let vcf_datasets = ""

VCF_data.forEach(element => {
Expand All @@ -24,27 +24,27 @@ function setProVarParams(include_variants, VCF_data, var_require_start, var_fast

const provar_config_html = "<p>\
# ---------------- ProVar parameters ----------------<br>" +
"include_var: " + (include_variants ? "True" : "False") + '<br>' +
"use_ProVar: " + (use_ProVar ? "True" : "False") + '<br>' +
(VCF_data.length === 0 ? "variant_vcf: {}<br>" : "variant_vcf: <br>" + vcf_datasets) +
"<br>" +
"working_dir_name_var: variants_tmp<br><br>" +
"var_require_start: " + (var_require_start ? "1" : "0") + '<br>' +
"<br>" +
"var_fasta_file: " + ((var_fasta_file.length == 0 && include_variants) ? "MISSING" : "\"" + var_fasta_file + "\"") + "<br>" +
"var_table_file: " + ((var_table_file.length == 0 && include_variants) ? "MISSING" : "\"" + var_table_file + "\"") + "<br>" +
"var_fasta_file: " + ((var_fasta_file.length == 0 && use_ProVar) ? "MISSING" : "\"" + var_fasta_file + "\"") + "<br>" +
"var_table_file: " + ((var_table_file.length == 0 && use_ProVar) ? "MISSING" : "\"" + var_table_file + "\"") + "<br>" +
"</p>"

return provar_config_html
}

function setProHapParams(include_haplotypes, dataset_url, dataset_path, vcf_filename, freq_threshold, count_threshold, MAF_threshold, MAF_field, haplo_require_start, haplo_ignore_UTR, haplo_skip_start_lost, haplo_fasta_file, haplo_table_file) {
function setProHapParams(use_ProHap, dataset_url, dataset_path, vcf_filename, freq_threshold, count_threshold, MAF_threshold, MAF_field, haplo_require_start, haplo_ignore_UTR, haplo_skip_start_lost, haplo_fasta_file, haplo_table_file) {
if ((dataset_path.length > 0) && !dataset_path.endsWith('/')) {
dataset_path = dataset_path + '/'
}

const prohap_config_html = "<p>\
# ---------------- ProHap parameters ----------------<br>" +
"include_haplo: " + (include_haplotypes ? "True" : "False") + '<br>' +
"use_ProHap: " + (use_ProHap ? "True" : "False") + '<br>' +
"<br>" +
"phased_FTP_URL: " + (dataset_url.length == 0 ? "\"\"" : "\"" + dataset_url + "\"") + '<br>' +
"phased_local_path: " + (dataset_path.length == 0 ? "\"\"" : "\"" + dataset_path + "\"") + '<br>' +
Expand All @@ -61,8 +61,8 @@ function setProHapParams(include_haplotypes, dataset_url, dataset_path, vcf_file
"haplo_skip_start_lost: " + (haplo_skip_start_lost ? "1" : "0") + "<br>" +
"max_cores: 3<br>" +
"<br>" +
"haplo_fasta_file: " + ((haplo_fasta_file.length == 0 && include_haplotypes) ? "MISSING" : "\"" + haplo_fasta_file + "\"") + "<br>" +
"haplo_table_file: " + ((haplo_table_file.length == 0 && include_haplotypes) ? "MISSING" : "\"" + haplo_table_file + "\"") + "<br>" +
"haplo_fasta_file: " + ((haplo_fasta_file.length == 0 && use_ProHap) ? "MISSING" : "\"" + haplo_fasta_file + "\"") + "<br>" +
"haplo_table_file: " + ((haplo_table_file.length == 0 && use_ProHap) ? "MISSING" : "\"" + haplo_table_file + "\"") + "<br>" +
"</p>"

return prohap_config_html
Expand Down

0 comments on commit 3ea0aa8

Please sign in to comment.