def addTheHstMatrix(projectPath, projectName, appName, mgtlist): # setting up the appClass readAppSettAndConnToDb.setupEnvPath(projectPath, projectName) appClass = readAppSettAndConnToDb.importAppClassModels(appName) readFileAndAdd(projectPath, appName, appClass, mgtlist)
def addInfo(projectPath, projectName, appName, fn_isolateInfo): readAppSettAndConnToDb.setupEnvPath(projectPath, projectName) appClass = readAppSettAndConnToDb.importAppClassModels(appName) from django.contrib.auth.models import User handleTheFile(User, appClass, fn_isolateInfo)
def doAddClonalComplexes(projectPath, projectName, appName, tableNum_orderNum, schemeName, cc, st, dst, merges): # setting up the appClass readAppSettAndConnToDb.setupEnvPath(projectPath, projectName) organismAppClass = readAppSettAndConnToDb.importAppClassModels(appName) # print(organismAppClass) loadAndAddCcs(projectPath, appName, organismAppClass, tableNum_orderNum, schemeName, cc, st, dst, merges)
def addSnpMutsToDb(projectPath, projectName, orgAppName, allele_dict): # setting up the appClass readAppSettAndConnToDb.setupEnvPath(projectPath, projectName) organismAppClass = readAppSettAndConnToDb.importAppClassModels(orgAppName) # running add snps for locus in allele_dict: allele = allele_dict[locus][1] snplist = allele_dict[locus][3] getAlleleAndAddSnpsTo_(organismAppClass, {}, locus, allele, snplist)
def addAlleles(projectPath, projectName, appName,dir_alleleSeqs, alleles_out_dict): ## change dir_alleleSeqs to use alleles_dict_out # setting up the appClass readAppSettAndConnToDb.setupEnvPath(projectPath, projectName) organismAppClass = readAppSettAndConnToDb.importAppClassModels(appName) dir_seqsToSaveTo = readAppSettAndConnToDb.importAlleleDirFromSettings(projectName) # print(organismAppClass,dir_seqsToSaveTo) # for each file in the folder extractAndAddAlleles(organismAppClass, dir_alleleSeqs, projectPath, appName, alleles_out_dict)
def addApForScheme(projectPath, projectName, appName, schemeName, profile_dict, st, dst, nodash_to_dash): readAppSettAndConnToDb.setupEnvPath(projectPath, projectName) orgAppClass = readAppSettAndConnToDb.importAppClassModels(appName) list_tableNameClass = getTableClasses(orgAppClass, schemeName, appName, projectPath) schObj = getFromTableInOrgDb.getScheme(orgAppClass, schemeName) lociNames_sorted = getLociNamesSorted(schObj) # print("HELLO",len(lociNames_sorted)) # print(list_tableNameClass) locus_ids_list_o_lists = list(chunks(lociNames_sorted, 1000)) alleles_ls = [] for locuslis in locus_ids_list_o_lists: nlis = [] for locus in locuslis: locus = nodash_to_dash[locus] nlis.append(profile_dict[locus]) alleles_ls.append(nlis) # print("1") # for i in locus_ids_list_o_lists: # print(len(i),i) # print("2") # for i in alleles_ls: # print(len(i), i) #for addToDb() need lociNames_sorted = list of lists of loci ids = [[l1,l2,l3...][l1001,l1002....]] # also need equivalent list of allele assignments = alleles_ls = [[1,2,1,...][-1_1,4,....]] #TODO check when adding that allele + locus ids are used NOT unique allele id... # print("pre addToDb") # print(st, dst, locus_ids_list_o_lists) addToDb(list_tableNameClass, st, dst, locus_ids_list_o_lists, alleles_ls)
def genDefs(projectPath, projectName, appName): readAppSettAndConnToDb.setupEnvPath(projectPath, projectName) organismAppClass = readAppSettAndConnToDb.importAppClassModels(appName) genApCode(organismAppClass)