w = GlycoMotifWiki() gtc = None def accs(): global gtc if len(sys.argv) > 1: gtc = GlyTouCan(prefetch=False, usecache=False) for acc in sys.argv[1:]: yield acc else: gtc = GlyTouCan(prefetch=True, usecache=False) for m in w.itermotif(): yield m.get('id') for acc in accs(): m = w.get(acc) gtcacc = m.get('glytoucan') wurcs = gtc.getseq(gtcacc, 'wurcs') glycoct = gtc.getseq(gtcacc, 'glycoct') if not glycoct: glycoct = gtc.glycoct(gtcacc) if wurcs: m.set('wurcs', wurcs) if glycoct: m.set('glycoct', glycoct) if w.put(m): print acc
page = theart['Pagination']['MedlinePgn'] if issue: volume = "%s(%s)" % (vol, issue) else: volume = vol if isinstance(ref, int): citedby = ( 'Cummings_(2009)_The_repertoire_of_glycan_determinants_in_the_human_glycome', ref) elif isinstance(ref, basestring) and ref.startswith('EP'): citedby = ('GE', ref) else: citedby = None pub = Publication(authors=authors, title=title, journal=journal, year=year, volume=volume, pages=page, pmid=pmid, doi=doi, citedby=citedby) print Publication.pagename(**pub.data) print pub.astemplate() if w.put(pub): print >> sys.stderr, pmid time.sleep(5)
assert towiki in ("PROD", "DEV", "TEST") assert fromwiki != towiki w1 = GlycoMotifWiki(smwenv=fromwiki, quiet=True) print >> sys.stderr, "from: %s" % (w1.title(), ) w2 = GlycoMotifWiki(smwenv=towiki, quiet=True) print >> sys.stderr, " to: %s" % (w2.title(), ) dummy = raw_input("Enter to proceed, <Ctrl-C> to abort:") currentcoll = set() for c1 in w1.itercollection(): id = c1.get('id') assert (id) currentcoll.add(id) if w2.put(c1): print >> sys.stderr, "Pushing %s to %s" % (id, w2.title()) else: print >> sys.stderr, "No change to %s in %s" % (id, w2.title()) currentmotif = set() for m1 in w1.itermotif(): id = m1.get('id') assert (id) currentmotif.add(id) if w2.put(m1): print >> sys.stderr, "Pushing %s to %s" % (id, w2.title()) else: print >> sys.stderr, "No change to %s in %s" % (id, w2.title()) for c2 in w2.itercollection():
#!/bin/env python27 from getwiki import GlycoMotifWiki, Collection, GlyTouCanMotif, CCRCMotif, GlycoEpitopeMotif, AllMotif, GlyGenMotif from getwiki import GlydinMotif, GlydinCummingsMotif, GlydinHayesMotif, GlydinCermavMotif, GlydinSugarbindMotif, GlydinBioligoMotif from getwiki import UniCarbMotif import sys w = GlycoMotifWiki() current = set() w.put( Collection(id=GlyTouCanMotif.id, name="GlyTouCan Motifs", contact="Kiyoko Aoki-Kinoshita", email="*****@*****.**", url="https://glytoucan.org/Motifs/listAll")) current.add(GlyTouCanMotif.id) w.put( Collection( id=CCRCMotif.id, name="CCRC Motifs", contact="Rene Ranzinger", email="*****@*****.**", url= "https://github.com/glygen-glycan-data/PyGly/raw/master/smw/glycomotif/data/MotifsMP2.xlsx" )) current.add(CCRCMotif.id) w.put( Collection(id=GlycoEpitopeMotif.id, name="GlycoEpitope Epitopes", contact="Toshisuke Kawasaki", email="*****@*****.**",