biotite.database.rcsb.fetch¶
- biotite.database.rcsb.fetch(pdb_ids, format, target_path=None, overwrite=False, verbose=False)[source]¶
Download structure files (or sequence files) from the RCSB PDB in various formats.
This function requires an internet connection.
- Parameters
- pdb_idsstr or iterable object of str
A single PDB ID or a list of PDB IDs of the structure(s) to be downloaded.
- format{‘pdb’, ‘pdbx’, ‘cif’, ‘mmcif’, ‘bcif’, ‘mmtf’, ‘fasta’}
The format of the files to be downloaded.
'pdbx'
,'cif'
and'mmcif'
are synonyms for the same format.- target_pathstr, optional
The target directory of the downloaded files. By default, the file content is stored in a file-like object (
StringIO
orBytesIO
, respectively).- overwritebool, optional
If true, existing files will be overwritten. Otherwise the respective file will only be downloaded, if the file does not exist yet in the specified target directory or if the file is empty.
- verbose: bool, optional
If set to true, the function will output the download progress.
- Returns
- filesstr or StringIO or BytesIO or list of (str or StringIO or BytesIO)
The file path(s) to the downloaded files. If a single PDB ID was given in pdb_ids, a single string is returned. If a list (or other iterable object) was given, a list of strings is returned. If no target_path was given, the file contents are stored in either
StringIO
orBytesIO
objects.
Warning
Even if you give valid input to this function, in rare cases the database might return no or malformed data to you. In these cases the request should be retried. When the issue occurs repeatedly, the error is probably in your input.
Examples
>>> import os.path >>> file = fetch("1l2y", "cif", path_to_directory) >>> print(os.path.basename(file)) 1l2y.cif >>> files = fetch(["1l2y", "3o5r"], "cif", path_to_directory) >>> print([os.path.basename(file) for file in files]) ['1l2y.cif', '3o5r.cif']
Gallery¶
Mutual information as measure for coevolution of residues
Construction of an adjacency matrix
Plotting the base pairs of a tRNA-like-structure
Biological assembly of a structure
Contact sites of protein-DNA interaction
Calculation of protein diameter
Docking biotin to streptavidin
Hydrogen bonds between protein domains
Missing residues in protein structures of DNA-PKcs
Visualization of glycosylated amino acids
Superimposition of two protein structures
Visualization of normal modes from an elastic network model
Structural alignment of lysozyme variants using ‘Protein Blocks’
Ramachandran plot of dynein motor domain
Determination of amino acid enantiomers
Comparison of a tRNA-like-structure with a tRNA
Three ways to get the secondary structure of a protein
Visualization of Watson-Crick base pairs