Package Bio :: Package dbdefs :: Module pdb
[hide private]
[frames] | no frames]

Source Code for Module Bio.dbdefs.pdb

 1  # Copyright 2002 by Jeffrey Chang.  All rights reserved. 
 2  # This code is part of the Biopython distribution and governed by its 
 3  # license.  Please see the LICENSE file that should have been included 
 4  # as part of this package. 
 5   
 6  from Bio.config.DBRegistry import CGIDB, DBGroup 
 7  from _support import * 
 8   
 9  from Martel import * 
10   
11  not_header_expr = AssertNot(Str("HEADER")) 
12  pdb_rcsb_cgi = CGIDB( 
13      name="pdb-rcsb-cgi", 
14      cgi="http://www.rcsb.org/pdb/cgi/export.cgi", 
15      url="XXX PLEASE FILL THIS IN XXX", 
16      delay=5.0, 
17      params=[("format", "PDB"), 
18              ("compression", "None") 
19              ], 
20      key="pdbId", 
21      # failure cases for file not found are making retrieval freeze up  
22      # while Martel checks for them, for some reason I can't figure 
23      # so we go with checking to make sure results look like PDB 
24      # failure_cases=[(has_str("File not found"), "ID does not exist")], 
25      failure_cases=[(not_header_expr, "results do not look like PDB format")] 
26      ) 
27   
28  pdb_ebi_cgi = CGIDB( 
29      name="pdb-ebi-cgi", 
30      cgi="http://www.ebi.ac.uk/cgi-bin/dbfetch", 
31      url="http://www.ebi.ac.uk/cgi-bin/dbfetch", 
32      delay=5.0, 
33      params=[("db", "PDB"), 
34              ("format", "default"),   # also Fasta, bsml, agave available 
35              ("style", "raw"), 
36              ], 
37      key="id", 
38      failure_cases=[(not_header_expr, "results do not look like PDB format")] 
39      ) 
40   
41  pdb = DBGroup( 
42      name="pdb", 
43      behavior="serial" 
44      ) 
45  pdb.add(pdb_rcsb_cgi) 
46  pdb.add(pdb_ebi_cgi) 
47