#!/bin/env python2 import re, sys from getwiki import GlycanData w = GlycanData() for l in sys.stdin: print l.strip() try: w.delete(l.strip()) except OSError: pass
# for acc,label,redend in gtc.allmotifs(): # allmotifs[acc] = dict(label=label,redend=redend) archived = set(map(lambda d: d['accession'], gco.archived())) print "%d accessions archived." % (len(archived), ) current = set() for gtcacc in accessions(sys.argv[1:]): start = time.time() g = w.get(gtcacc) newgly = False if gtcacc in archived: if g: w.delete(gtcacc) print >> sys.stderr, "%s deleted in %.2f sec" % ( g.get('accession'), time.time() - start, ) continue if not g: newgly = True g = Glycan(accession=gtcacc) g.delete('wurcs') g.delete('glycoct') g.delete('iupac') g.delete_annotations(source='GlyTouCan', type='Sequence')