Пример #1
0
  def __call__(self):

    from iotbx.pdb import download
    return download.openurl(
      url = "%s/%s" % ( self.job_folder, self.OUTPUTFILE ),
      storage = download.no_storage,
      )
Пример #2
0
def get_request(url, identifier):

  lcase = identifier.lower()

  stream = openurl( url = ( url + lcase ).encode() )
  result_for = json.load( stream )
  assert lcase in result_for
  return result_for[ lcase ]
Пример #3
0
  def multiple(self, identifiers):

    for ident in identifiers:
      try:
        stream = openurl(
          url = ( self.url + self.namer( identifier = ident ) ).encode(),
          )

      except NotFound:
        yield None

      else:
        yield stream
Пример #4
0
def post_request(url, identifiers):

  if len( identifiers ) == 0:
    return ( i for i in () )

  try:
    stream = openurl( url = url, data = ( ",".join( identifiers ) ).encode() )

  except NotFound:
    return ( None for i in identifiers )

  result_for = json.load( stream )

  return ( result_for.get( ident.lower() ) for ident in identifiers )
Пример #5
0
    def __init__(self):

        stream = openurl(
            url="ftp://ftp.wwpdb.org/pub/pdb/data/status/obsolete.dat", )

        chain_redirection_for = parse_pdb_redirections(lineiter=stream)

        self.redirection_for = {}

        for key in chain_redirection_for:
            self.redirection_for[key] = end_of_chain(
                identifier=key,
                replacement_for=chain_redirection_for,
            )
Пример #6
0
  def __init__(self):

    stream = openurl(
      url = "ftp://ftp.wwpdb.org/pub/pdb/data/status/obsolete.dat",
      )

    chain_redirection_for = parse_pdb_redirections( lineiter = stream )

    self.redirection_for = {}

    for key in chain_redirection_for:
      self.redirection_for[ key ] = end_of_chain(
        identifier = key,
        replacement_for = chain_redirection_for,
        )
Пример #7
0
    def __init__(self, pdbstr, name):

        from iotbx.pdb import download
        import urllib

        data_for = {
            "pdb": pdbstr,
            "bfactorPDB": "Yes",
            "name": name,
            "nomail": "Yes",
            "do": "Submit",
        }

        stream = download.openurl(
            url=self.SERVERURL,
            data=urllib.urlencode(data_for.items()),
        )
        self.job_folder = parse_submission_page(stream=stream)
        stream.close()
Пример #8
0
  def __init__(self, pdbstr, name):

    from iotbx.pdb import download
    import urllib

    data_for = {
      "pdb": pdbstr,
      "bfactorPDB": "Yes",
      "name": name,
      "nomail": "Yes",
      "do": "Submit",
      }

    stream = download.openurl(
      url = self.SERVERURL,
      data = urllib.urlencode( data_for.items() ),
      )
    self.job_folder = parse_submission_page( stream = stream )
    stream.close()
Пример #9
0
  def __init__(self, pdbstr, name):

    from iotbx.pdb import download
    import urllib

    data_for = {
      "pdb": pdbstr,
      "bfactorPDB": "Yes",
      "name": name,
      "email": "*****@*****.**",
      "do": "Submit",
      }

    stream = download.openurl(
      url = self.SERVERURL,
      data = urllib.urlencode( data_for.items() ),
      encodings = [],
      storage = download.no_storage,
      )
    self.job_folder = parse_submission_page( stream = stream )
Пример #10
0
    def __call__(self):

        from iotbx.pdb import download
        return download.openurl(url="%s/%s" %
                                (self.job_folder, self.OUTPUTFILE), )
Пример #11
0
  def single(self, identifier):

    stream = openurl(
      url = ( self.url + self.namer( identifier = identifier ) ).encode(),
      )
    return stream