localpdb/plugins/utils/MakeMultimer.py
def load_remote_pdb(pdbcode):
    '''
    obtain a pdb file by name from the protein data bank.
    what kinds of plausibility checks to perform?
    - the code should be four characters long
    - be alphanumeric
    '''
    # urltemplate = 'http://dx.doi.org/10.2210/pdb%s/pdb'
    urltemplate = "http://ftp.rcsb.org/download/%s/pdb.gz"
    pdbcode = pdbcode.split('.')[0].lower()
    if len(pdbcode) != 4 or re.findall('\W', pdbcode):
        raise PdbError('malformed pdb code')
    # pdb code looks o.k. - let's try
    url = urltemplate % pdbcode
    request = urllib.urlopen(url)
    binary = request.read()
    pseudo_file = io.StringIO(binary)
    try:
        extracted = gzip.GzipFile('','r',0,pseudo_file).read()
    except IOError:
        raise PdbError('invalid pdb code')
    return extracted

    obtain a pdb file by name from the protein data bank.
    what kinds of plausibility checks to perform?
    - the code should be four characters long
    - be alphanumeric
    
obtain a pdb file by name from the protein data bank.
what kinds of plausibility checks to perform.
the code should be four characters long
be alphanumeric
obtain a pdb file by name from the protein data bank . what kinds of plausibility checks to perform . the code should be four characters long be alphanumeric
def load_remote_pdb(pdbcode):
    urltemplate = "http://ftp.rcsb.org/download/%s/pdb.gz"
    pdbcode = pdbcode.split('.')[0].lower()
    if len(pdbcode) != 4 or re.findall('\W', pdbcode):
        raise PdbError('malformed pdb code')
    url = urltemplate % pdbcode
    request = urllib.urlopen(url)
    binary = request.read()
    pseudo_file = io.StringIO(binary)
    try:
        extracted = gzip.GzipFile('','r',0,pseudo_file).read()
    except IOError:
        raise PdbError('invalid pdb code')
    return extracted
def load_remote_pdb ( pdbcode ) : urltemplate = "http://ftp.rcsb.org/download/%s/pdb.gz" pdbcode = pdbcode . split ( '.' ) [ 0 ] . lower ( ) if len ( pdbcode ) != 4 or re . findall ( '\W' , pdbcode ) : raise PdbError ( 'malformed pdb code' ) url = urltemplate % pdbcode request = urllib . urlopen ( url ) binary = request . read ( ) pseudo_file = io . StringIO ( binary ) try : extracted = gzip . GzipFile ( '' , 'r' , 0 , pseudo_file ) . read ( ) except IOError : raise PdbError ( 'invalid pdb code' ) return extracted
obtain a pdb file by name from the protein data bank.
obtain a pdb file by name from the protein data bank .
'''
    obtain a pdb file by name from the protein data bank.
    what kinds of plausibility checks to perform?
    - the code should be four characters long
    - be alphanumeric
    ''' # urltemplate = 'http://dx.doi.org/10.2210/pdb%s/pdb' # pdb code looks o.k. - let's try
pdbcode