Beispiel #1
0
                                      z1=z1,
                                      mz2=mz2,
                                      z2=z2)
        if modified:
            print t.get('id')

        if (pid, z1, spectra) not in tgroup:
            tgroup[(pid, z1, spectra)] = dict(transitions=[],
                                              nrt=nrt,
                                              rt=rt,
                                              mz1=mz1,
                                              scans=scans)
        tgroup[(pid, z1, spectra)]['transitions'].append((t.get('id'), relint))

    for pid, z1, spectra in tgroup:
        tgroup[(pid, z1, spectra)]['ntransition'] = len(
            tgroup[(pid, z1, spectra)]['transitions'])
        tg, mod = w.addtransgroup(peptide=pid,
                                  z1=z1,
                                  spectra=spectra,
                                  **tgroup[(pid, z1, spectra)])
        if mod:
            print tg.get('id')
        if tg.get('id') in spectra2tg[spectra]:
            spectra2tg[spectra].remove(tg.get('id'))

for spectra in allspectra:
    for tgid in spectra2tg[spectra]:
        print "Deleting transition group", tgid
        w.delete(tgid)
Beispiel #2
0
#!/bin/env python27

from getwiki import GPTWiki, Peptide
import sys
from collections import defaultdict

w = GPTWiki()
for sp in sys.argv[1:]:
    for tg in w.iterspectgs(sp):
        if not tg:
            continue
        print >> sys.stderr, "Delete transition group", tg.get('id')
        w.delete(tg.get('id'))
    print >> sys.stderr, "Delete spectra", sp
    w.delete(sp)
Beispiel #3
0
#!/bin/env python27

from getwiki import GPTWiki, Peptide
import sys
from collections import defaultdict

w = GPTWiki()
for tgpage in w.iterpages(include_categories=['TransitionGroup']):
    tg = w.get(tgpage.name)
    if tg.get('spectra') in sys.argv[1:]:
        print >> sys.stderr, "Delete transition group", tgpage.name
        w.delete(tgpage.name)
for sp in sys.argv[1:]:
    print >> sys.stderr, "Delete spectra", sp
    w.delete(sp)
Beispiel #4
0
#!/bin/env python27

from getwiki import GPTWiki, Peptide
import sys
from collections import defaultdict

w = GPTWiki()
currtrans = set()
for tgpage in w.iterpages(include_categories=['TransitionGroup']):
    tg = w.get(tgpage.name)
    tgid = tg.get('id')
    for t, i in tg.get('transitions'):
        tr = w.get(t)
        if tr:
            currtrans.add(t)
for tpage in w.iterpages(include_categories=['Transition']):
    t = w.get(tpage.name)
    tid = t.get('id')
    if tid not in currtrans:
        print >> sys.stderr, "Delete transition " + tid
        w.delete(tid)
Beispiel #5
0
towiki = sys.argv[2].upper()

assert fromwiki in ("PROD", "DEV", "TEST")
assert towiki in ("PROD", "DEV", "TEST")
assert fromwiki != towiki

w1 = GPTWiki(smwenv=fromwiki, quiet=True)
print >> sys.stderr, "from: %s" % (w1.title(), )
w2 = GPTWiki(smwenv=towiki, quiet=True)
print >> sys.stderr, "  to: %s" % (w2.title(), )

dummy = raw_input("Enter to proceed, <Ctrl-C> to abort:")

currentids = set()
for page in w1.iterpages(include_categories=('Transition', 'Peptide',
                                             'TransitionGroup')):
    id = page.name
    currentids.add(id)
    it = w1.get(id)
    if w2.put(it):
        print >> sys.stderr, "Pushing %s to %s" % (id, w2.title())
    else:
        print >> sys.stderr, "No change to %s in %s" % (id, w2.title())

for page in w2.iterpages(include_categories=('Transition', 'Peptide',
                                             'TransitionGroup')):
    id = page.name
    if id not in currentids:
        w2.delete(id)
        print >> sys.stderr, "Delete %s from %s" % (id, w2.title())
Beispiel #6
0
#!/bin/env python27

from getwiki import GPTWiki, Peptide

import sys, urllib, string
import Bio.SeqIO
from util import peptide_mw, mod_mw

seen = set()

w = GPTWiki()
peps = []
for p in w.iterpages(include_categories=['Peptide']):
    pep = w.get(p.name)
    pepkey = Peptide.key(pep.get('sequence'), pep.get('glycan', []),
                         pep.get('mod', []))
    if pepkey in seen:
        print >> sys.stderr, p.name
        w.delete(p.name)
    seen.add(pepkey)