-
Notifications
You must be signed in to change notification settings - Fork 66
/
Copy pathStats2Html.py
135 lines (103 loc) · 4.47 KB
/
Stats2Html.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
################################################################################
#
# MRC FGU Computational Genomics Group
#
# $Id$
#
# Copyright (C) 2009 Andreas Heger
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#################################################################################
'''
Stats2Html.py -
======================================================
:Author: Andreas Heger
:Release: $Id$
:Date: |today|
:Tags: Python
Code
----
'''
from Pairsdb import *
import sys
import os
import string
import HTMLgen
import re
from Table_nrdb import Table_nrdb
import Selects_1
from RSDB2HTML import RSDB2HTML
PICASSO_URL = "http://jura.ebi.ac.uk:8801/PairsDB"
def Build_report_sequence ( nid ):
return "<A HREF='%s/report_sequence?nid=%s' target='_blank'>%s</A>" % (PICASSO_URL, nid, nid )
def Build_scop ( scop_id ):
domain_id = scop_id + "_" * (6 - len(scop_id))
return "<A HREF='http://scop.mrc-lmb.cam.ac.uk/scop/search.cgi?sid=d%s' target='_blank'>%s</A>" % (domain_id, scop_id )
def Build_join( nid1, nid2 ):
return "<A HREF='%s/report_join?nid1=%s&type1=g&nid2=%s&type2=g&gop=-4&gep=-0.4&skip=0&SUBMIT=Submit+Query' target='_blank'>*</A>" % (PICASSO_URL, nid1, nid2)
def Build_join2way( nid1, nid2 ):
return "<A HREF='%s/report_join?nid1=%s&type1=g&nid2=%s&type2=g&gop=-4&gep=-0.4&skip=1&min_score=10.0&method=0&SUBMIT=Submit+Query' target='_blank'>1->2</A>;" % (PICASSO_URL, nid1, nid2) +\
"<A HREF='%s/report_join?nid1=%s&type1=g&nid2=%s&type2=g&gop=-4&gep=-0.4&skip=1&min_score=10.0&method=0&SUBMIT=Submit+Query' target='_blank'>2->1</A>" % (PICASSO_URL, nid2, nid1)
class RSDB2HTML_mergers_false( RSDB2HTML):
def __init__( self ):
RSDB2HTML.__init__( self )
self.mTitle = "mergers_false"
self.mCaption = "mergers_false"
def ParseHeader(self, line ):
self.mHeading = ["Align"] + string.split( line[:-1], "\t")
def ParseColumns( self, columns ):
return [Build_join2way( columns[1], columns[10]),
columns[0], Build_report_sequence(columns[1])] +\
columns[2:7] +\
[ Build_scop( columns[7] ) ] +\
columns[8:10] +\
[ Build_report_sequence(columns[10])] +\
columns[11:16] +\
[ Build_scop( columns[16] ) ] +\
columns[17:]
class RSDB2HTML_mergers_true( RSDB2HTML):
def __init__( self ):
RSDB2HTML.__init__( self )
self.mTitle = "mergers_true"
self.mCaption = "mergers_true"
def ParseHeader(self, line ):
self.mHeading = ["Align"] + string.split( line[:-1], "\t")
def ParseColumns( self, columns ):
return [Build_join2way( columns[1], columns[10]),
columns[0], Build_report_sequence(columns[1])] +\
columns[2:7] +\
[ Build_scop( columns[7] ) ] +\
columns[8:10] +\
[ Build_report_sequence(columns[10])] +\
columns[11:16] +\
[ Build_scop( columns[16] ) ] +\
columns[17:]
class RSDB2HTML_non_mergers_false( RSDB2HTML):
def __init__( self ):
RSDB2HTML.__init__( self )
self.mTitle = "non_mergers_false"
self.mCaption = "non_mergers_false"
def ParseHeader(self, line ):
self.mHeading = ["Align"] + string.split( line[:-1], "\t")
def ParseColumns( self, columns ):
return [Build_join2way( columns[1], columns[10]),
columns[0], Build_report_sequence(columns[1])] +\
columns[2:7] +\
[ Build_scop( columns[7] ) ] +\
columns[8:10] +\
[ Build_report_sequence(columns[10])] +\
columns[11:16] +\
[ Build_scop( columns[16] ) ] +\
columns[17:]