示例#1
0
print("<br>")
print(study.summary)

print("<h2>Map</h2>")
web.addMap(study.pops.pops)
print("<h2>Populations</h2>")
cuts = study.ibd.cuts
print('<table border="1">')
print('<tr><td>Population</td><td>#</td>')
for cut in cuts:
    print('<td>', cut, '</td>')
print('</tr>')
for pop in study.pops.pops:
    md5 = MEGA.getHash(study.pops.getIndivs(pop))
    print("<tr>")
    print("<td>", web.getPopURL(pop, karyo.karyotype, md5), "</td>")
    print("<td>", len(study.pops.getIndivs(pop)), "</td>")
    for cut in cuts:
        try:
            print('<td>', len(study.ibd.getIndivsPop(pop, cut)), '</td>')
        except IOError:
            print('<td></td>')
    print("</tr>")
print("</td>")
print("</tr></table>")
print("<br>")
print(web.linkFile(studyName, "ibd.problems", "IBD issues (>12.5)", True))

print('<h2>PCA</h2>')
print('<table border=1>')
for i in range(study.pca.numPCAs):
示例#2
0
print "<title>MEGA browser</title>"

print "<h1>MEGA browser</h1>"

print "<h2>Studies</h2>"
print """
<table border="1">
<tr>
  <td>Study</td>
  <td>Study pops</td>
  <td>Out pops</td>
</tr>
"""
for study in MEGA.studies:
    ins, outs = MEGA.studies[study]
    inURLs = map(lambda x: web.getPopURL(x), ins)
    outURLs = map(lambda x: web.getPopURL(x), outs)
    print "<tr><td>%s</td><td>%s</td><td>%s</td></tr>" % (
        study, ", ".join(inURLs), ", ".join(outURLs))
print "</table>"

print "<h2>Bundles</h2>"
print """
<table border="1">
<tr>
  <td>Bundle</td>
  <td>Inside</td>
</tr>
"""
for bundle in MEGA.bundles:
    pops = MEGA.bundles[bundle]
示例#3
0
for path in paths:
    sys.path.insert(0, os.path.expanduser(path))

import MEGA
from MEGA import web

web.sendPreamble(None, None, "Populations")

print("<h2>Populations</h2>")

pops = MEGA.pops
karyos = os.listdir(MEGA.cacheDB + "/sets/")
print('<table border="1">')
curr = 1
print("<tr>")
for pop in pops:
    indivs = MEGA.getIndivs(pop)
    hash = MEGA.getHash(indivs)
    print('<td>')
    print(pop)
    start = False
    for myKaryo in karyos:
        if os.path.isdir('%s/sets/%s/%s' % (MEGA.cacheDB, myKaryo, hash)):
            print("%s" % web.getPopURL(pop, myKaryo, hash, onlyKaryo=True))
    print('</td>')
    if curr % 6 == 0:
        print("</tr><tr>")
    curr += 1
print("</tr>")
print("</table>")
示例#4
0
print "<title>MEGA browser</title>"

print "<h1>MEGA browser</h1>"

print "<h2>Studies</h2>"
print """
<table border="1">
<tr>
  <td>Study</td>
  <td>Study pops</td>
  <td>Out pops</td>
</tr>
"""
for study in MEGA.studies:
    ins, outs = MEGA.studies[study]
    inURLs = map(lambda x:web.getPopURL(x), ins)
    outURLs = map(lambda x:web.getPopURL(x), outs)
    print "<tr><td>%s</td><td>%s</td><td>%s</td></tr>" % (study, ", ".join(inURLs), ", ".join(outURLs))
print "</table>"



print "<h2>Bundles</h2>"
print """
<table border="1">
<tr>
  <td>Bundle</td>
  <td>Inside</td>
</tr>
"""
for bundle in MEGA.bundles:
示例#5
0
from MEGA import web

form = cgi.FieldStorage()
pop = form["p"].value

print '<a href="mega.py">Main page</a>' 
print "<title>%s</title>" % (pop,)
print "<h1>%s</h1>" % (pop,)

isBundle = pop in MEGA.bundles

if isBundle:
    mid = "bundles"
    print "<h2>Bundle</h2>"
    for p in MEGA.bundles[pop]:
        print web.getPopURL(p) + ", "
else:
    mid = "pops"
    print "<b>Core pop</b>"
    myBundles = []
    for bundle in MEGA.bundles:
        if pop in MEGA.bundles[bundle]:
            myBundles.append(bundle)
    if len(myBundles)>0:
        print "I am in the following bundles: %s" %(", ".join(web.getPopsURLs(myBundles)))


print """
<table border="1">
<tr>
<td valign="top">