def getHitsForPrimary(): ''' Selects appropriate row from primaryTable, and updates domains to include the one from HMMERSearch ''' print "adding domains to primary table" # get gis from primary table giList = databaseMethods.databaseRows(databaseName, primaryTable) # check hit id (gi) is in giList for hit in queryResult: if hit.id in giList: # get domains from gi row in primary table domainString = databaseMethods.getGIRow(databaseName, primaryTable, hit.id) # add the domain domainString2 = domainString + "|" + str(queryResult.id) # replace into primary table databaseMethods.updateDomains(databaseName, primaryTable, domainString2, hit.id) else: # send warning message warnings.warn("Notice: gi %s is not in primary table." % hit.id)
A helper function to insert information into the *domain* table. ''' # collect info needed to insert into domains table domainInfo = [(hitInfo["gi"], hitInfo["domain"], hitInfo["start"], \ hitInfo["end"], hitInfo["sequence"], hitInfo["score"])] # insert into domains db databaseMethods.domainDatabaseInsert(domainInfo, databaseName, domainTable) def insertPrimary(domain, giVal): ''' A helper function to insert information into the *primary* table. ''' gi = giVal.split("_")[0] if gi in giList: # update domains in primary table databaseMethods.concatDomains(databaseName, primaryTable, query, gi) else: # send warning message warnings.warn("Notice: gi %s is not in primary table." % gi) # ----------------CALLS----------------------------------- # get information out of jackhmmer file jackHmmerInfo = jackhmmerParse.jackhmmerParse(query, jackhmmerFile) # length of jackHMMER info lenJackHmmer = len(jackHmmerInfo) # get list of gis from primary table giList = databaseMethods.databaseRows(databaseName, primaryTable) # run through every hit in jackHmmerInfo loopHits(jackHmmerInfo)
''' # collect info needed to insert into domains table domainInfo = [(hitInfo["gi"], hitInfo["domain"], hitInfo["start"], \ hitInfo["end"], hitInfo["sequence"], hitInfo["score"])] # insert into domains db databaseMethods.domainDatabaseInsert(domainInfo, databaseName, domainTable) def insertPrimary(domain, giVal): ''' A helper function to insert information into the *primary* table. ''' gi = giVal.split("_")[0] if gi in giList: # update domains in primary table databaseMethods.concatDomains(databaseName, primaryTable, query, gi) else: # send warning message warnings.warn("Notice: gi %s is not in primary table." % gi) # ----------------CALLS----------------------------------- # get information out of jackhmmer file jackHmmerInfo = jackhmmerParse.jackhmmerParse(query, jackhmmerFile) # length of jackHMMER info lenJackHmmer = len(jackHmmerInfo) # get list of gis from primary table giList = databaseMethods.databaseRows(databaseName, primaryTable) # run through every hit in jackHmmerInfo loopHits(jackHmmerInfo)