Example #1
0
def main(args):
    try:
        famID=int(args[-1])
    except:
        print >> sys.stderr,  __doc__
        return 1
    famGis=utils.noneDict(giInfo.GiInfo._table.Gi.valueList(Family_Tax_ID=famID))

    if len(famGis) ==0:
        print >> sys.stderr, "No gis found for family taxID: %s" % famID 
        return 1

    for l in sys.stdin:
        try:
            gi = int(B.giFromM8name(l.split()[1]))
        except:
            continue
        if gi in famGis:
            print l,
    return 0
Example #2
0
#!/usr/local/bin/python
import sys
import utils
from glob import glob

from sequence import blastNoSQL as B
from ncbi import taxonomy

targetTaxID = 54290
viralAlignmnets=glob("")
crossHybeAlignments = (,)
noCrossHybe = ""
minAlignLen=14

B.uniqueAlignments(viralAlignmnets,crossHybeAlignments,file(noCrossHybe,'w'))
gis=utils.noneDict(giInfo.GiInfo._table.Gi.valueList(
    Family_Tax_ID=targetFamilyTaxID) )                
#print len(famGis)

subjects = {}

for l in file(noCrossHybe):
    try:
        gi = int(B.giFromM8name(l.split()[1]))
    except IndexError:
        continue

    #print 'beep'
    
    if gi not in gis:
        continue