<commit_before>from __future__ import print_function
import os, sys
sys.path.append('..') # we assume (and assert) that this script is running from the virus directory, i.e. inside H7N9 or zika
from base.process import process
import argparse

##### Define clades #####
genotypes = {
                        "denv1":{
                        'I': [('E', 8, 'S'),('E', 37, 'D'),('E', 155, 'S')],
                        'II': [('E', 180, 'T'),('E', 345, 'A')],
                        "V": [('E', 114, 'L'),('E', 161, 'I'),('E', 297, 'T')],
                        "IV": [('E', 37, 'D'),('E', 88, 'T'),]},

                        "denv2": {
                        'ASIAN/AMERICAN': [('E', 203, 'D'), ('E', 491, 'A')],
                        'AMERICAN': [('E', 71, 'D'), ('E', 81, 'T'), ('E', 203, 'D')],
                        'ASIAN-I': [('E', 83, 'K'), ('E', 141, 'V'), ('E', 226, 'K')],
                        'COSMOPOLITAN': [('E', 71, 'A'), ('E', 149, 'N'), ('E', 390, 'S')],
                        'SYLVATIC': [('E', 59, 'F'), ('E', 83, 'V'), ('E', 129, 'V')]},

                        "denv3": {
                        'I': [('E', 68, 'V'),('E', 124, 'S'),('E', 233, 'K')],
                        'II': [('E', 154, 'D')],
                        'III': [('E', 81, 'V'),('E', 132, 'Y'),('E', 171, 'T'),],
                        'IV': [('E', 22, 'E'),('E', 50, 'V'),('E', 62, 'G')]},

                        "denv4": {
                        'I': [('E', 233, 'H'),('E', 329, 'T'),('E', 429, 'L')],
                        'II': [('E', 46, 'T'), ('E', 478, 'T')],
                        'SYLVATIC': [('E', 132, 'V'), ('E', 154, 'S')]},

                        "all": {}
                }

for i in ['denv1', 'denv2', 'denv3', 'denv4']:
    for k,v in genotypes[i].iteritems():
        genotypes['all'][i.upper()+' '+k] = v

regions = ['africa', 'europe', 'north_america', 'china', 'south_asia',
            'japan_korea', 'south_pacific', 'oceania', 'south_america',
            'southeast_asia', 'west_asia']

def collect_args():
    parser = argparse.ArgumentParser(description = "Process (prepared) JSON(s)")
    parser.add_argument('-j', '--jsons', '--json', default=None, nargs='+', type=str, help="Accepts path to prepared JSON(s); overrides -s argument")
    parser.add_argument('-s', '--serotypes', default=["multiple"], nargs='+', type=str, choices=['denv1', 'denv2', 'denv3', 'denv4', 'all', 'multiple'],
    help="Look for prepared JSON(s) like ./prepared/dengue_SEROTYPE.json; 'multiple' will run all five builds. Default='multiple'")
    parser.add_argument('--clean', default=False, action='store_true', help="clean build (remove previous checkpoints)")
    parser.add_argument('--no_mut_freqs', default=False, action='store_true', help="skip mutation frequencies")
    parser.add_argument('--no_tree_freqs', default=False, action='store_true', help="skip tree (clade) frequencies")
    return parser.parse_args()

def make_config (prepared_json, args):<commit_msg>Update clade designations.<commit_after>from __future__ import print_function
import os, sys
sys.path.append('..') # we assume (and assert) that this script is running from the virus directory, i.e. inside H7N9 or zika
from base.process import process
import argparse

##### Define clades #####
genotypes = {
'denv1': {'I': [('E', 461, 'V'), ('E', 484, 'L'), ('M', 107, 'T')],
           'II': [('E', 345, 'A'), ('E', 432, 'M'), ('E', 439, 'V')],
           'IV': [('E', 339, 'S'), ('M', 72, 'E'), ('E', 88, 'T')],
           'V': [('E', 297, 'T'), ('NS5', 135, 'M')]},
 'denv2': {'AMERICAN': [('E', 71, 'D'), ('E', 81, 'T'), ('E', 129, 'I')],
           'ASIANAMERICAN': [('E', 491, 'A'), ('M', 15, 'G'), ('M', 39, 'I')],
           'ASIANI': [('E', 484, 'I'), ('NS5', 688, 'I'), ('NS1', 222, 'N')],
           'COSMOPOLITAN': [('E', 71, 'A'), ('E', 149, 'N'), ('E', 462, 'V')],
           'SYLVATIC': [('E', 59, 'F'), ('E', 236, 'M'), ('E', 432, 'V')]},
 'denv3': {'I': [('E', 233, 'K'), ('M', 128, 'F'), ('E', 68, 'V')],
           'II': [('M', 57, 'A'), ('NS5', 750, 'K')],
           'III': [('E', 303, 'T'), ('E', 454, 'V'), ('E', 132, 'Y')],
           'IV': [('E', 22, 'E'), ('E', 50, 'V'), ('E', 62, 'G')]},
 'denv4': {'I': [('E', 494, 'H'), ('NS1', 5, 'A')],
           'II': [('E', 265, 'A'), ('E', 46, 'T'), ('NS1', 246, 'S')],
           'SYLVATIC': [('E', 132, 'V'), ('E', 154, 'S'), ('E', 162, 'T')]},
 'all': {}
 }

for i in ['denv1', 'denv2', 'denv3', 'denv4']:
    for k,v in genotypes[i].iteritems():
        genotypes['all'][i.upper()+'_'+k] = v

regions = ['africa', 'europe', 'north_america', 'china', 'south_asia',
            'japan_korea', 'south_pacific', 'oceania', 'south_america',
            'southeast_asia', 'west_asia']

def collect_args():
    parser = argparse.ArgumentParser(description = "Process (prepared) JSON(s)")
    parser.add_argument('-j', '--jsons', '--json', default=None, nargs='+', type=str, help="Accepts path to prepared JSON(s); overrides -s argument")
    parser.add_argument('-s', '--serotypes', default=["multiple"], nargs='+', type=str, choices=['denv1', 'denv2', 'denv3', 'denv4', 'all', 'multiple'],
    help="Look for prepared JSON(s) like ./prepared/dengue_SEROTYPE.json; 'multiple' will run all five builds. Default='multiple'")
    parser.add_argument('--clean', default=False, action='store_true', help="clean build (remove previous checkpoints)")
    parser.add_argument('--no_mut_freqs', default=False, action='store_true', help="skip mutation frequencies")
    parser.add_argument('--no_tree_freqs', default=False, action='store_true', help="skip tree (clade) frequencies")
    return parser.parse_args()

def make_config (prepared_json, args):
{'fraction_non_alphanumeric': 0.26901507185418855, 'fraction_numerical': 0.04539081668419208, 'mean_word_length': 2.9115832762165867, 'pattern_counts': {'":': 7, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7285810', 'n_tokens_mistral': 2342, 'n_tokens_neox': 2046, 'n_words': 552}