_id stringlengths 2 7 | title stringlengths 1 88 | partition stringclasses 3
values | text stringlengths 31 13.1k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q245500 | SeqProp.get_residue_annotations | train | def get_residue_annotations(self, start_resnum, end_resnum=None):
"""Retrieve letter annotations for a residue or a range of residues
Args:
start_resnum (int): Residue number
end_resnum (int): Optional residue number, specify if a range | python | {
"resource": ""
} |
q245501 | SeqProp.get_aggregation_propensity | train | def get_aggregation_propensity(self, email, password, cutoff_v=5, cutoff_n=5, run_amylmuts=False, outdir=None):
"""Run the AMYLPRED2 web server to calculate the aggregation propensity of this protein sequence, which is
the number of aggregation-prone segments on the unfolded protein sequence.
S... | python | {
"resource": ""
} |
q245502 | SeqProp.get_thermostability | train | def get_thermostability(self, at_temp):
"""Run the thermostability calculator using either the Dill or Oobatake methods.
Stores calculated (dG, Keq) tuple in the ``annotations`` attribute, under the key
`thermostability_<TEMP>-<METHOD_USED>`.
| python | {
"resource": ""
} |
q245503 | SeqProp.store_iupred_disorder_predictions | train | def store_iupred_disorder_predictions(seqprop, iupred_path,
iupred_exec, prediction_type, force_rerun=False):
"""Scores above 0.5 indicate disorder"""
os.environ['IUPred_PATH'] = iupred_path
stored_key = 'disorder-{}-iupred'.format(prediction_type)
... | python | {
"resource": ""
} |
q245504 | SCRATCH.run_scratch | train | def run_scratch(self, path_to_scratch, num_cores=1, outname=None, outdir=None, force_rerun=False):
"""Run SCRATCH on the sequence_file that was loaded into the class.
Args:
path_to_scratch: Path to the SCRATCH executable, run_SCRATCH-1D_predictors.sh
outname: Prefix to name the ... | python | {
"resource": ""
} |
q245505 | SCRATCH.sspro_results | train | def sspro_results(self):
"""Parse the SSpro output file and return a dict of secondary structure compositions.
Returns:
dict: Keys are sequence IDs, values are the lists of secondary structure predictions.
H: helix
| python | {
"resource": ""
} |
q245506 | SCRATCH.sspro_summary | train | def sspro_summary(self):
"""Parse the SSpro output file and return a summary of secondary structure composition.
The output file is just a FASTA formatted file, so you can get residue level
information by parsing it like a normal sequence file.
Returns:
dict: Percentage... | python | {
"resource": ""
} |
q245507 | SCRATCH.sspro8_results | train | def sspro8_results(self):
"""Parse the SSpro8 output file and return a dict of secondary structure compositions.
"""
| python | {
"resource": ""
} |
q245508 | SCRATCH.sspro8_summary | train | def sspro8_summary(self):
"""Parse the SSpro8 output file and return a summary of secondary structure composition.
The output file is just a FASTA formatted file, so you can get residue level
information by parsing it like a normal sequence file.
Returns:
dict: Percenta... | python | {
"resource": ""
} |
q245509 | SCRATCH.accpro_results | train | def accpro_results(self):
"""Parse the ACCpro output file and return a dict of secondary structure compositions.
"""
| python | {
"resource": ""
} |
q245510 | model_loader | train | def model_loader(gem_file_path, gem_file_type):
"""Consolidated function to load a GEM using COBRApy. Specify the file type being loaded.
Args:
gem_file_path (str): Path to model file
gem_file_type (str): GEM model type - ``sbml`` (or ``xml``), ``mat``, or ``json`` format
Returns:
... | python | {
"resource": ""
} |
q245511 | filter_out_spontaneous_genes | train | def filter_out_spontaneous_genes(genes, custom_spont_id=None):
"""Return the DictList of genes that are not spontaneous in a model.
Args:
genes (DictList): Genes DictList
custom_spont_id (str): Optional custom spontaneous ID if it does not match the regular expression ``[Ss](_|)0001``
Retu... | python | {
"resource": ""
} |
q245512 | true_num_genes | train | def true_num_genes(model, custom_spont_id=None):
"""Return the number of genes in a model ignoring spontaneously labeled genes.
Args:
model (Model):
custom_spont_id (str): Optional custom spontaneous ID if it does not match the regular expression ``[Ss](_|)0001``
Returns:
int: Numb... | python | {
"resource": ""
} |
q245513 | true_num_reactions | train | def true_num_reactions(model, custom_spont_id=None):
"""Return the number of reactions associated with a gene.
Args:
model (Model):
custom_spont_id (str): Optional custom spontaneous ID if it does not match the regular expression ``[Ss](_|)0001``
| python | {
"resource": ""
} |
q245514 | WHATIF._smcra_to_str | train | def _smcra_to_str(self, smcra, temp_dir='/tmp/'):
"""
WHATIF's input are PDB format files.
Converts a SMCRA object to a PDB formatted string.
"""
temp_path = tempfile.mktemp( '.pdb', dir=temp_dir )
io = PDBIO()
io.set_structure(smcra)
| python | {
"resource": ""
} |
q245515 | WHATIF.is_alive | train | def is_alive(self):
"""
Test Function to check WHAT IF servers are up and running.
"""
u = urllib.urlopen("http://wiws.cmbi.ru.nl/rest/TestEmpty/id/1crn/")
x | python | {
"resource": ""
} |
q245516 | WHATIF.PDBasXMLwithSymwithPolarH | train | def PDBasXMLwithSymwithPolarH(self, id):
"""
Adds Hydrogen Atoms to a Structure.
"""
print _WARNING
# Protonated Structure in XML Format
h_s_xml = urllib.urlopen("http://www.cmbi.ru.nl/wiwsd/rest/PDBasXMLwithSymwithPolarH/id/" + id)
| python | {
"resource": ""
} |
q245517 | get_pdbs_for_gene | train | def get_pdbs_for_gene(bigg_model, bigg_gene, cache_dir=tempfile.gettempdir(), force_rerun=False):
"""Attempt to get a rank-ordered list of available PDB structures for a BiGG Model and its gene.
Args:
bigg_model: BiGG Model ID
bigg_gene: BiGG Gene ID
Returns:
list: rank-ordered lis... | python | {
"resource": ""
} |
q245518 | get_dssp_df_on_file | train | def get_dssp_df_on_file(pdb_file, outfile=None, outdir=None, outext='_dssp.df', force_rerun=False):
"""Run DSSP directly on a structure file with the Biopython method Bio.PDB.DSSP.dssp_dict_from_pdb_file
Avoids errors like: PDBException: Structure/DSSP mismatch at <Residue MSE het= resseq=19 icode= >
by n... | python | {
"resource": ""
} |
q245519 | secondary_structure_summary | train | def secondary_structure_summary(dssp_df):
"""Summarize the secondary structure content of the DSSP dataframe for each chain.
Args:
dssp_df: Pandas DataFrame of parsed DSSP results
Returns:
dict: Chain to secondary structure summary dictionary
"""
chains = dssp_df.chain.unique()
... | python | {
"resource": ""
} |
q245520 | calc_surface_buried | train | def calc_surface_buried(dssp_df):
'''Calculates the percent of residues that are in the surface or buried,
as well as if they are polar or nonpolar. Returns a dictionary of this.
'''
SN = 0
BN = 0
SP = 0
SNP = 0
SPo = 0
SNe = 0
BNP = 0
BP = 0
BPo = 0
BNe = 0
Total... | python | {
"resource": ""
} |
q245521 | calc_sasa | train | def calc_sasa(dssp_df):
"""
Calculation of SASA utilizing the DSSP program.
DSSP must be installed for biopython to properly call it.
Install using apt-get on Ubuntu
or from: http://swift.cmbi.ru.nl/gv/dssp/
| python | {
"resource": ""
} |
q245522 | get_ss_class | train | def get_ss_class(pdb_file, dssp_file, chain):
"""Define the secondary structure class of a PDB file at the specific chain
Args:
pdb_file:
dssp_file:
chain:
Returns:
"""
prag = pr.parsePDB(pdb_file)
pr.parseDSSP(dssp_file, prag)
alpha, threeTen, beta = get_dssp_ss_c... | python | {
"resource": ""
} |
q245523 | parse_uniprot_xml_metadata | train | def parse_uniprot_xml_metadata(sr):
"""Load relevant attributes and dbxrefs from a parsed UniProt XML file in a SeqRecord.
Returns:
dict: All parsed information
"""
# TODO: What about "reviewed" status? and EC number
xref_dbs_to_keep = ['GO', 'KEGG', 'PDB', 'PROSITE', 'Pfam', 'RefSeq']
... | python | {
"resource": ""
} |
q245524 | is_valid_uniprot_id | train | def is_valid_uniprot_id(instring):
"""Check if a string is a valid UniProt ID.
See regex from: http://www.uniprot.org/help/accession_numbers
Args:
instring: any string identifier
Returns: True if the string is a valid UniProt ID
| python | {
"resource": ""
} |
q245525 | uniprot_reviewed_checker | train | def uniprot_reviewed_checker(uniprot_id):
"""Check if a single UniProt ID is reviewed or not.
Args:
uniprot_id:
Returns:
bool: If the entry is reviewed
"""
query_string = 'id:' + uniprot_id
uni_rev_raw = StringIO(bsup.search(query_string, columns='id,reviewed', frmt='tab'))
| python | {
"resource": ""
} |
q245526 | uniprot_reviewed_checker_batch | train | def uniprot_reviewed_checker_batch(uniprot_ids):
"""Batch check if uniprot IDs are reviewed or not
Args:
uniprot_ids: UniProt ID or list of UniProt IDs
Returns:
A dictionary of {UniProtID: Boolean}
"""
uniprot_ids = ssbio.utils.force_list(uniprot_ids)
invalid_ids = [i for i i... | python | {
"resource": ""
} |
q245527 | uniprot_ec | train | def uniprot_ec(uniprot_id):
"""Retrieve the EC number annotation for a UniProt ID.
Args:
uniprot_id: Valid UniProt ID
Returns:
"""
| python | {
"resource": ""
} |
q245528 | uniprot_sites | train | def uniprot_sites(uniprot_id):
"""Retrieve a list of UniProt sites parsed from the feature file
Sites are defined here: http://www.uniprot.org/help/site and here: http://www.uniprot.org/help/function_section
Args:
uniprot_id: Valid UniProt ID
Returns:
"""
r = requests.post('http://w... | python | {
"resource": ""
} |
q245529 | parse_uniprot_txt_file | train | def parse_uniprot_txt_file(infile):
"""Parse a raw UniProt metadata file and return a dictionary.
Args:
infile: Path to metadata file
Returns:
dict: Metadata dictionary
"""
uniprot_metadata_dict = {}
metadata = old_parse_uniprot_txt_file(infile)
metadata_keys = list(metad... | python | {
"resource": ""
} |
q245530 | UniProtProp.metadata_path_unset | train | def metadata_path_unset(self):
"""Copy features to memory and remove the association of the metadata file."""
if not self.metadata_file:
raise IOError('No metadata file to unset')
log.debug('{}: reading from metadata file {}'.format(self.id, self.metadata_path))
tmp_sr = Seq... | python | {
"resource": ""
} |
q245531 | UniProtProp.download_seq_file | train | def download_seq_file(self, outdir, force_rerun=False):
"""Download and load the UniProt FASTA file"""
uniprot_fasta_file = download_uniprot_file(uniprot_id=self.id,
filetype='fasta',
| python | {
"resource": ""
} |
q245532 | UniProtProp.download_metadata_file | train | def download_metadata_file(self, outdir, force_rerun=False):
"""Download and load the UniProt XML file"""
uniprot_xml_file = download_uniprot_file(uniprot_id=self.id,
outdir=outdir,
| python | {
"resource": ""
} |
q245533 | Object.save_dataframes | train | def save_dataframes(self, outdir, prefix='df_'):
"""Save all attributes that start with "df" into a specified directory.
Args:
outdir (str): Path to output directory
prefix (str): Prefix that dataframe attributes start with
"""
# Get list of attributes that star... | python | {
"resource": ""
} |
q245534 | Hydrogenate_Protein._build_bonding_network | train | def _build_bonding_network(self):
"""
Evaluates atoms per residue for missing and known bonded partners.
Based on bond_amber.
A better alternative would be to iterate over the entire list of residues and
use NeighborSearch to probe neighbors for atom X in residue i, i-1 and i+1... | python | {
"resource": ""
} |
q245535 | Hydrogenate_Protein._exclude_ss_bonded_cysteines | train | def _exclude_ss_bonded_cysteines(self):
"""
Pre-compute ss bonds to discard cystines for H-adding.
"""
ss_bonds = self.nh_structure.search_ss_bonds()
for cys_pair in ss_bonds:
| python | {
"resource": ""
} |
q245536 | Hydrogenate_Protein._find_secondary_anchors | train | def _find_secondary_anchors(self, residue, heavy_atom, anchor):
"""
Searches through the bond network for atoms bound to the anchor.
Returns a secondary and tertiary anchors.
Example, for CA, returns C and O.
| python | {
"resource": ""
} |
q245537 | parse_results_mol2 | train | def parse_results_mol2(mol2_outpath):
"""Parse a DOCK6 mol2 output file, return a Pandas DataFrame of the results.
Args:
mol2_outpath (str): Path to mol2 output file
Returns:
DataFrame: Pandas DataFrame of the results
"""
docked_ligands = pd.DataFrame()
lines = [line.strip() ... | python | {
"resource": ""
} |
q245538 | DOCK.structure_path | train | def structure_path(self, path):
"""Provide pointers to the paths of the structure file
Args:
path: Path to structure file
"""
if not path:
self.structure_dir = None
self.structure_file = None
| python | {
"resource": ""
} |
q245539 | DOCK.dockprep | train | def dockprep(self, force_rerun=False):
"""Prepare a PDB file for docking by first converting it to mol2 format.
Args:
force_rerun (bool): If method should be rerun even if output file exists
"""
log.debug('{}: running dock preparation...'.format(self.id))
prep_mol2... | python | {
"resource": ""
} |
q245540 | DOCK.protein_only_and_noH | train | def protein_only_and_noH(self, keep_ligands=None, force_rerun=False):
"""Isolate the receptor by stripping everything except protein and specified ligands.
Args:
keep_ligands (str, list): Ligand(s) to keep in PDB file
force_rerun (bool): If method should be rerun even if output ... | python | {
"resource": ""
} |
q245541 | DOCK.binding_site_mol2 | train | def binding_site_mol2(self, residues, force_rerun=False):
"""Create mol2 of only binding site residues from the receptor
This function will take in a .pdb file (preferably the _receptor_noH.pdb file)
and a string of residues (eg: '144,170,199') and delete all other residues in the
.pdb ... | python | {
"resource": ""
} |
q245542 | DOCK.sphere_selector_using_residues | train | def sphere_selector_using_residues(self, radius, force_rerun=False):
"""Select spheres based on binding site residues
Args:
radius (int, float): Radius around binding residues to dock to
force_rerun (bool): If method should be rerun even if output file exists
"""
... | python | {
"resource": ""
} |
q245543 | DOCK.showbox | train | def showbox(self, force_rerun=False):
"""Create the dummy PDB box around the selected spheres.
Args:
force_rerun (bool): If method should be rerun even if output file exists
"""
log.debug('{}: running box maker...'.format(self.id))
if not self.sphsel_path:
... | python | {
"resource": ""
} |
q245544 | DOCK.auto_flexdock | train | def auto_flexdock(self, binding_residues, radius, ligand_path=None, force_rerun=False):
"""Run DOCK6 on a PDB file, given its binding residues and a radius around them.
Provide a path to a ligand to dock a ligand to it. If no ligand is provided, DOCK6 preparations will be run on
that structure ... | python | {
"resource": ""
} |
q245545 | get_metalpdb_info | train | def get_metalpdb_info(metalpdb_lig_file):
"""Parse a MetalPDB .lig file and return a tuple of the chain ID it represents, along with metal binding information.
Args:
metalpdb_lig_file (str): Path to .lig file
Returns:
tuple: (str, dict) of the chain ID and the parsed metal binding site inf... | python | {
"resource": ""
} |
q245546 | pairwise_sequence_alignment | train | def pairwise_sequence_alignment(a_seq, b_seq, engine, a_seq_id=None, b_seq_id=None,
gapopen=10, gapextend=0.5,
outfile=None, outdir=None, force_rerun=False):
"""Run a global pairwise sequence alignment between two sequence strings.
Args:
a... | python | {
"resource": ""
} |
q245547 | run_needle_alignment | train | def run_needle_alignment(seq_a, seq_b, gapopen=10, gapextend=0.5, write_outfile=True,
outdir=None, outfile=None, force_rerun=False):
"""Run the needle alignment program for two strings and return the raw alignment result.
More info:
EMBOSS needle: http://www.bioinformatics.nl/cgi-b... | python | {
"resource": ""
} |
q245548 | run_needle_alignment_on_files | train | def run_needle_alignment_on_files(id_a, faa_a, id_b, faa_b, gapopen=10, gapextend=0.5,
outdir='', outfile='', force_rerun=False):
"""Run the needle alignment program for two fasta files and return the raw alignment result.
More info:
EMBOSS needle: http://www.bioinformatic... | python | {
"resource": ""
} |
q245549 | get_percent_identity | train | def get_percent_identity(a_aln_seq, b_aln_seq):
"""Get the percent identity between two alignment strings"""
if len(a_aln_seq) != len(b_aln_seq):
raise ValueError('Sequence lengths not equal - was an alignment run?')
count = 0
gaps = 0
for n in range(0, len(a_aln_seq)):
| python | {
"resource": ""
} |
q245550 | get_alignment_df | train | def get_alignment_df(a_aln_seq, b_aln_seq, a_seq_id=None, b_seq_id=None):
"""Summarize two alignment strings in a dataframe.
Args:
a_aln_seq (str): Aligned sequence string
b_aln_seq (str): Aligned sequence string
a_seq_id (str): Optional ID of a_seq
b_seq_id (str): Optional ID o... | python | {
"resource": ""
} |
q245551 | get_alignment_df_from_file | train | def get_alignment_df_from_file(alignment_file, a_seq_id=None, b_seq_id=None):
"""Get a Pandas DataFrame of the Needle alignment results. Contains all positions of the sequences.
Args:
alignment_file:
a_seq_id: Optional specification of the ID of the reference sequence
b_seq_id: Optional... | python | {
"resource": ""
} |
q245552 | get_deletions | train | def get_deletions(aln_df):
"""Get a list of tuples indicating the first and last residues of a deletion region, as well as the length of the deletion.
Examples:
# Deletion of residues 1 to 4, length 4
>>> test = {'id_a': {0: 'a', 1: 'a', 2: 'a', 3: 'a'}, 'id_a_aa': {0: 'M', 1: 'G', 2: 'I', 3: '... | python | {
"resource": ""
} |
q245553 | get_insertions | train | def get_insertions(aln_df):
"""Get a list of tuples indicating the first and last residues of a insertion region, as well as the length of the insertion.
If the first tuple is:
(-1, 1) that means the insertion is at the beginning of the original protein
(X, Inf) where X is the length of the ori... | python | {
"resource": ""
} |
q245554 | map_resnum_a_to_resnum_b | train | def map_resnum_a_to_resnum_b(resnums, a_aln, b_aln):
"""Map a residue number in a sequence to the corresponding residue number in an aligned sequence.
Examples:
>>> map_resnum_a_to_resnum_b([1,2,3], '--ABCDEF', 'XXABCDEF')
{1: 3, 2: 4, 3: 5}
>>> map_resnum_a_to_resnum_b(5, '--ABCDEF', 'XXABCDEF')
... | python | {
"resource": ""
} |
q245555 | pairwise_alignment_stats | train | def pairwise_alignment_stats(reference_seq_aln, other_seq_aln):
"""Get a report of a pairwise alignment.
Args:
reference_seq_aln (str, Seq, SeqRecord): Reference sequence, alignment form
other_seq_aln (str, Seq, SeqRecord): Other sequence, alignment form
Returns:
dict: Dictionary o... | python | {
"resource": ""
} |
q245556 | needle_statistics | train | def needle_statistics(infile):
"""Reads in a needle alignment file and spits out statistics of the alignment.
Args:
infile (str): Alignment file name
Returns:
dict: alignment_properties - a dictionary telling you the number of gaps, identity, etc.
"""
alignments = list(AlignIO.pa... | python | {
"resource": ""
} |
q245557 | needle_statistics_alignio | train | def needle_statistics_alignio(infile):
"""Reads in a needle alignment file and returns an AlignIO object with annotations
Args:
infile (str): Alignment file name
Returns:
AlignIO: annotated AlignIO object
"""
alignments = list(AlignIO.parse(infile, "emboss"))
if len(alignmen... | python | {
"resource": ""
} |
q245558 | FoldX.run_repair_pdb | train | def run_repair_pdb(self, silent=False, force_rerun=False):
"""Run FoldX RepairPDB on this PDB file.
Original command::
foldx --command=RepairPDB --pdb=4bxi.pdb
Args:
silent (bool): If FoldX output should be silenced from printing to the shell.
force_rerun (... | python | {
"resource": ""
} |
q245559 | FoldX.create_mutation_file | train | def create_mutation_file(self, list_of_tuples):
"""Create the FoldX file 'individual_list.txt' to run BuildModel upon.
Args:
list_of_tuples (list): A list of tuples indicating mutation groups to carry out BuildModel upon. Example::
[
(('N', 'A', 308, 'S'... | python | {
"resource": ""
} |
q245560 | FoldX.create_random_mutation_file | train | def create_random_mutation_file(self, list_of_tuples, original_sequence,
randomize_resnums=False, randomize_resids=False,
skip_resnums=None):
"""Create the FoldX file 'individual_list.txt', but randomize the mutation numbers or residues tha... | python | {
"resource": ""
} |
q245561 | FoldX.run_build_model | train | def run_build_model(self, num_runs=5, silent=False, force_rerun=False):
"""Run FoldX BuildModel command with a mutant file input.
Original command::
foldx --command=BuildModel --pdb=4bxi_Repair.pdb --mutant-file=individual_list.txt --numberOfRuns=5
Args:
num_runs (int)... | python | {
"resource": ""
} |
q245562 | FoldX.get_ddG_results | train | def get_ddG_results(self):
"""Parse the results from BuildModel and get the delta delta G's.
A positive ddG means that the mutation(s) is destabilzing, negative means stabilizing.
- highly stabilising (ΔΔG < −1.84 kcal/mol);
- stabilising (−1.84 kcal/mol ≤ ΔΔG < −0.92 kcal/mol)... | python | {
"resource": ""
} |
q245563 | clean_pdb | train | def clean_pdb(pdb_file, out_suffix='_clean', outdir=None, force_rerun=False,
remove_atom_alt=True, keep_atom_alt_id='A', remove_atom_hydrogen=True, add_atom_occ=True,
remove_res_hetero=True, keep_chemicals=None, keep_res_only=None,
add_chain_id_if_empty='X', keep_chains=None):
... | python | {
"resource": ""
} |
q245564 | parse_mmtf_header | train | def parse_mmtf_header(infile):
"""Parse an MMTF file and return basic header-like information.
Args:
infile (str): Path to MMTF file
Returns:
dict: Dictionary of parsed header
Todo:
- Can this be sped up by not parsing the 3D coordinate info somehow?
- OR just store th... | python | {
"resource": ""
} |
q245565 | download_mmcif_header | train | def download_mmcif_header(pdb_id, outdir='', force_rerun=False):
"""Download a mmCIF header file from the RCSB PDB by ID.
Args:
pdb_id: PDB ID
outdir: Optional output directory, default is current working directory
force_rerun: If the file should be downloaded again even if it exists
... | python | {
"resource": ""
} |
q245566 | parse_mmcif_header | train | def parse_mmcif_header(infile):
"""Parse a couple important fields from the mmCIF file format with some manual curation of ligands.
If you want full access to the mmCIF file just use the MMCIF2Dict class in Biopython.
Args:
infile: Path to mmCIF file
Returns:
dict: Dictionary of parse... | python | {
"resource": ""
} |
q245567 | download_sifts_xml | train | def download_sifts_xml(pdb_id, outdir='', force_rerun=False):
"""Download the SIFTS file for a PDB ID.
Args:
pdb_id (str): PDB ID
outdir (str): Output directory, current working directory if not specified.
force_rerun (bool): If the file should be downloaded again even if it exists
... | python | {
"resource": ""
} |
q245568 | map_uniprot_resnum_to_pdb | train | def map_uniprot_resnum_to_pdb(uniprot_resnum, chain_id, sifts_file):
"""Map a UniProt residue number to its corresponding PDB residue number.
This function requires that the SIFTS file be downloaded,
and also a chain ID (as different chains may have different mappings).
Args:
uniprot_resnum (i... | python | {
"resource": ""
} |
q245569 | best_structures | train | def best_structures(uniprot_id, outname=None, outdir=None, seq_ident_cutoff=0.0, force_rerun=False):
"""Use the PDBe REST service to query for the best PDB structures for a UniProt ID.
More information found here: https://www.ebi.ac.uk/pdbe/api/doc/sifts.html
Link used to retrieve results: https://www.ebi.... | python | {
"resource": ""
} |
q245570 | _property_table | train | def _property_table():
"""Download the PDB -> resolution table directly from the RCSB PDB REST service.
See the other fields that you can get here: http://www.rcsb.org/pdb/results/reportField.do
Returns:
Pandas DataFrame: table of structureId as the index, resolution and experimentalTechnique as t... | python | {
"resource": ""
} |
q245571 | get_resolution | train | def get_resolution(pdb_id):
"""Quick way to get the resolution of a PDB ID using the table of results from the REST service
Returns infinity if the resolution is not available.
Returns:
float: resolution of a PDB ID in Angstroms
TODO:
- Unit test
"""
pdb_id = pdb_id.upper()
... | python | {
"resource": ""
} |
q245572 | get_release_date | train | def get_release_date(pdb_id):
"""Quick way to get the release date of a PDB ID using the table of results from the REST service
Returns None if the release date is not available.
Returns:
str: Organism of a PDB ID
"""
pdb_id = pdb_id.upper()
if pdb_id not in _property_table().index:
... | python | {
"resource": ""
} |
q245573 | get_num_bioassemblies | train | def get_num_bioassemblies(pdb_id, cache=False, outdir=None, force_rerun=False):
"""Check if there are bioassemblies using the PDB REST API, and if there are, get the number of bioassemblies
available.
See: https://www.rcsb.org/pages/webservices/rest, section 'List biological assemblies'
Not all PDB en... | python | {
"resource": ""
} |
q245574 | get_bioassembly_info | train | def get_bioassembly_info(pdb_id, biomol_num, cache=False, outdir=None, force_rerun=False):
"""Get metadata about a bioassembly from the RCSB PDB's REST API.
See: https://www.rcsb.org/pdb/rest/bioassembly/bioassembly?structureId=1hv4&nr=1
The API returns an XML file containing the information on a biologica... | python | {
"resource": ""
} |
q245575 | download_structure | train | def download_structure(pdb_id, file_type, outdir='', only_header=False, force_rerun=False):
"""Download a structure from the RCSB PDB by ID. Specify the file type desired.
Args:
pdb_id: PDB ID
file_type: pdb, pdb.gz, mmcif, cif, cif.gz, xml.gz, mmtf, mmtf.gz
outdir: Optional output dire... | python | {
"resource": ""
} |
q245576 | PDBProp.download_structure_file | train | def download_structure_file(self, outdir, file_type=None, load_header_metadata=True, force_rerun=False):
"""Download a structure file from the PDB, specifying an output directory and a file type. Optionally download
the mmCIF header file and parse data from it to store within this object.
Args:... | python | {
"resource": ""
} |
q245577 | parse_procheck | train | def parse_procheck(quality_directory):
"""Parses all PROCHECK files in a directory and returns a Pandas DataFrame of the results
Args:
quality_directory: path to directory with PROCHECK output (.sum files)
Returns:
Pandas DataFrame: Summary of PROCHECK results
"""
# TODO: save as... | python | {
"resource": ""
} |
q245578 | parse_psqs | train | def parse_psqs(psqs_results_file):
"""Parse a PSQS result file and returns a Pandas DataFrame of the results
Args:
psqs_results_file: Path to psqs results file
Returns:
Pandas DataFrame: Summary of PSQS results
"""
# TODO: generalize column names for all results, save as dict ins... | python | {
"resource": ""
} |
q245579 | Protein.protein_statistics | train | def protein_statistics(self):
"""Get a dictionary of basic statistics describing this protein"""
# TODO: can i use get_dict here instead
d = {}
d['id'] = self.id
d['sequences'] = [x.id for x in self.sequences]
d['num_sequences'] = self.num_sequences
if self.repr... | python | {
"resource": ""
} |
q245580 | Protein.filter_sequences | train | def filter_sequences(self, seq_type):
"""Return a DictList of only specified types in the sequences attribute.
Args:
| python | {
"resource": ""
} |
q245581 | Protein.load_kegg | train | def load_kegg(self, kegg_id, kegg_organism_code=None, kegg_seq_file=None, kegg_metadata_file=None,
set_as_representative=False, download=False, outdir=None, force_rerun=False):
"""Load a KEGG ID, sequence, and metadata files into the sequences attribute.
Args:
kegg_id (str... | python | {
"resource": ""
} |
q245582 | Protein.load_manual_sequence_file | train | def load_manual_sequence_file(self, ident, seq_file, copy_file=False, outdir=None, set_as_representative=False):
"""Load a manual sequence, given as a FASTA file and optionally set it as the representative sequence.
Also store it in the sequences attribute.
Args:
ident (str): Sequen... | python | {
"resource": ""
} |
q245583 | Protein.load_manual_sequence | train | def load_manual_sequence(self, seq, ident=None, write_fasta_file=False, outdir=None,
set_as_representative=False, force_rewrite=False):
"""Load a manual sequence given as a string and optionally set it as the representative sequence.
Also store it in the sequences attribute.... | python | {
"resource": ""
} |
q245584 | Protein.write_all_sequences_file | train | def write_all_sequences_file(self, outname, outdir=None):
"""Write all the stored sequences as a single FASTA file. By default, sets IDs to model gene IDs.
Args:
outname (str): Name of the output FASTA file without the extension
outdir (str): Path to output directory for the fil... | python | {
"resource": ""
} |
q245585 | Protein.get_sequence_sliding_window_properties | train | def get_sequence_sliding_window_properties(self, scale, window, representative_only=True):
"""Run Biopython ProteinAnalysis with a sliding window to calculate a given property.
Results are stored in the protein's respective SeqProp objects at ``.letter_annotations``
Args:
scale (str... | python | {
"resource": ""
} |
q245586 | Protein.prep_itasser_modeling | train | def prep_itasser_modeling(self, itasser_installation, itlib_folder, runtype, create_in_dir=None,
execute_from_dir=None, print_exec=False, **kwargs):
"""Prepare to run I-TASSER homology modeling for the representative sequence.
Args:
itasser_installation (str): ... | python | {
"resource": ""
} |
q245587 | Protein.map_uniprot_to_pdb | train | def map_uniprot_to_pdb(self, seq_ident_cutoff=0.0, outdir=None, force_rerun=False):
"""Map the representative sequence's UniProt ID to PDB IDs using the PDBe "Best Structures" API.
Will save a JSON file of the results to the protein sequences folder.
The "Best structures" API is available at ht... | python | {
"resource": ""
} |
q245588 | Protein.load_pdb | train | def load_pdb(self, pdb_id, mapped_chains=None, pdb_file=None, file_type=None, is_experimental=True,
set_as_representative=False, representative_chain=None, force_rerun=False):
"""Load a structure ID and optional structure file into the structures attribute.
Args:
pdb_id (st... | python | {
"resource": ""
} |
q245589 | Protein.pdb_downloader_and_metadata | train | def pdb_downloader_and_metadata(self, outdir=None, pdb_file_type=None, force_rerun=False):
"""Download ALL mapped experimental structures to the protein structures directory.
Args:
outdir (str): Path to output directory, if protein structures directory not set or other output directory is
... | python | {
"resource": ""
} |
q245590 | Protein._get_seqprop_to_seqprop_alignment | train | def _get_seqprop_to_seqprop_alignment(self, seqprop1, seqprop2):
"""Return the alignment stored in self.sequence_alignments given a seqprop + another seqprop"""
if isinstance(seqprop1, str):
seqprop1_id = seqprop1
else:
seqprop1_id = seqprop1.id
if isinstance(seqp... | python | {
"resource": ""
} |
q245591 | Protein.map_seqprop_resnums_to_seqprop_resnums | train | def map_seqprop_resnums_to_seqprop_resnums(self, resnums, seqprop1, seqprop2):
"""Map a residue number in any SeqProp to another SeqProp using the pairwise alignment information.
Args:
resnums (int, list): Residue numbers in seqprop1
seqprop1 (SeqProp): SeqProp object the resnum... | python | {
"resource": ""
} |
q245592 | Protein._get_seqprop_to_structprop_alignment | train | def _get_seqprop_to_structprop_alignment(self, seqprop, structprop, chain_id):
"""Return the alignment stored in self.sequence_alignments given a seqprop, structuprop, and chain_id"""
full_structure_id = '{}-{}'.format(structprop.id, chain_id)
aln_id = '{}_{}'.format(seqprop.id, full_structure_i... | python | {
"resource": ""
} |
q245593 | Protein.check_structure_chain_quality | train | def check_structure_chain_quality(self, seqprop, structprop, chain_id,
seq_ident_cutoff=0.5, allow_missing_on_termini=0.2,
allow_mutants=True, allow_deletions=False,
allow_insertions=False, allow_unresolved... | python | {
"resource": ""
} |
q245594 | Protein.find_representative_chain | train | def find_representative_chain(self, seqprop, structprop, chains_to_check=None,
seq_ident_cutoff=0.5, allow_missing_on_termini=0.2,
allow_mutants=True, allow_deletions=False,
allow_insertions=False, allow_unresolved=Tru... | python | {
"resource": ""
} |
q245595 | Protein._map_seqprop_resnums_to_structprop_chain_index | train | def _map_seqprop_resnums_to_structprop_chain_index(self, resnums, seqprop=None, structprop=None, chain_id=None,
use_representatives=False):
"""Map a residue number in any SeqProp to the mapping index in the StructProp + chain ID. This does not provide
... | python | {
"resource": ""
} |
q245596 | Protein.map_seqprop_resnums_to_structprop_resnums | train | def map_seqprop_resnums_to_structprop_resnums(self, resnums, seqprop=None, structprop=None, chain_id=None,
use_representatives=False):
"""Map a residue number in any SeqProp to the structure's residue number for a specified chain.
Args:
resn... | python | {
"resource": ""
} |
q245597 | Protein.map_structprop_resnums_to_seqprop_resnums | train | def map_structprop_resnums_to_seqprop_resnums(self, resnums, structprop=None, chain_id=None, seqprop=None,
use_representatives=False):
"""Map a residue number in any StructProp + chain ID to any SeqProp's residue number.
Args:
resnums (int, ... | python | {
"resource": ""
} |
q245598 | Protein.get_seqprop_subsequence_from_structchain_property | train | def get_seqprop_subsequence_from_structchain_property(self,
property_key, property_value, condition,
seqprop=None, structprop=None, chain_id=None,
... | python | {
"resource": ""
} |
q245599 | Protein._representative_structure_setter | train | def _representative_structure_setter(self, structprop, keep_chain, clean=True, keep_chemicals=None,
out_suffix='_clean', outdir=None, force_rerun=False):
"""Set the representative structure by 1) cleaning it and 2) copying over attributes of the original structure.
... | python | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.