File: LinkOut.py

package info (click to toggle)
python-biopython 1.42-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 17,584 kB
  • ctags: 12,272
  • sloc: python: 80,461; xml: 13,834; ansic: 7,902; cpp: 1,855; sql: 1,144; makefile: 203
file content (409 lines) | stat: -rwxr-xr-x 14,500 bytes parent folder | download | duplicates (2)
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
#!/usr/bin/python

# This file generated by a program. do not edit.
import Bio.EUtils.POM

#  $Id: LinkOut.py,v 1.2 2003/06/13 02:08:57 chapmanb Exp $ 
#  LinkOut DTD version 1.1
#            
#      This document is still under revision and may change.
#      
#      Changes:
#      version 1.1:
#      - SubjectType and Attribute lists updated
#      - DTD is XML
#      version 1.6:
#      - <apad> tag added
#      
#      version sequence refreshed to 1.1 on 2001/09/20
#      
#      version 1.2:
#      - SubObjectSelector updated to 
#       
#      <!ELEMENT SubObjectSelector       (Database, SubProvider)>
#      
#      version 1.3:
#      - Entities added:  lo.name, lo.genus, lo.species, lo.subsp
# 
#      version 1.6:
#      - Enitities added: lo.month, lo.authln 
#  
#     
#  Typical usage:
# 
#         <!DOCTYPE LinkSet PUBLIC "-//NLM//DTD LinkOut//EN" "LinkOut.dtd">
#         <LinkSet>
#         ...
#          </LinkSet>
#             
#          or:
# 
#          <!DOCTYPE Provider PUBLIC "-//NLM//DTD LinkOut//EN" "LinkOut.dtd">
#          <Provider>
#          ...
#          </Provider>
# 
#     
# 
# 
#    Rule based URL generation. In general, to build the
#    URL both base and rule are required, where base is the
#    HTTP base address, for example:
# 
#        http://www.sciencemag.org/cgi/content/full/
# 
#    and rule is in the following format:
# 
#        &lo.vol;/&lo.iss;/&lo.page;
# 
#    LinkOut will replace the keywords in rule with the actual 
#    value for a retrieved citation. Therefore, rule will be 
#    translated into: 281/5384/1863
#    
#    The program will concatenate base with rule:
# 
#      http://www.sciencemag.org/cgi/content/full/281/5384/1863
# 
#    The following keywords are supported for any database:
# 
#      lo.id      - Unique identifier (PMID, GI, TaxID, etc.)
# 
#   For PubMed only: 
# 
#      lo.pii     - Publisher Item Identification. Must be submitted 
#      by the publisher. For example, 6847, in the PubMed DTD this 
#      ID is an attribute of the ArticleId element. 
# 
#      lo.doi     - Article DOI 
# 
#      lo.issn    - Journal ISSN code 
# 
#      lo.issnl   - Journal ISSN code without the dash 
# 
#      lo.jtit    - Journal title (MEDLINE abbreviation) 
# 
#      lo.muid    - MEDLINE Unique Identifier 
# 
#      lo.msrc    - MEDLINE source. For example, Exp Brain Res 1998 
#      Oct; 122(3):339-350 
# 
#      lo.vol     - Volume 
# 
#      lo.iss     - Issue 
# 
#      lo.page    - First page 
# 
#      lo.inum    - Item number for online journals. May be a 
#      single letter. 
# 
#      lo.year    - Four digit year.  For example, 1998 
# 
#      lo.yr      - Last two digit of year.  For example, 98; 00 
# 
#      lo.yl      - Last digit of year.  For example, for 1999 use 9;  
#      for 1990 use 0 
# 
#      lo.month  -  The month. For example, September
# 
#      lo.mon     - The 3 letter month abbreviation. For example, Sep 
# 
#      lo.mo      - Two digit month.  For example, 01; 12 
# 
#      lo.day     - Two digit day. For example, 01; 31 
# 
#      lo.otit    - Article title 
# 
#      lo.auth    - First author 
# 
#      lo.authln  - Last name of the first author
# 
# 
#   For Sequence databases (Nucleotide, Protein, Structure, Genome):
# 
#      lo.pacc    - Primary accession for sequences
#      
#   For Taxonomy only:
#   
#      lo.name    - Full scientific name.  For example: "Homo sapiens neanderthalensis"
#      
#      lo.genus   - Genius name.  For example: "Homo"
#      
#      lo.species - Species epithet.  For example: "sapiens"
#      
#      lo.subsp   - Sub-species epithet.  For example: "neanderthalensis"
# 
# 
# 
#  internal DTD entities 
class SubjectType(Bio.EUtils.POM.ElementNode):
	CONTENTMODEL = Bio.EUtils.POM.ContentModel(('', [('#PCDATA', '')], ''))


#  can be one of the following; see LinkOut SubjectTypes and Attributes 
#  at http://www.ncbi.nlm.nih.gov/entrez/linkout/doc/subjecttypes.html for a description 
#  of these elements: 
# 
# //EDUCATION
#         conferences/meetings/workshops
#         glossaries/dictionaries
#         online tutorials/courses
# 
# //FUNDING SOURCES
#         funding sources
# 
# //LITERATURE
#         abstracts/indexes/summaries
#         aggregators
#         books
#         individual online article
#         images
#         libraries
#         patent databases
#         publishers/providers
# 
# //MEDICAL
#         clinical trials
#         consumer health
#         diagnostics
#         disease organizations
#         medical equipment and devices
#         pharmacology
#         treatment guidelines
# 
# //MOLECULAR BIOLOGY DATABASES
#         DNA/protein sequence
#         gene/protein/disease-specific
#         gene expression
#         mapping
#         organism-specific
#         population/variation
#         structure
#         taxonomy/phylogenetic
# 
# //RESEARCH MATERIALS
#         clones/clone libraries
#         culture/stock collections
#         laboratory equipment
#         oligonucleotides
#         other reagents
# 
# //RESEARCHERS
#         colleges/universities
#         companies/research institutes
#         directories
#         individuals
#         societies/associations
# 
# //TOOLS
#         3D structure prediction/functional modeling
#         primer design
#         protein identification/characterization
#         restriction mapping
#         sequence screening/similarity/alignment
#         sequence viewer
#         translation
# 
# 
class Attribute(Bio.EUtils.POM.ElementNode):
	CONTENTMODEL = Bio.EUtils.POM.ContentModel(('', [('#PCDATA', '')], ''))


#  can be one of the following; see LinkOut SubjectTypes and Attributes 
#  at http://www.ncbi.nlm.nih.gov/entrez/linkout/doc/subjecttypes.html for a description 
#  of these elements:
# //BARRIERS
#         registration required
#         subscription/membership/fee required
# 
# //OWNERSHIP
#         author of URL
#         publisher of information in URL
# 
# //PUBLICATIONS
#         document delivery
#         full-text first published
#         full-text online
#         full-text PDF
#         full-text PostScript
#         library-local
#         summary
# 
# 
#  This is the top level element for Provider 
class Provider(Bio.EUtils.POM.ElementNode):
	CONTENTMODEL = Bio.EUtils.POM.ContentModel((u',', [(u'ProviderId', ''), (u'Name', ''), (u'NameAbbr', ''), (u'SubjectType', u'*'), (u'Attribute', u'*'), (u'Url', u'*'), (u'IconUrl', u'*'), (u'Brief', u'?')], ''))


class ProviderId(Bio.EUtils.POM.ElementNode):
	CONTENTMODEL = Bio.EUtils.POM.ContentModel(('', [('#PCDATA', '')], ''))


class Name(Bio.EUtils.POM.ElementNode):
	CONTENTMODEL = Bio.EUtils.POM.ContentModel(('', [('#PCDATA', '')], ''))


class NameAbbr(Bio.EUtils.POM.ElementNode):
	CONTENTMODEL = Bio.EUtils.POM.ContentModel(('', [('#PCDATA', '')], ''))


class Url(Bio.EUtils.POM.ElementNode):
	CONTENTMODEL = Bio.EUtils.POM.ContentModel(('', [('#PCDATA', '')], ''))
	ATTLIST = Bio.EUtils.POM.AttributeList([Bio.EUtils.POM.XMLAttribute('LNG', ['DA', 'DE', 'EN', 'EL', 'ES', 'FR', 'IT', 'IW', 'JA', 'NL', 'NO', 'RU', 'SV', 'ZH'], 13, u'EN')])


class IconUrl(Bio.EUtils.POM.ElementNode):
	CONTENTMODEL = Bio.EUtils.POM.ContentModel(('', [('#PCDATA', '')], ''))
	ATTLIST = Bio.EUtils.POM.AttributeList([Bio.EUtils.POM.XMLAttribute('LNG', ['DA', 'DE', 'EN', 'EL', 'ES', 'FR', 'IT', 'IW', 'JA', 'NL', 'NO', 'RU', 'SV', 'ZH'], 13, u'EN')])


class Brief(Bio.EUtils.POM.ElementNode):
	CONTENTMODEL = Bio.EUtils.POM.ContentModel(('', [('#PCDATA', '')], ''))


#  End of Privider group 
class LinkSet(Bio.EUtils.POM.ElementNode):
	CONTENTMODEL = Bio.EUtils.POM.ContentModel(('', [(u'Link', u'+')], ''))


class Link(Bio.EUtils.POM.ElementNode):
	CONTENTMODEL = Bio.EUtils.POM.ContentModel((u',', [(u'LinkId', ''), (u'ProviderId', ''), (u'IconUrl', u'*'), (u'|', [(u'ObjectSelector', ''), (u'SubObjectSelector', '')], ''), (u'ObjectUrl', u'+')], ''))


class LinkId(Bio.EUtils.POM.ElementNode):
	CONTENTMODEL = Bio.EUtils.POM.ContentModel(('', [('#PCDATA', '')], ''))


class ObjectSelector(Bio.EUtils.POM.ElementNode):
	CONTENTMODEL = Bio.EUtils.POM.ContentModel((u',', [(u'Database', ''), (u'ObjectList', '')], ''))


class Database(Bio.EUtils.POM.ElementNode):
	CONTENTMODEL = Bio.EUtils.POM.ContentModel(('', [('#PCDATA', '')], ''))


#  The databases available in LinkOut include the following: 
# 	PubMed, Nucleotide, Protein, Genome, Structure, PopSet, Taxonomy and OMIM 
class ObjectList(Bio.EUtils.POM.ElementNode):
	CONTENTMODEL = Bio.EUtils.POM.ContentModel((u'|', [(u'Query', ''), (u'ObjId', '')], u'+'))


class Query(Bio.EUtils.POM.ElementNode):
	CONTENTMODEL = Bio.EUtils.POM.ContentModel(('', [('#PCDATA', '')], ''))


class ObjId(Bio.EUtils.POM.ElementNode):
	CONTENTMODEL = Bio.EUtils.POM.ContentModel(('', [('#PCDATA', '')], ''))


#  End of ObjectList group 
#  End of ObjectSelector group 
#  Libraries must use SubObjectSelector to refer to the sub providers 
class SubObjectSelector(Bio.EUtils.POM.ElementNode):
	CONTENTMODEL = Bio.EUtils.POM.ContentModel((u',', [(u'Database', ''), (u'SubProvider', '')], ''))


class SubProvider(Bio.EUtils.POM.ElementNode):
	CONTENTMODEL = Bio.EUtils.POM.ContentModel((u',', [(u'NameAbbr', ''), (u'|', [(u'InclQuery', ''), (u'ExclQuery', '')], u'*')], ''))


class InclQuery(Bio.EUtils.POM.ElementNode):
	CONTENTMODEL = Bio.EUtils.POM.ContentModel(('', [('#PCDATA', '')], ''))


class ExclQuery(Bio.EUtils.POM.ElementNode):
	CONTENTMODEL = Bio.EUtils.POM.ContentModel(('', [('#PCDATA', '')], ''))


#  End of SubObjectSelector group 
class ObjectUrl(Bio.EUtils.POM.ElementNode):
	CONTENTMODEL = Bio.EUtils.POM.ContentModel((u',', [(u'|', [(u',', [(u'Base', ''), (u'|', [(u'Rule', ''), (u'RuleToMany', '')], u'?')], ''), (u'|', [(u'Rule', ''), (u'RuleToMany', '')], '')], ''), (u'UrlName', u'?'), (u'SubjectType', u'*'), (u'Attribute', u'*')], ''))
	ATTLIST = Bio.EUtils.POM.AttributeList([Bio.EUtils.POM.XMLAttribute('LNG', ['DA', 'DE', 'EN', 'EL', 'ES', 'FR', 'IT', 'IW', 'JA', 'NL', 'NO', 'RU', 'SV', 'ZH'], 13, u'EN')])


class Base(Bio.EUtils.POM.ElementNode):
	CONTENTMODEL = Bio.EUtils.POM.ContentModel(('', [('#PCDATA', '')], ''))


class pad(Bio.EUtils.POM.ElementNode):
	CONTENTMODEL = Bio.EUtils.POM.ContentModel(('|', [('#PCDATA', ''), (u'pad', ''), (u'apad', ''), (u'subs', ''), (u'toupper', ''), (u'tolower', ''), (u'strip', ''), (u'normalize', '')], '*'))
	ATTLIST = Bio.EUtils.POM.AttributeList([Bio.EUtils.POM.XMLAttribute('with', 1, 11, None), Bio.EUtils.POM.XMLAttribute('width', 1, 11, None), Bio.EUtils.POM.XMLAttribute('align', ['left', 'right'], 13, u'right')])


#  used to mark up strings that require padding to create fixed-length string
#      attributes. 
#  with      a character to pad with (required)
#      width     result string size (required) (integer)
#      align     the text should align to (left|right) (default:right)
#      
class apad(Bio.EUtils.POM.ElementNode):
	CONTENTMODEL = Bio.EUtils.POM.ContentModel(('|', [('#PCDATA', ''), (u'pad', ''), (u'apad', ''), (u'subs', ''), (u'toupper', ''), (u'tolower', ''), (u'strip', ''), (u'normalize', '')], '*'))
	ATTLIST = Bio.EUtils.POM.AttributeList([Bio.EUtils.POM.XMLAttribute('with', 1, 11, None), Bio.EUtils.POM.XMLAttribute('width', 1, 11, None), Bio.EUtils.POM.XMLAttribute('align', ['left', 'right'], 13, u'right')])


#  used to mark up strings that require padding to create fixed-length string
#      attributes. It skips all preceding alpha characters before padding 
#  with      a character to pad with (required)
#      width     result string size (required) (integer)
#      align     the text should align to (left|right) (default:right)
#      Examples:
#      	<apad with = "0" width = "6">E32</apad>  => "E00032"
#      	<apad with = "0" width = "6">640</apad>  => "000640"
#      
class subs(Bio.EUtils.POM.ElementNode):
	CONTENTMODEL = Bio.EUtils.POM.ContentModel(('|', [('#PCDATA', ''), (u'pad', ''), (u'apad', ''), (u'subs', ''), (u'toupper', ''), (u'tolower', ''), (u'strip', ''), (u'normalize', '')], '*'))
	ATTLIST = Bio.EUtils.POM.AttributeList([Bio.EUtils.POM.XMLAttribute('for', 1, 11, None), Bio.EUtils.POM.XMLAttribute('with', 1, 11, None)])


#  substitute one string for another in the element's content
#      
#  for    the string to replace
#      with   the string to substitute
#      
class toupper(Bio.EUtils.POM.ElementNode):
	CONTENTMODEL = Bio.EUtils.POM.ContentModel(('|', [('#PCDATA', ''), (u'pad', ''), (u'apad', ''), (u'subs', ''), (u'toupper', ''), (u'tolower', ''), (u'strip', ''), (u'normalize', '')], '*'))


#  convert element content into upper case 
class tolower(Bio.EUtils.POM.ElementNode):
	CONTENTMODEL = Bio.EUtils.POM.ContentModel(('|', [('#PCDATA', ''), (u'pad', ''), (u'apad', ''), (u'subs', ''), (u'toupper', ''), (u'tolower', ''), (u'strip', ''), (u'normalize', '')], '*'))


#  convert element content into lower case 
class strip(Bio.EUtils.POM.ElementNode):
	CONTENTMODEL = Bio.EUtils.POM.ContentModel(('|', [('#PCDATA', ''), (u'pad', ''), (u'apad', ''), (u'subs', ''), (u'toupper', ''), (u'tolower', ''), (u'strip', ''), (u'normalize', '')], '*'))
	ATTLIST = Bio.EUtils.POM.AttributeList([Bio.EUtils.POM.XMLAttribute('what', ['spaces', 'letters', 'nondigits', 'digits'], 11, None)])


#  strip off spaces/letters/digits in the element's content
# 	
class normalize(Bio.EUtils.POM.ElementNode):
	CONTENTMODEL = Bio.EUtils.POM.ContentModel(('|', [('#PCDATA', ''), (u'pad', ''), (u'apad', ''), (u'subs', ''), (u'toupper', ''), (u'tolower', ''), (u'strip', ''), (u'normalize', '')], '*'))


#  are used for normalization of &lo.voll , &lo.iss; elements.
# 	Examples:
# 		"Pt 5" 			==> "5"
# 		"3 Suppl"		==> "3"
# 		"2A Pt 3"   		==> "2A"
# 		"10 Suppl 2 Pt 1"   	==> "10"
# 		"2/3"			==> "2/3"
# 	
class Rule(Bio.EUtils.POM.ElementNode):
	CONTENTMODEL = Bio.EUtils.POM.ContentModel(('|', [('#PCDATA', ''), (u'pad', ''), (u'apad', ''), (u'subs', ''), (u'toupper', ''), (u'tolower', ''), (u'strip', ''), (u'normalize', '')], '*'))


class UrlName(Bio.EUtils.POM.ElementNode):
	CONTENTMODEL = Bio.EUtils.POM.ContentModel(('', [('#PCDATA', '')], ''))


class RuleToMany(Bio.EUtils.POM.ElementNode):
	CONTENTMODEL = Bio.EUtils.POM.ContentModel((u',', [(u'Rule', ''), (u'Separator', '')], ''))


class Separator(Bio.EUtils.POM.ElementNode):
	CONTENTMODEL = Bio.EUtils.POM.ContentModel(('', [('#PCDATA', '')], ''))


#  End of ObjectUrl group 
#  End of Link group 
#  End of LinkSet group