1
2
3
4
5
6 """
7 This module provides code to access resources at ExPASy over the WWW.
8 http://www.expasy.ch/
9
10
11 Functions:
12 get_prodoc_entry Interface to the get-prodoc-entry CGI script.
13 get_prosite_entry Interface to the get-prosite-entry CGI script.
14 get_prosite_raw Interface to the get-prosite-raw CGI script.
15 get_sprot_raw Interface to the get-sprot-raw CGI script.
16 sprot_search_ful Interface to the sprot-search-ful CGI script.
17 sprot_search_de Interface to the sprot-search-de CGI script.
18
19 The function scanprosite1 is OBSOLETE; please see the
20 Bio.ExPASy.ScanProsite module for this functionality.
21 """
22
23 import urllib
24
25
26 -def get_prodoc_entry(id, cgi='http://www.expasy.ch/cgi-bin/get-prodoc-entry'):
27 """get_prodoc_entry(id,
28 cgi='http://www.expasy.ch/cgi-bin/get-prodoc-entry') -> handle
29
30 Get a handle to a PRODOC entry at ExPASy in HTML format.
31
32 For a non-existing key XXX, ExPASy returns an HTML-formatted page
33 containing this line:
34 'There is no PROSITE documentation entry XXX. Please try again.'
35 """
36
37 handle = urllib.urlopen("%s?%s" % (cgi, id))
38 return handle
39
40 -def get_prosite_entry(id,
41 cgi='http://www.expasy.ch/cgi-bin/get-prosite-entry'):
42 """get_prosite_entry(id,
43 cgi='http://www.expasy.ch/cgi-bin/get-prosite-entry') -> handle
44
45 Get a handle to a PROSITE entry at ExPASy in HTML format.
46
47 For a non-existing key XXX, ExPASy returns an HTML-formatted page
48 containing this line:
49 'There is currently no PROSITE entry for XXX. Please try again.'
50 """
51 handle = urllib.urlopen("%s?%s" % (cgi, id))
52 return handle
53
54 -def get_prosite_raw(id, cgi='http://www.expasy.ch/cgi-bin/get-prosite-raw.pl'):
55 """get_prosite_raw(id,
56 cgi='http://www.expasy.ch/cgi-bin/get-prosite-raw.pl')
57 -> handle
58
59 Get a handle to a raw PROSITE or PRODOC entry at ExPASy.
60
61 For a non-existing key, ExPASy returns nothing.
62 """
63 handle = urllib.urlopen("%s?%s" % (cgi, id))
64 return handle
65
66 -def get_sprot_raw(id, cgi='http://www.expasy.ch/cgi-bin/get-sprot-raw.pl'):
67 """get_sprot_raw(id, cgi='http://www.expasy.ch/cgi-bin/get-sprot-raw.pl')
68 -> handle
69
70 Get a handle to a raw SwissProt entry at ExPASy.
71
72 For a non-existing key XXX, ExPASy returns an HTML-formatted page
73 containing this line:
74 'XXX is not a valid identifier.'
75 """
76 handle = urllib.urlopen("%s?%s" % (cgi, id))
77 return handle
78
79 -def sprot_search_ful(text, make_wild=None, swissprot=1, trembl=None,
80 cgi='http://www.expasy.ch/cgi-bin/sprot-search-ful'):
81 """sprot_search_ful(text, make_wild=None, swissprot=1, trembl=None,
82 cgi='http://www.expasy.ch/cgi-bin/sprot-search-ful') -> handle
83
84 Search SwissProt by full text.
85
86 """
87 variables = {'SEARCH' : text}
88 if make_wild:
89 variables['makeWild'] = 'on'
90 if swissprot:
91 variables['S'] = 'on'
92 if trembl:
93 variables['T'] = 'on'
94 options = urllib.urlencode(variables)
95 fullcgi = "%s?%s" % (cgi, options)
96 handle = urllib.urlopen(fullcgi)
97 return handle
98
99 -def sprot_search_de(text, swissprot=1, trembl=None,
100 cgi='http://www.expasy.ch/cgi-bin/sprot-search-de'):
101 """sprot_search_de(text, swissprot=1, trembl=None,
102 cgi='http://www.expasy.ch/cgi-bin/sprot-search-de') -> handle
103
104 Search SwissProt by name, description, gene name, species, or
105 organelle.
106
107 """
108 variables = {'SEARCH' : text}
109 if swissprot:
110 variables['S'] = 'on'
111 if trembl:
112 variables['T'] = 'on'
113 options = urllib.urlencode(variables)
114 fullcgi = "%s?%s" % (cgi, options)
115 handle = urllib.urlopen(fullcgi)
116 return handle
117
118 -def scanprosite1(seq=None, id=None, exclude_frequent=None,
119 cgi='http://www.expasy.org/cgi-bin/scanprosite/scanprosite?1'):
120 """scanprosite1(seq=None, id=None, exclude_frequent=None,
121 cgi='http://www.expasy.org/cgi-bin/scanprosite/scanprosite?1') -> handle
122
123 Scan a sequence for a Prosite pattern. Either a sequence or a SwissProt/
124 trEMBL sequence can be passed. exclude_frequent specifies whether to
125 exclude patterns with high probability.
126
127 """
128 import warnings
129 warnings.warn("Bio.ExPASy.scanprosite1() has been deprecated, and we" \
130 +" intend to remove it in a future release of Biopython."\
131 +" Please use the Bio.ExPASy.ScanProsite module instead,"\
132 +" as described in the Tutorial.",
133 DeprecationWarning)
134 variables = {}
135 if seq:
136 variables['SEQ'] = seq
137 if id:
138 variables['ID'] = id
139 if exclude_frequent:
140 variables['box'] = 'ok'
141 options = urllib.urlencode(variables)
142 handle = urllib.urlopen(cgi, options)
143 return handle
144