Esempio n. 1
0
        "subsample": {
            "category": lambda x:(x.attributes['region'], x.attributes['date'].year, x.attributes['date'].month),
            "threshold": params.viruses_per_month,
            "priority": lambda x:x.id in forced_strains
        },
        "colors": ["country", "division"], # essential. Maybe False.
        "color_defs": ["./colors.tsv"],
        "lat_longs": ["country", "division"], # essential. Maybe False.
        "reference": {
            "path": "metadata/ebola_outgroup.gb",
            "metadata": {
                'strain': "reference", "accession": "KR075003", "date": "2014-XX-XX",
                'host': "human", 'country': "Liberia"
            },
            "include": 0,
            "genes": ['NP', 'VP35', 'VP40', 'GP', 'sGP', 'VP30', 'VP24', 'L']
        }
    }


if __name__=="__main__":
    params = collect_args()
    runner = prepare(make_config(params))
    runner.load_references()
    runner.applyFilters()
    runner.ensure_all_segments()
    runner.subsample()
    runner.colors()
    runner.latlongs()
    runner.write_to_json()
Esempio n. 2
0
        '../../fauna/source-data/geo_lat_long.tsv',
        "references":
        {seg: reference_maps[lineage][seg]
         for seg in params.segments},
        "regions":
        regions,
        "time_interval":
        time_interval,
    }


if __name__ == "__main__":
    params = collect_args()
    # set_trace()

    ## lots of loops to allow multiple downstream analysis
    for lineage in params.lineages:
        for resolution in params.resolutions:
            pprint("Preparing lineage {}, segments: {}, resolution: {}".format(
                lineage, params.segments, resolution))

            config = make_config(lineage, resolution, params)
            runner = prepare(config)
            runner.load_references()
            runner.applyFilters()
            runner.ensure_all_segments()
            runner.subsample()
            runner.colors()
            runner.latlongs()
            runner.write_to_json()
Esempio n. 3
0
            },
            "include": 0,
            "genes": ['NC', 'P', 'V', 'I', 'M', 'F', 'SH', 'HN', 'L']
        }
    }
    if context == "global":
        config["filters"] = (filters["dropped_strains"], filters["exclude_BC"], filters["exclude_Mass"], filters["unknown_country"])
    elif context == "bc":
        config["filters"] = (filters["dropped_strains"], filters["canada_only"], filters["unknown_country"])
    elif context == "mass":
        config["filters"] = (filters["dropped_strains"], filters["Mass_only"],filters["unknown_country"])
    else:
        print("Unknown context. FATAL")
        sys.exit(2)



    return config

if __name__=="__main__":
    params = collect_args()
    for context in ["global", "bc", "mass"]:
        runner = prepare(make_config(context))
        runner.load_references()
        runner.applyFilters()
        runner.ensure_all_segments()
        runner.subsample()
        runner.colors()
        runner.latlongs()
        runner.write_to_json()