OpenStructure
Public Member Functions | Data Fields
RemoteRepository Class Reference

Public Member Functions

def __init__ (self, name, url_pattern, type, id_transform='upper')
 
def URLForID (self, id)
 
def Get (self, id)
 
def Load (self, id)
 

Data Fields

 name
 
 url_pattern
 
 type
 
 id_transform
 

Detailed Description

A remote repository represents a structural database accessible through the 
internet, e.g. the PDB or SWISS-MODEL template library.

:param name:        Name of the repository
:param url_pattern: URL pattern for repository. Required format is described
                    in :func:`URLForID`
:param type:        Data format to expect at resolved URL must be in 
                    ('pdb', 'cif')
:param id_transform: Transformation to apply to ID before resolving URL
                     in :func:`URLForID`. Must be in ('lower', 'upper')

:type name:         :class:`str`
:type url_pattern:  :class:`str`
:type type:         :class:`str`
:type id_transform: :class:`str`

Definition at line 25 of file remote.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  name,
  url_pattern,
  type,
  id_transform = 'upper' 
)

Definition at line 43 of file remote.py.

Member Function Documentation

◆ Get()

def Get (   self,
  id 
)
Resolves URL with :func:`URLForID`, dumps the content in a temporary file 
and returns its path.

:param id:          ID to resolve
:type id:           :class:`str`

Definition at line 67 of file remote.py.

◆ Load()

def Load (   self,
  id 
)
Resolves URL with :func:`URLForID` and directly loads/returns the according 
:class:`ost.mol.EntityHandle`. Loading invokes the 
:func:`ost.io.LoadPDB`/:func:`ost.io.LoadMMCIF` with default parameterization. If you need
custom settings, you might want to consider to call :func:`Get` and do the
loading manually.

:param id:          ID to resolve
:type id:           :class:`str`

Definition at line 96 of file remote.py.

◆ URLForID()

def URLForID (   self,
  id 
)
Resolves URL given *url_pattern* and *id_transform* provided at object 
initialization.
The *url_pattern* must contain substring '$ID'. Given *id*, the URL to 
the structure gets constructed by applying *id_transform* and inserting it
at the location of '$ID'. e.g. 'https://files.rcsb.org/view/$ID.pdb' given 
1ake as *id* and 'upper' as *id_transform* resolves to:
'https://files.rcsb.org/view/1AKE.pdb'

Definition at line 51 of file remote.py.

Field Documentation

◆ id_transform

id_transform

Definition at line 49 of file remote.py.

◆ name

name

Definition at line 44 of file remote.py.

◆ type

type

Definition at line 46 of file remote.py.

◆ url_pattern

url_pattern

Definition at line 45 of file remote.py.


The documentation for this class was generated from the following file: