Пример #1
0
def getNameFromMD5(md5):
    from MEGA import sql  # This cannot be done on start
    ids = sql.getIds(md5)
    for id in ids:
        id = id[0]
        if id.startswith("pop/"):
            return id[4:]
    return "Non core pop"
Пример #2
0
paths = cfg.get("System", "pythonInclude").split(":")
for path in paths:
    sys.path.insert(0, os.path.expanduser(path))

import MEGA
from MEGA import web, sql

form = cgi.FieldStorage()
op, md5, studyName, study = web.getCore(form)
sPop = form["sp"].value
karyo = form["k"].value
#sPopURL= sPop.replace("+","%2B")
sPopURL = sPop.replace("%2B", "+")

xpehhPath = "%s/sets/%s/%s/" % (MEGA.cacheDB, karyo, md5)
ids = sql.getIds(md5)
myStudies = []
for id in ids:
    idStr = id[0]
    if idStr.find("xpEHH"):
        toks = idStr.split("/")
        myStudies.append(toks[1] + "/" + toks[-1])

web.sendPreamble(md5, None, "xpEHH")

os.chdir(xpehhPath)

print('<a href="pop.py?md5=%s">Population page</a>' % (md5,))
print("<h1>xpEHH</h1>")
print(",".join(myStudies))
print("<h2>Bulk Downloads</h2>(support %s)<br>" % sPop)
Пример #3
0
    for sPop in supportPops:
        print('<a href="xpEHH.py?md5=%s&sp=%s&k=%s">Click Here for details (%s)</a>' % (
            md5, sPop.replace("+", "%2B"), karyo, sPop))
    if len(supportPops) == 0:
        print("<b>No xpEHH data!</b>")

try:
    doXPEHH()
except OSError:
    pass

print("</td><td valign=top>")
print(web.linkFile((karyo, md5), "indivs", "plink individual file"))

ids = sql.getIds(md5)
print("<table border=1><tr><td>Study</td><td>Usage</td></tr>")
for id in ids:
    toks = id[0].split("/")
    if toks[0] != "study":
        continue
    study = toks[1]
    if len(toks) > 3:
        usage = toks[2]
    else:
        usage = "&nbsp;"
    print("<tr><td>%s</td><td>%s</td></tr>" % (web.getStudyURL(study), usage))
print("</table>")


print('<h2>Zoom</h2>')