Differential Analysis

Summary

Doing “normal” differential analyhsis programatically is a two-step process. In the first step, sets of metadata triplets are created. In the second step, those sets are used as input to the actual calculator.

Step 1 - Triplets

Making a post request to

http://bindiscover.metabolomics.us:4999/leafmetadataresource/

With the format

{
    "triplet_from": ["zea mays - Plant Roots - No Disease","citrus sinensis - Plant Roots - No Disease"], #any triplet from our data
    "triplet_to": ["arabidopsis thaliana - Plant Roots - No Disease"]
}

Where values are possible triplets will yield a record-oriented metadata table, e.g.

"[
    {\"from_or_to\":\"from\",\"triplet_id\":\"zea mays - Plant Roots - No Disease\",\"sample_count\":359},{\"from_or_to\":\"from\",\"triplet_id\":\"citrus sinensis - Plant Roots - No Disease\",\"sample_count\":12},
    {\"from_or_to\":\"to\",\"triplet_id\":\"arabidopsis thaliana - Plant Roots - No Disease\",\"sample_count\":408}
]"

Note: Multiple Triplets

Normal differential analysis compares one triplet to another triplet. We see that we can combine multiple triplets here, without thinking about their relative positions in an ontology

Step 2 - Differential Analysis

Making a post request to

http://bindiscover.metabolomics.us:4999/hgdaresource/

with the format

{
    "metadata_datatable":
        [
            {\"from_or_to\":\"from\",\"triplet_id\":\"zea mays - Plant Roots - No Disease\",\"sample_count\":359},{\"from_or_to\":\"from\",\"triplet_id\":\"citrus sinensis - Plant Roots - No Disease\",\"sample_count\":12},
            {\"from_or_to\":\"to\",\"triplet_id\":\"arabidopsis thaliana - Plant Roots - No Disease\",\"sample_count\":408}
        ],
    "bin_type":"known" #values are 'known', 'unknown', and 'class' (compound classes)
}

will yield the core information for the differential analysis, eg

"[
    {\"compound_id\": 14717, \"identifier\": \"OOWQBDFWEXAXPB-UHFFFAOYSA-N\", \"english_name\": \"hexadecylglycerol\", \"bin_type_dict\": \"known\", \"significance_welch\": 0.6109507199, \"fold_change_average\": 0.007302779200000001},
    {\"compound_id\": 2214, \"identifier\": \"LOLKAJARZKDJTD-UHFFFAOYSA-N\", \"english_name\": \"ethylsuccinate\", \"bin_type_dict\": \"known\", \"significance_welch\": 0.1504452139, \"fold_change_average\": -0.031181263}...
"