5-4. Converting data

At the point of data formatting, the data can be converted into a new format by calculating, joining or scoring. One thing to keep in mind is that if a "data convert" property is added to your configuration, BYOR assumes that the converted data is the data being used to apply filters and build visualizers. It means that if you have a field in your raw data that is not added to the converted data, things may not work the way you imagined. 

Format

"data convert":[
{"type":"convert type","field name":"new field name","raw field":"value in raw data"},
{"type":"convert type","field name":"new field name","raw field":"value in raw data"}
]

Options

raw: Just add a field in raw data, with a new field name:
{"type":"raw","field name":"Chromosome","raw field":"chromosome"}

js math: Apply javascript Math metods with no parameters:
{"type":"js math","field name":"your field name","raw field":"raw field name","method":"round"},

join: Join two fields in raw data into a new field:
{"type":"join","field name":"Locus","fields to join":["chromosome","position"],"join by":":"}

join multi: Join multiple fields in raw data into a new field:
{"type":"join multi","field name":"Variant ID","fields to join":["chromosome","position","reference","alt"],"join by":[":","_","/"]}

replace characters: Replace characters in raw data into a new field:
{"type":"replace characters","field name":"1-star Genes","raw field":"gene_1_star", "replace":[{"from":";","to":", "}]}

array to string: Converts array data to string (json or BioIndex only):
{"type":"array to string","field name":"Nearest Genes","raw field":"nearest","separate by":","}

calculate: Create a new field by calculating values in raw data. Only the "-log10" option is available at this point (02/10/2022):
{"type":"calculate","field name":"-log10(P-Value)","raw field":"pValue","calculation type":"-log10"}

score columns: Create a new field by calculating scores of the values in the listed fields. Only boolean values (true/false, yes/no or 1/0) can be calculated:
{"type": "score columns","field name": "Score","fields to score": ["DEPICT", "MAGMA", "PoPS", "OMIM", "Gene_nearest_COJO", "eQTL_COJO", "Functional_COJO"],
    "score by": {"DEPICT": { "type": "boolean", "value to score": { "yes": 1, "no": 0} },"MAGMA": { "type": "boolean", "value to score": { "yes": 1, "no": 0} },"PoPS": { "type": "boolean", "value to score": { "yes": 1, "no": 0} },"OMIM": { "type": "boolean", "value to score": { "yes": 1, "no": 0} },"Gene_nearest_COJO": { "type": "boolean", "value to score": { "yes": 1, "no": 0} },"eQTL_COJO": { "type": "boolean", "value to score": { "yes": 1, "no": 0} },"Functional_COJO": { "type": "boolean", "value to score": { "yes": 1, "no": 0} }}}