Example #1
0
    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]
    print "<tr><td>%s</td><td>%s</td></tr>" % (
        web.getPopURL(bundle), ", ".join(web.getPopsURLs(pops)))
print "</table>"

print "<h2>Populations</h2>"

pops = MEGA.pops
print '<table border="1">'
curr = 0
print "<tr>"
for pop in pops:
    print "<td>%s</td>" % (pop, )
    if curr % 6 == 0:
        print "</tr><tr>"
    curr += 1
print "</tr>"
print "</table>"
Example #2
0
    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]
    print "<tr><td>%s</td><td>%s</td></tr>" % (web.getPopURL(bundle), ", ".join(web.getPopsURLs(pops)))
print "</table>"



print "<h2>Populations</h2>"

pops = MEGA.pops
print '<table border="1">'
curr=0
print "<tr>"
for pop in pops:
    print "<td>%s</td>" %(pop,)
    if curr % 6 == 0:
        print "</tr><tr>"
    curr += 1
Example #3
0
import MEGA
from MEGA import karyo, web

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


print("""<h1>Studies</h1>

<table border="1">
""")

for studyName in MEGA.studies:
    study = MEGA.studies[studyName]
    study.configStudy()
    def getHash(popStudy):
        return MEGA.getHash(study.pops.getIndivs(popStudy))
    inURLs = web.getPopsURLs(study.pops.pops, karyo.karyotype,
                             [getHash(x) for x in study.pops.pops])
    print("""
<tr><td colspan="2" align="center"><b>Study: </b>%s</td></tr>
<tr><td colspan="2">%s</td></tr>
<tr><td colspan="2">%s</td></tr>
<tr><td>%s</td></tr>
""" % (web.getStudyURL(studyName), study.desc,
study.summary,
", ".join(inURLs)))
print("</table>")



Example #4
0
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">
"""
print "<h2>Basic info</h2>"
if isBundle:
    try:
        f = open("%s/%s/%s/basic" %(MEGA.cacheDB, mid, pop))
        print "<table border=1><tr><td><b>total</b></td><td>%s</td></tr><tr>" % (f.readline(),)
        for l in f:
            print "<tr><td>"
            print "</td><td>".join(l.split("\t"))