struct
type t = {
name: string;
rna_gene_fpkm_tracking_file: string option;
rna_min_gene_expression: float;
rna_transcript_fpkm_tracking_file: string option;
rna_min_transcript_expression: float;
rna_transcript_fkpm_gtf_file: string option;
mhc_epitope_lengths: int list;
only_novel_epitopes: bool;
ic50_cutoff: float;
percentile_cutoff: float;
padding_around_mutation: int option;
self_filter_directory: string option;
skip_variant_errors: bool;
parameters: (string * string) list;
}
let to_json {
name;
rna_gene_fpkm_tracking_file;
rna_min_gene_expression;
rna_transcript_fpkm_tracking_file;
rna_min_transcript_expression;
rna_transcript_fkpm_gtf_file;
mhc_epitope_lengths;
only_novel_epitopes;
ic50_cutoff;
percentile_cutoff;
padding_around_mutation;
self_filter_directory;
skip_variant_errors;
parameters}: Yojson.Basic.json =
`Assoc [
"name", `String name;
"rna_gene_fpkm_tracking_file",
(match rna_gene_fpkm_tracking_file with
| None -> `Null
| Some s -> `String s);
"rna_min_gene_expression", `Float rna_min_gene_expression;
"rna_transcript_fpkm_tracking_file",
(match rna_transcript_fpkm_tracking_file with
| None -> `Null
| Some s -> `String s);
"rna_min_transcript_expression", `Float rna_min_transcript_expression;
"rna_transcript_fkpm_gtf_file",
(match rna_transcript_fkpm_gtf_file with
| None -> `Null
| Some s -> `String s);
"mhc_epitope_lengths",
`List (List.map mhc_epitope_lengths ~f:(fun i -> `Int i));
"only_novel_epitopes", `Bool only_novel_epitopes;
"ic50_cutoff", `Float ic50_cutoff;
"percentile_cutoff", `Float percentile_cutoff;
"padding_around_mutation",
(match padding_around_mutation with
| None -> `Null
| Some i -> `Int i);
"self_filter_directory",
(match self_filter_directory with
| None -> `Null
| Some s -> `String s);
"skip_variant_errors", `Bool skip_variant_errors;
"parameters",
`Assoc (List.map parameters ~f:(fun (k, s) -> k, `String s));
]
let render {parameters; _} =
List.concat_map parameters ~f:(fun (a,b) -> [a; b])
let default =
{
name = "default";
rna_gene_fpkm_tracking_file = None;
rna_min_gene_expression = 4.0;
rna_transcript_fpkm_tracking_file = None;
rna_min_transcript_expression = 1.5;
rna_transcript_fkpm_gtf_file = None;
mhc_epitope_lengths = [8; 9; 10; 11];
only_novel_epitopes = false;
ic50_cutoff = 500.0;
percentile_cutoff = 2.0;
padding_around_mutation = None;
self_filter_directory = None;
skip_variant_errors = false;
parameters = []
}
let name t = t.name
end