repo stringlengths 7 55 | path stringlengths 4 127 | func_name stringlengths 1 88 | original_string stringlengths 75 19.8k | language stringclasses 1
value | code stringlengths 75 19.8k | code_tokens listlengths 20 707 | docstring stringlengths 3 17.3k | docstring_tokens listlengths 3 222 | sha stringlengths 40 40 | url stringlengths 87 242 | partition stringclasses 1
value | idx int64 0 252k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
woolfson-group/isambard | isambard/add_ons/filesystem.py | pdbe_status_code | def pdbe_status_code(code):
"""Check if a PDB code has structure files on the PDBE site.
Parameters
----------
code : str
PDB code to check for on PDBE.
Returns
-------
status_code : int
HTTP status code of PDBE url associated with input code.
"""
url = 'http://www.... | python | def pdbe_status_code(code):
"""Check if a PDB code has structure files on the PDBE site.
Parameters
----------
code : str
PDB code to check for on PDBE.
Returns
-------
status_code : int
HTTP status code of PDBE url associated with input code.
"""
url = 'http://www.... | [
"def",
"pdbe_status_code",
"(",
"code",
")",
":",
"url",
"=",
"'http://www.ebi.ac.uk/pdbe/entry-files/download/{0}_1.mmol'",
".",
"format",
"(",
"code",
")",
"r",
"=",
"requests",
".",
"head",
"(",
"url",
"=",
"url",
")",
"return",
"r",
".",
"status_code"
] | Check if a PDB code has structure files on the PDBE site.
Parameters
----------
code : str
PDB code to check for on PDBE.
Returns
-------
status_code : int
HTTP status code of PDBE url associated with input code. | [
"Check",
"if",
"a",
"PDB",
"code",
"has",
"structure",
"files",
"on",
"the",
"PDBE",
"site",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/add_ons/filesystem.py#L412-L427 | train | 59,900 |
woolfson-group/isambard | isambard/add_ons/filesystem.py | preferred_mmol | def preferred_mmol(code):
""" Get mmol number of preferred biological assembly as listed in the PDBe.
Notes
-----
First checks for code in mmols.json.
If code not yet in this json dictionary, uses requests module to scrape the PDBE for the preferred mmol number.
Parameters
----------
c... | python | def preferred_mmol(code):
""" Get mmol number of preferred biological assembly as listed in the PDBe.
Notes
-----
First checks for code in mmols.json.
If code not yet in this json dictionary, uses requests module to scrape the PDBE for the preferred mmol number.
Parameters
----------
c... | [
"def",
"preferred_mmol",
"(",
"code",
")",
":",
"# If preferred mmol number is already known, return it",
"if",
"code",
"in",
"mmols_numbers",
".",
"keys",
"(",
")",
":",
"mmol",
"=",
"mmols_numbers",
"[",
"code",
"]",
"[",
"1",
"]",
"return",
"mmol",
"elif",
... | Get mmol number of preferred biological assembly as listed in the PDBe.
Notes
-----
First checks for code in mmols.json.
If code not yet in this json dictionary, uses requests module to scrape the PDBE for the preferred mmol number.
Parameters
----------
code : str
A PDB code.
... | [
"Get",
"mmol",
"number",
"of",
"preferred",
"biological",
"assembly",
"as",
"listed",
"in",
"the",
"PDBe",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/add_ons/filesystem.py#L430-L485 | train | 59,901 |
woolfson-group/isambard | isambard/add_ons/filesystem.py | current_codes_from_pdb | def current_codes_from_pdb():
""" Get list of all PDB codes currently listed in the PDB.
Returns
-------
pdb_codes : list(str)
List of PDB codes (in lower case).
"""
url = 'http://www.rcsb.org/pdb/rest/getCurrent'
r = requests.get(url)
if r.status_code == 200:
pdb_codes ... | python | def current_codes_from_pdb():
""" Get list of all PDB codes currently listed in the PDB.
Returns
-------
pdb_codes : list(str)
List of PDB codes (in lower case).
"""
url = 'http://www.rcsb.org/pdb/rest/getCurrent'
r = requests.get(url)
if r.status_code == 200:
pdb_codes ... | [
"def",
"current_codes_from_pdb",
"(",
")",
":",
"url",
"=",
"'http://www.rcsb.org/pdb/rest/getCurrent'",
"r",
"=",
"requests",
".",
"get",
"(",
"url",
")",
"if",
"r",
".",
"status_code",
"==",
"200",
":",
"pdb_codes",
"=",
"[",
"x",
".",
"lower",
"(",
")",... | Get list of all PDB codes currently listed in the PDB.
Returns
-------
pdb_codes : list(str)
List of PDB codes (in lower case). | [
"Get",
"list",
"of",
"all",
"PDB",
"codes",
"currently",
"listed",
"in",
"the",
"PDB",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/add_ons/filesystem.py#L489-L504 | train | 59,902 |
woolfson-group/isambard | isambard/add_ons/filesystem.py | FileSystem.mmols | def mmols(self):
""" Dict of filepaths for all mmol files associated with code.
Notes
-----
Downloads mmol files if not already present.
Returns
-------
mmols_dict : dict, or None.
Keys : int
mmol number
Values : str
... | python | def mmols(self):
""" Dict of filepaths for all mmol files associated with code.
Notes
-----
Downloads mmol files if not already present.
Returns
-------
mmols_dict : dict, or None.
Keys : int
mmol number
Values : str
... | [
"def",
"mmols",
"(",
"self",
")",
":",
"mmols_dict",
"=",
"{",
"}",
"mmol_dir",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"parent_dir",
",",
"'structures'",
")",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"mmol_dir",
")",
":",... | Dict of filepaths for all mmol files associated with code.
Notes
-----
Downloads mmol files if not already present.
Returns
-------
mmols_dict : dict, or None.
Keys : int
mmol number
Values : str
Filepath for the c... | [
"Dict",
"of",
"filepaths",
"for",
"all",
"mmol",
"files",
"associated",
"with",
"code",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/add_ons/filesystem.py#L65-L91 | train | 59,903 |
woolfson-group/isambard | isambard/add_ons/filesystem.py | FileSystem.dssps | def dssps(self):
""" Dict of filepaths for all dssp files associated with code.
Notes
-----
Runs dssp and stores writes output to files if not already present.
Also downloads mmol files if not already present.
Calls isambard.external_programs.dssp and so needs dssp to be... | python | def dssps(self):
""" Dict of filepaths for all dssp files associated with code.
Notes
-----
Runs dssp and stores writes output to files if not already present.
Also downloads mmol files if not already present.
Calls isambard.external_programs.dssp and so needs dssp to be... | [
"def",
"dssps",
"(",
"self",
")",
":",
"dssps_dict",
"=",
"{",
"}",
"dssp_dir",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"parent_dir",
",",
"'dssp'",
")",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"dssp_dir",
")",
":",
"os... | Dict of filepaths for all dssp files associated with code.
Notes
-----
Runs dssp and stores writes output to files if not already present.
Also downloads mmol files if not already present.
Calls isambard.external_programs.dssp and so needs dssp to be installed.
Returns
... | [
"Dict",
"of",
"filepaths",
"for",
"all",
"dssp",
"files",
"associated",
"with",
"code",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/add_ons/filesystem.py#L94-L128 | train | 59,904 |
woolfson-group/isambard | isambard/add_ons/filesystem.py | FileSystem.fastas | def fastas(self, download=False):
""" Dict of filepaths for all fasta files associated with code.
Parameters
----------
download : bool
If True, downloads the fasta file from the PDB.
If False, uses the ampal Protein.fasta property
Defaults to False -... | python | def fastas(self, download=False):
""" Dict of filepaths for all fasta files associated with code.
Parameters
----------
download : bool
If True, downloads the fasta file from the PDB.
If False, uses the ampal Protein.fasta property
Defaults to False -... | [
"def",
"fastas",
"(",
"self",
",",
"download",
"=",
"False",
")",
":",
"fastas_dict",
"=",
"{",
"}",
"fasta_dir",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"parent_dir",
",",
"'fasta'",
")",
"if",
"not",
"os",
".",
"path",
".",
"exists... | Dict of filepaths for all fasta files associated with code.
Parameters
----------
download : bool
If True, downloads the fasta file from the PDB.
If False, uses the ampal Protein.fasta property
Defaults to False - this is definitely the recommended behaviour.... | [
"Dict",
"of",
"filepaths",
"for",
"all",
"fasta",
"files",
"associated",
"with",
"code",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/add_ons/filesystem.py#L131-L179 | train | 59,905 |
woolfson-group/isambard | isambard/add_ons/filesystem.py | FileSystem.mmcif | def mmcif(self):
""" Filepath for mmcif file associated with code.
Notes
-----
Downloads mmcif file if not already present.
Returns
-------
mmcif_file : str
Filepath for the mmcif file.
"""
mmcif_dir = os.path.join(self.parent_dir, 'm... | python | def mmcif(self):
""" Filepath for mmcif file associated with code.
Notes
-----
Downloads mmcif file if not already present.
Returns
-------
mmcif_file : str
Filepath for the mmcif file.
"""
mmcif_dir = os.path.join(self.parent_dir, 'm... | [
"def",
"mmcif",
"(",
"self",
")",
":",
"mmcif_dir",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"parent_dir",
",",
"'mmcif'",
")",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"mmcif_dir",
")",
":",
"os",
".",
"makedirs",
"(",
"... | Filepath for mmcif file associated with code.
Notes
-----
Downloads mmcif file if not already present.
Returns
-------
mmcif_file : str
Filepath for the mmcif file. | [
"Filepath",
"for",
"mmcif",
"file",
"associated",
"with",
"code",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/add_ons/filesystem.py#L197-L216 | train | 59,906 |
woolfson-group/isambard | isambard/ampal/ligands.py | LigandGroup.categories | def categories(self):
"""Returns the categories of `Ligands` in `LigandGroup`."""
category_dict = {}
for ligand in self:
if ligand.category in category_dict:
category_dict[ligand.category].append(ligand)
else:
category_dict[ligand.category]... | python | def categories(self):
"""Returns the categories of `Ligands` in `LigandGroup`."""
category_dict = {}
for ligand in self:
if ligand.category in category_dict:
category_dict[ligand.category].append(ligand)
else:
category_dict[ligand.category]... | [
"def",
"categories",
"(",
"self",
")",
":",
"category_dict",
"=",
"{",
"}",
"for",
"ligand",
"in",
"self",
":",
"if",
"ligand",
".",
"category",
"in",
"category_dict",
":",
"category_dict",
"[",
"ligand",
".",
"category",
"]",
".",
"append",
"(",
"ligand... | Returns the categories of `Ligands` in `LigandGroup`. | [
"Returns",
"the",
"categories",
"of",
"Ligands",
"in",
"LigandGroup",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/ligands.py#L34-L42 | train | 59,907 |
woolfson-group/isambard | isambard/ampal/ligands.py | LigandGroup.category_count | def category_count(self):
"""Returns the number of categories in `categories`."""
category_dict = self.categories
count_dict = {category: len(
category_dict[category]) for category in category_dict}
return count_dict | python | def category_count(self):
"""Returns the number of categories in `categories`."""
category_dict = self.categories
count_dict = {category: len(
category_dict[category]) for category in category_dict}
return count_dict | [
"def",
"category_count",
"(",
"self",
")",
":",
"category_dict",
"=",
"self",
".",
"categories",
"count_dict",
"=",
"{",
"category",
":",
"len",
"(",
"category_dict",
"[",
"category",
"]",
")",
"for",
"category",
"in",
"category_dict",
"}",
"return",
"count_... | Returns the number of categories in `categories`. | [
"Returns",
"the",
"number",
"of",
"categories",
"in",
"categories",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/ligands.py#L45-L50 | train | 59,908 |
woolfson-group/isambard | isambard/ampal/analyse_protein.py | sequence_molecular_weight | def sequence_molecular_weight(seq):
"""Returns the molecular weight of the polypeptide sequence.
Notes
-----
Units = Daltons
Parameters
----------
seq : str
Sequence of amino acids.
"""
if 'X' in seq:
warnings.warn(_nc_warning_str, NoncanonicalWarning)
return su... | python | def sequence_molecular_weight(seq):
"""Returns the molecular weight of the polypeptide sequence.
Notes
-----
Units = Daltons
Parameters
----------
seq : str
Sequence of amino acids.
"""
if 'X' in seq:
warnings.warn(_nc_warning_str, NoncanonicalWarning)
return su... | [
"def",
"sequence_molecular_weight",
"(",
"seq",
")",
":",
"if",
"'X'",
"in",
"seq",
":",
"warnings",
".",
"warn",
"(",
"_nc_warning_str",
",",
"NoncanonicalWarning",
")",
"return",
"sum",
"(",
"[",
"residue_mwt",
"[",
"aa",
"]",
"*",
"n",
"for",
"aa",
",... | Returns the molecular weight of the polypeptide sequence.
Notes
-----
Units = Daltons
Parameters
----------
seq : str
Sequence of amino acids. | [
"Returns",
"the",
"molecular",
"weight",
"of",
"the",
"polypeptide",
"sequence",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/analyse_protein.py#L18-L33 | train | 59,909 |
woolfson-group/isambard | isambard/ampal/analyse_protein.py | sequence_molar_extinction_280 | def sequence_molar_extinction_280(seq):
"""Returns the molar extinction coefficient of the sequence at 280 nm.
Notes
-----
Units = M/cm
Parameters
----------
seq : str
Sequence of amino acids.
"""
if 'X' in seq:
warnings.warn(_nc_warning_str, NoncanonicalWarning)
... | python | def sequence_molar_extinction_280(seq):
"""Returns the molar extinction coefficient of the sequence at 280 nm.
Notes
-----
Units = M/cm
Parameters
----------
seq : str
Sequence of amino acids.
"""
if 'X' in seq:
warnings.warn(_nc_warning_str, NoncanonicalWarning)
... | [
"def",
"sequence_molar_extinction_280",
"(",
"seq",
")",
":",
"if",
"'X'",
"in",
"seq",
":",
"warnings",
".",
"warn",
"(",
"_nc_warning_str",
",",
"NoncanonicalWarning",
")",
"return",
"sum",
"(",
"[",
"residue_ext_280",
"[",
"aa",
"]",
"*",
"n",
"for",
"a... | Returns the molar extinction coefficient of the sequence at 280 nm.
Notes
-----
Units = M/cm
Parameters
----------
seq : str
Sequence of amino acids. | [
"Returns",
"the",
"molar",
"extinction",
"coefficient",
"of",
"the",
"sequence",
"at",
"280",
"nm",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/analyse_protein.py#L38-L52 | train | 59,910 |
woolfson-group/isambard | isambard/ampal/analyse_protein.py | partial_charge | def partial_charge(aa, pH):
"""Calculates the partial charge of the amino acid.
Parameters
----------
aa : str
Amino acid single-letter code.
pH : float
pH of interest.
"""
difference = pH - residue_pka[aa]
if residue_charge[aa] > 0:
difference *= -1
ratio = ... | python | def partial_charge(aa, pH):
"""Calculates the partial charge of the amino acid.
Parameters
----------
aa : str
Amino acid single-letter code.
pH : float
pH of interest.
"""
difference = pH - residue_pka[aa]
if residue_charge[aa] > 0:
difference *= -1
ratio = ... | [
"def",
"partial_charge",
"(",
"aa",
",",
"pH",
")",
":",
"difference",
"=",
"pH",
"-",
"residue_pka",
"[",
"aa",
"]",
"if",
"residue_charge",
"[",
"aa",
"]",
">",
"0",
":",
"difference",
"*=",
"-",
"1",
"ratio",
"=",
"(",
"10",
"**",
"difference",
... | Calculates the partial charge of the amino acid.
Parameters
----------
aa : str
Amino acid single-letter code.
pH : float
pH of interest. | [
"Calculates",
"the",
"partial",
"charge",
"of",
"the",
"amino",
"acid",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/analyse_protein.py#L55-L69 | train | 59,911 |
woolfson-group/isambard | isambard/ampal/analyse_protein.py | sequence_charge | def sequence_charge(seq, pH=7.4):
"""Calculates the total charge of the input polypeptide sequence.
Parameters
----------
seq : str
Sequence of amino acids.
pH : float
pH of interest.
"""
if 'X' in seq:
warnings.warn(_nc_warning_str, NoncanonicalWarning)
adj_prot... | python | def sequence_charge(seq, pH=7.4):
"""Calculates the total charge of the input polypeptide sequence.
Parameters
----------
seq : str
Sequence of amino acids.
pH : float
pH of interest.
"""
if 'X' in seq:
warnings.warn(_nc_warning_str, NoncanonicalWarning)
adj_prot... | [
"def",
"sequence_charge",
"(",
"seq",
",",
"pH",
"=",
"7.4",
")",
":",
"if",
"'X'",
"in",
"seq",
":",
"warnings",
".",
"warn",
"(",
"_nc_warning_str",
",",
"NoncanonicalWarning",
")",
"adj_protein_charge",
"=",
"sum",
"(",
"[",
"partial_charge",
"(",
"aa",... | Calculates the total charge of the input polypeptide sequence.
Parameters
----------
seq : str
Sequence of amino acids.
pH : float
pH of interest. | [
"Calculates",
"the",
"total",
"charge",
"of",
"the",
"input",
"polypeptide",
"sequence",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/analyse_protein.py#L72-L91 | train | 59,912 |
woolfson-group/isambard | isambard/ampal/analyse_protein.py | charge_series | def charge_series(seq, granularity=0.1):
"""Calculates the charge for pH 1-13.
Parameters
----------
seq : str
Sequence of amino acids.
granularity : float, optional
Granularity of pH values i.e. if 0.1 pH = [1.0, 1.1, 1.2...]
"""
if 'X' in seq:
warnings.warn(_nc_war... | python | def charge_series(seq, granularity=0.1):
"""Calculates the charge for pH 1-13.
Parameters
----------
seq : str
Sequence of amino acids.
granularity : float, optional
Granularity of pH values i.e. if 0.1 pH = [1.0, 1.1, 1.2...]
"""
if 'X' in seq:
warnings.warn(_nc_war... | [
"def",
"charge_series",
"(",
"seq",
",",
"granularity",
"=",
"0.1",
")",
":",
"if",
"'X'",
"in",
"seq",
":",
"warnings",
".",
"warn",
"(",
"_nc_warning_str",
",",
"NoncanonicalWarning",
")",
"ph_range",
"=",
"numpy",
".",
"arange",
"(",
"1",
",",
"13",
... | Calculates the charge for pH 1-13.
Parameters
----------
seq : str
Sequence of amino acids.
granularity : float, optional
Granularity of pH values i.e. if 0.1 pH = [1.0, 1.1, 1.2...] | [
"Calculates",
"the",
"charge",
"for",
"pH",
"1",
"-",
"13",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/analyse_protein.py#L94-L108 | train | 59,913 |
woolfson-group/isambard | isambard/ampal/analyse_protein.py | sequence_isoelectric_point | def sequence_isoelectric_point(seq, granularity=0.1):
"""Calculates the isoelectric point of the sequence for ph 1-13.
Parameters
----------
seq : str
Sequence of amino acids.
granularity : float, optional
Granularity of pH values i.e. if 0.1 pH = [1.0, 1.1, 1.2...]
"""
if '... | python | def sequence_isoelectric_point(seq, granularity=0.1):
"""Calculates the isoelectric point of the sequence for ph 1-13.
Parameters
----------
seq : str
Sequence of amino acids.
granularity : float, optional
Granularity of pH values i.e. if 0.1 pH = [1.0, 1.1, 1.2...]
"""
if '... | [
"def",
"sequence_isoelectric_point",
"(",
"seq",
",",
"granularity",
"=",
"0.1",
")",
":",
"if",
"'X'",
"in",
"seq",
":",
"warnings",
".",
"warn",
"(",
"_nc_warning_str",
",",
"NoncanonicalWarning",
")",
"ph_range",
",",
"charge_at_ph",
"=",
"charge_series",
"... | Calculates the isoelectric point of the sequence for ph 1-13.
Parameters
----------
seq : str
Sequence of amino acids.
granularity : float, optional
Granularity of pH values i.e. if 0.1 pH = [1.0, 1.1, 1.2...] | [
"Calculates",
"the",
"isoelectric",
"point",
"of",
"the",
"sequence",
"for",
"ph",
"1",
"-",
"13",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/analyse_protein.py#L111-L126 | train | 59,914 |
woolfson-group/isambard | isambard/ampal/analyse_protein.py | measure_sidechain_torsion_angles | def measure_sidechain_torsion_angles(residue, verbose=True):
"""Calculates sidechain dihedral angles for a residue
Parameters
----------
residue : [ampal.Residue]
`Residue` object.
verbose : bool, optional
If `true`, tells you when a residue does not have any known
dihedral ... | python | def measure_sidechain_torsion_angles(residue, verbose=True):
"""Calculates sidechain dihedral angles for a residue
Parameters
----------
residue : [ampal.Residue]
`Residue` object.
verbose : bool, optional
If `true`, tells you when a residue does not have any known
dihedral ... | [
"def",
"measure_sidechain_torsion_angles",
"(",
"residue",
",",
"verbose",
"=",
"True",
")",
":",
"chi_angles",
"=",
"[",
"]",
"aa",
"=",
"residue",
".",
"mol_code",
"if",
"aa",
"not",
"in",
"side_chain_dihedrals",
":",
"if",
"verbose",
":",
"print",
"(",
... | Calculates sidechain dihedral angles for a residue
Parameters
----------
residue : [ampal.Residue]
`Residue` object.
verbose : bool, optional
If `true`, tells you when a residue does not have any known
dihedral angles to measure.
Returns
-------
chi_angles: [float]
... | [
"Calculates",
"sidechain",
"dihedral",
"angles",
"for",
"a",
"residue"
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/analyse_protein.py#L129-L170 | train | 59,915 |
woolfson-group/isambard | isambard/ampal/analyse_protein.py | measure_torsion_angles | def measure_torsion_angles(residues):
"""Calculates the dihedral angles for a list of backbone atoms.
Parameters
----------
residues : [ampal.Residue]
List of `Residue` objects.
Returns
-------
torsion_angles : (float, float, float)
One triple for each residue, containing t... | python | def measure_torsion_angles(residues):
"""Calculates the dihedral angles for a list of backbone atoms.
Parameters
----------
residues : [ampal.Residue]
List of `Residue` objects.
Returns
-------
torsion_angles : (float, float, float)
One triple for each residue, containing t... | [
"def",
"measure_torsion_angles",
"(",
"residues",
")",
":",
"if",
"len",
"(",
"residues",
")",
"<",
"2",
":",
"torsion_angles",
"=",
"[",
"(",
"None",
",",
"None",
",",
"None",
")",
"]",
"*",
"len",
"(",
"residues",
")",
"else",
":",
"torsion_angles",
... | Calculates the dihedral angles for a list of backbone atoms.
Parameters
----------
residues : [ampal.Residue]
List of `Residue` objects.
Returns
-------
torsion_angles : (float, float, float)
One triple for each residue, containing torsion angles in
the range [-pi, pi].... | [
"Calculates",
"the",
"dihedral",
"angles",
"for",
"a",
"list",
"of",
"backbone",
"atoms",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/analyse_protein.py#L173-L260 | train | 59,916 |
woolfson-group/isambard | isambard/ampal/analyse_protein.py | cc_to_local_params | def cc_to_local_params(pitch, radius, oligo):
"""Returns local parameters for an oligomeric assembly.
Parameters
----------
pitch : float
Pitch of assembly
radius : float
Radius of assembly
oligo : int
Oligomeric state of assembly
Returns
-------
pitchloc : ... | python | def cc_to_local_params(pitch, radius, oligo):
"""Returns local parameters for an oligomeric assembly.
Parameters
----------
pitch : float
Pitch of assembly
radius : float
Radius of assembly
oligo : int
Oligomeric state of assembly
Returns
-------
pitchloc : ... | [
"def",
"cc_to_local_params",
"(",
"pitch",
",",
"radius",
",",
"oligo",
")",
":",
"rloc",
"=",
"numpy",
".",
"sin",
"(",
"numpy",
".",
"pi",
"/",
"oligo",
")",
"*",
"radius",
"alpha",
"=",
"numpy",
".",
"arctan",
"(",
"(",
"2",
"*",
"numpy",
".",
... | Returns local parameters for an oligomeric assembly.
Parameters
----------
pitch : float
Pitch of assembly
radius : float
Radius of assembly
oligo : int
Oligomeric state of assembly
Returns
-------
pitchloc : float
Local pitch of assembly (between 2 adja... | [
"Returns",
"local",
"parameters",
"for",
"an",
"oligomeric",
"assembly",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/analyse_protein.py#L264-L289 | train | 59,917 |
woolfson-group/isambard | isambard/ampal/analyse_protein.py | residues_per_turn | def residues_per_turn(p):
""" The number of residues per turn at each Monomer in the Polymer.
Notes
-----
Each element of the returned list is the number of residues
per turn, at a point on the Polymer primitive. Calculated using
the relative positions of the CA atoms and the primitive of the
... | python | def residues_per_turn(p):
""" The number of residues per turn at each Monomer in the Polymer.
Notes
-----
Each element of the returned list is the number of residues
per turn, at a point on the Polymer primitive. Calculated using
the relative positions of the CA atoms and the primitive of the
... | [
"def",
"residues_per_turn",
"(",
"p",
")",
":",
"cas",
"=",
"p",
".",
"get_reference_coords",
"(",
")",
"prim_cas",
"=",
"p",
".",
"primitive",
".",
"coordinates",
"dhs",
"=",
"[",
"abs",
"(",
"dihedral",
"(",
"cas",
"[",
"i",
"]",
",",
"prim_cas",
"... | The number of residues per turn at each Monomer in the Polymer.
Notes
-----
Each element of the returned list is the number of residues
per turn, at a point on the Polymer primitive. Calculated using
the relative positions of the CA atoms and the primitive of the
Polymer. Element i is the calcu... | [
"The",
"number",
"of",
"residues",
"per",
"turn",
"at",
"each",
"Monomer",
"in",
"the",
"Polymer",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/analyse_protein.py#L292-L320 | train | 59,918 |
woolfson-group/isambard | isambard/ampal/analyse_protein.py | polymer_to_reference_axis_distances | def polymer_to_reference_axis_distances(p, reference_axis, tag=True, reference_axis_name='ref_axis'):
"""Returns distances between the primitive of a Polymer and a reference_axis.
Notes
-----
Distances are calculated between each point of the Polymer primitive
and the corresponding point in referen... | python | def polymer_to_reference_axis_distances(p, reference_axis, tag=True, reference_axis_name='ref_axis'):
"""Returns distances between the primitive of a Polymer and a reference_axis.
Notes
-----
Distances are calculated between each point of the Polymer primitive
and the corresponding point in referen... | [
"def",
"polymer_to_reference_axis_distances",
"(",
"p",
",",
"reference_axis",
",",
"tag",
"=",
"True",
",",
"reference_axis_name",
"=",
"'ref_axis'",
")",
":",
"if",
"not",
"len",
"(",
"p",
")",
"==",
"len",
"(",
"reference_axis",
")",
":",
"raise",
"ValueE... | Returns distances between the primitive of a Polymer and a reference_axis.
Notes
-----
Distances are calculated between each point of the Polymer primitive
and the corresponding point in reference_axis. In the special case
of the helical barrel, if the Polymer is a helix and the reference_axis
... | [
"Returns",
"distances",
"between",
"the",
"primitive",
"of",
"a",
"Polymer",
"and",
"a",
"reference_axis",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/analyse_protein.py#L323-L375 | train | 59,919 |
woolfson-group/isambard | isambard/ampal/analyse_protein.py | crick_angles | def crick_angles(p, reference_axis, tag=True, reference_axis_name='ref_axis'):
"""Returns the Crick angle for each CA atom in the `Polymer`.
Notes
-----
The final value is in the returned list is `None`, since the angle
calculation requires pairs of points on both the primitive and
reference_ax... | python | def crick_angles(p, reference_axis, tag=True, reference_axis_name='ref_axis'):
"""Returns the Crick angle for each CA atom in the `Polymer`.
Notes
-----
The final value is in the returned list is `None`, since the angle
calculation requires pairs of points on both the primitive and
reference_ax... | [
"def",
"crick_angles",
"(",
"p",
",",
"reference_axis",
",",
"tag",
"=",
"True",
",",
"reference_axis_name",
"=",
"'ref_axis'",
")",
":",
"if",
"not",
"len",
"(",
"p",
")",
"==",
"len",
"(",
"reference_axis",
")",
":",
"raise",
"ValueError",
"(",
"\"The ... | Returns the Crick angle for each CA atom in the `Polymer`.
Notes
-----
The final value is in the returned list is `None`, since the angle
calculation requires pairs of points on both the primitive and
reference_axis.
Parameters
----------
p : ampal.Polymer
Reference `Polymer`.
... | [
"Returns",
"the",
"Crick",
"angle",
"for",
"each",
"CA",
"atom",
"in",
"the",
"Polymer",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/analyse_protein.py#L378-L428 | train | 59,920 |
woolfson-group/isambard | isambard/ampal/analyse_protein.py | alpha_angles | def alpha_angles(p, reference_axis, tag=True, reference_axis_name='ref_axis'):
"""Alpha angle calculated using points on the primitive of helix and axis.
Notes
-----
The final value is None, since the angle calculation requires pairs
of points along the primitive and axis. This is a generalisation
... | python | def alpha_angles(p, reference_axis, tag=True, reference_axis_name='ref_axis'):
"""Alpha angle calculated using points on the primitive of helix and axis.
Notes
-----
The final value is None, since the angle calculation requires pairs
of points along the primitive and axis. This is a generalisation
... | [
"def",
"alpha_angles",
"(",
"p",
",",
"reference_axis",
",",
"tag",
"=",
"True",
",",
"reference_axis_name",
"=",
"'ref_axis'",
")",
":",
"if",
"not",
"len",
"(",
"p",
")",
"==",
"len",
"(",
"reference_axis",
")",
":",
"raise",
"ValueError",
"(",
"\"The ... | Alpha angle calculated using points on the primitive of helix and axis.
Notes
-----
The final value is None, since the angle calculation requires pairs
of points along the primitive and axis. This is a generalisation
of the calculation used to measure the tilt of a helix in a
coiled-coil with r... | [
"Alpha",
"angle",
"calculated",
"using",
"points",
"on",
"the",
"primitive",
"of",
"helix",
"and",
"axis",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/analyse_protein.py#L431-L481 | train | 59,921 |
woolfson-group/isambard | isambard/ampal/analyse_protein.py | reference_axis_from_chains | def reference_axis_from_chains(chains):
"""Average coordinates from a set of primitives calculated from Chains.
Parameters
----------
chains : list(Chain)
Returns
-------
reference_axis : numpy.array
The averaged (x, y, z) coordinates of the primitives for
the list of Chain... | python | def reference_axis_from_chains(chains):
"""Average coordinates from a set of primitives calculated from Chains.
Parameters
----------
chains : list(Chain)
Returns
-------
reference_axis : numpy.array
The averaged (x, y, z) coordinates of the primitives for
the list of Chain... | [
"def",
"reference_axis_from_chains",
"(",
"chains",
")",
":",
"if",
"not",
"len",
"(",
"set",
"(",
"[",
"len",
"(",
"x",
")",
"for",
"x",
"in",
"chains",
"]",
")",
")",
"==",
"1",
":",
"raise",
"ValueError",
"(",
"\"All chains must be of the same length\""... | Average coordinates from a set of primitives calculated from Chains.
Parameters
----------
chains : list(Chain)
Returns
-------
reference_axis : numpy.array
The averaged (x, y, z) coordinates of the primitives for
the list of Chains. In the case of a coiled coil barrel,
... | [
"Average",
"coordinates",
"from",
"a",
"set",
"of",
"primitives",
"calculated",
"from",
"Chains",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/analyse_protein.py#L525-L563 | train | 59,922 |
woolfson-group/isambard | isambard/ampal/analyse_protein.py | flip_reference_axis_if_antiparallel | def flip_reference_axis_if_antiparallel(
p, reference_axis, start_index=0, end_index=-1):
"""Flips reference axis if direction opposes the direction of the `Polymer`.
Notes
-----
If the angle between the vector for the Polymer and the vector
for the reference_axis is > 90 degrees, then the ... | python | def flip_reference_axis_if_antiparallel(
p, reference_axis, start_index=0, end_index=-1):
"""Flips reference axis if direction opposes the direction of the `Polymer`.
Notes
-----
If the angle between the vector for the Polymer and the vector
for the reference_axis is > 90 degrees, then the ... | [
"def",
"flip_reference_axis_if_antiparallel",
"(",
"p",
",",
"reference_axis",
",",
"start_index",
"=",
"0",
",",
"end_index",
"=",
"-",
"1",
")",
":",
"p_vector",
"=",
"polypeptide_vector",
"(",
"p",
",",
"start_index",
"=",
"start_index",
",",
"end_index",
"... | Flips reference axis if direction opposes the direction of the `Polymer`.
Notes
-----
If the angle between the vector for the Polymer and the vector
for the reference_axis is > 90 degrees, then the reference axis
is reversed. This is useful to run before running
polymer_to_reference_axis_distan... | [
"Flips",
"reference",
"axis",
"if",
"direction",
"opposes",
"the",
"direction",
"of",
"the",
"Polymer",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/analyse_protein.py#L566-L599 | train | 59,923 |
woolfson-group/isambard | isambard/ampal/analyse_protein.py | make_primitive | def make_primitive(cas_coords, window_length=3):
"""Calculates running average of cas_coords with a fixed averaging window_length.
Parameters
----------
cas_coords : list(numpy.array or float or tuple)
Each element of the list must have length 3.
window_length : int, optional
The nu... | python | def make_primitive(cas_coords, window_length=3):
"""Calculates running average of cas_coords with a fixed averaging window_length.
Parameters
----------
cas_coords : list(numpy.array or float or tuple)
Each element of the list must have length 3.
window_length : int, optional
The nu... | [
"def",
"make_primitive",
"(",
"cas_coords",
",",
"window_length",
"=",
"3",
")",
":",
"if",
"len",
"(",
"cas_coords",
")",
">=",
"window_length",
":",
"primitive",
"=",
"[",
"]",
"count",
"=",
"0",
"for",
"_",
"in",
"cas_coords",
"[",
":",
"-",
"(",
... | Calculates running average of cas_coords with a fixed averaging window_length.
Parameters
----------
cas_coords : list(numpy.array or float or tuple)
Each element of the list must have length 3.
window_length : int, optional
The number of coordinate sets to average each time.
Retur... | [
"Calculates",
"running",
"average",
"of",
"cas_coords",
"with",
"a",
"fixed",
"averaging",
"window_length",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/analyse_protein.py#L602-L638 | train | 59,924 |
woolfson-group/isambard | isambard/ampal/analyse_protein.py | make_primitive_smoothed | def make_primitive_smoothed(cas_coords, smoothing_level=2):
""" Generates smoothed primitive from a list of coordinates.
Parameters
----------
cas_coords : list(numpy.array or float or tuple)
Each element of the list must have length 3.
smoothing_level : int, optional
Number of time... | python | def make_primitive_smoothed(cas_coords, smoothing_level=2):
""" Generates smoothed primitive from a list of coordinates.
Parameters
----------
cas_coords : list(numpy.array or float or tuple)
Each element of the list must have length 3.
smoothing_level : int, optional
Number of time... | [
"def",
"make_primitive_smoothed",
"(",
"cas_coords",
",",
"smoothing_level",
"=",
"2",
")",
":",
"try",
":",
"s_primitive",
"=",
"make_primitive",
"(",
"cas_coords",
")",
"for",
"x",
"in",
"range",
"(",
"smoothing_level",
")",
":",
"s_primitive",
"=",
"make_pr... | Generates smoothed primitive from a list of coordinates.
Parameters
----------
cas_coords : list(numpy.array or float or tuple)
Each element of the list must have length 3.
smoothing_level : int, optional
Number of times to run the averaging.
Returns
-------
s_primitive : l... | [
"Generates",
"smoothed",
"primitive",
"from",
"a",
"list",
"of",
"coordinates",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/analyse_protein.py#L641-L671 | train | 59,925 |
woolfson-group/isambard | isambard/ampal/analyse_protein.py | make_primitive_extrapolate_ends | def make_primitive_extrapolate_ends(cas_coords, smoothing_level=2):
"""Generates smoothed helix primitives and extrapolates lost ends.
Notes
-----
From an input list of CA coordinates, the running average is
calculated to form a primitive. The smoothing_level dictates how
many times to calculat... | python | def make_primitive_extrapolate_ends(cas_coords, smoothing_level=2):
"""Generates smoothed helix primitives and extrapolates lost ends.
Notes
-----
From an input list of CA coordinates, the running average is
calculated to form a primitive. The smoothing_level dictates how
many times to calculat... | [
"def",
"make_primitive_extrapolate_ends",
"(",
"cas_coords",
",",
"smoothing_level",
"=",
"2",
")",
":",
"try",
":",
"smoothed_primitive",
"=",
"make_primitive_smoothed",
"(",
"cas_coords",
",",
"smoothing_level",
"=",
"smoothing_level",
")",
"except",
"ValueError",
"... | Generates smoothed helix primitives and extrapolates lost ends.
Notes
-----
From an input list of CA coordinates, the running average is
calculated to form a primitive. The smoothing_level dictates how
many times to calculate the running average. A higher
smoothing_level generates a 'smoother' ... | [
"Generates",
"smoothed",
"helix",
"primitives",
"and",
"extrapolates",
"lost",
"ends",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/analyse_protein.py#L674-L724 | train | 59,926 |
woolfson-group/isambard | isambard/ampal/assembly.py | AmpalContainer.extend | def extend(self, ampal_container):
"""Extends an `AmpalContainer` with another `AmpalContainer`."""
if isinstance(ampal_container, AmpalContainer):
self._ampal_objects.extend(ampal_container)
else:
raise TypeError(
'Only AmpalContainer objects may be merge... | python | def extend(self, ampal_container):
"""Extends an `AmpalContainer` with another `AmpalContainer`."""
if isinstance(ampal_container, AmpalContainer):
self._ampal_objects.extend(ampal_container)
else:
raise TypeError(
'Only AmpalContainer objects may be merge... | [
"def",
"extend",
"(",
"self",
",",
"ampal_container",
")",
":",
"if",
"isinstance",
"(",
"ampal_container",
",",
"AmpalContainer",
")",
":",
"self",
".",
"_ampal_objects",
".",
"extend",
"(",
"ampal_container",
")",
"else",
":",
"raise",
"TypeError",
"(",
"'... | Extends an `AmpalContainer` with another `AmpalContainer`. | [
"Extends",
"an",
"AmpalContainer",
"with",
"another",
"AmpalContainer",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/assembly.py#L82-L90 | train | 59,927 |
woolfson-group/isambard | isambard/ampal/assembly.py | AmpalContainer.pdb | def pdb(self):
"""Compiles the PDB strings for each state into a single file."""
header_title = '{:<80}\n'.format('HEADER {}'.format(self.id))
data_type = '{:<80}\n'.format('EXPDTA ISAMBARD Model')
pdb_strs = []
for ampal in self:
if isinstance(ampal, Assembly):... | python | def pdb(self):
"""Compiles the PDB strings for each state into a single file."""
header_title = '{:<80}\n'.format('HEADER {}'.format(self.id))
data_type = '{:<80}\n'.format('EXPDTA ISAMBARD Model')
pdb_strs = []
for ampal in self:
if isinstance(ampal, Assembly):... | [
"def",
"pdb",
"(",
"self",
")",
":",
"header_title",
"=",
"'{:<80}\\n'",
".",
"format",
"(",
"'HEADER {}'",
".",
"format",
"(",
"self",
".",
"id",
")",
")",
"data_type",
"=",
"'{:<80}\\n'",
".",
"format",
"(",
"'EXPDTA ISAMBARD Model'",
")",
"pdb_strs"... | Compiles the PDB strings for each state into a single file. | [
"Compiles",
"the",
"PDB",
"strings",
"for",
"each",
"state",
"into",
"a",
"single",
"file",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/assembly.py#L93-L106 | train | 59,928 |
woolfson-group/isambard | isambard/ampal/assembly.py | AmpalContainer.sort_by_tag | def sort_by_tag(self, tag):
"""Sorts the `AmpalContainer` by a tag on the component objects.
Parameters
----------
tag : str
Key of tag used for sorting.
"""
return AmpalContainer(sorted(self, key=lambda x: x.tags[tag])) | python | def sort_by_tag(self, tag):
"""Sorts the `AmpalContainer` by a tag on the component objects.
Parameters
----------
tag : str
Key of tag used for sorting.
"""
return AmpalContainer(sorted(self, key=lambda x: x.tags[tag])) | [
"def",
"sort_by_tag",
"(",
"self",
",",
"tag",
")",
":",
"return",
"AmpalContainer",
"(",
"sorted",
"(",
"self",
",",
"key",
"=",
"lambda",
"x",
":",
"x",
".",
"tags",
"[",
"tag",
"]",
")",
")"
] | Sorts the `AmpalContainer` by a tag on the component objects.
Parameters
----------
tag : str
Key of tag used for sorting. | [
"Sorts",
"the",
"AmpalContainer",
"by",
"a",
"tag",
"on",
"the",
"component",
"objects",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/assembly.py#L108-L116 | train | 59,929 |
woolfson-group/isambard | isambard/ampal/assembly.py | Assembly.append | def append(self, item):
"""Adds a `Polymer` to the `Assembly`.
Raises
------
TypeError
Raised if other is any type other than `Polymer`.
"""
if isinstance(item, Polymer):
self._molecules.append(item)
else:
raise TypeError(
... | python | def append(self, item):
"""Adds a `Polymer` to the `Assembly`.
Raises
------
TypeError
Raised if other is any type other than `Polymer`.
"""
if isinstance(item, Polymer):
self._molecules.append(item)
else:
raise TypeError(
... | [
"def",
"append",
"(",
"self",
",",
"item",
")",
":",
"if",
"isinstance",
"(",
"item",
",",
"Polymer",
")",
":",
"self",
".",
"_molecules",
".",
"append",
"(",
"item",
")",
"else",
":",
"raise",
"TypeError",
"(",
"'Only Polymer objects can be appended to an A... | Adds a `Polymer` to the `Assembly`.
Raises
------
TypeError
Raised if other is any type other than `Polymer`. | [
"Adds",
"a",
"Polymer",
"to",
"the",
"Assembly",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/assembly.py#L216-L229 | train | 59,930 |
woolfson-group/isambard | isambard/ampal/assembly.py | Assembly.extend | def extend(self, assembly):
"""Extends the `Assembly` with the contents of another `Assembly`.
Raises
------
TypeError
Raised if other is any type other than `Assembly`.
"""
if isinstance(assembly, Assembly):
self._molecules.extend(assembly)
... | python | def extend(self, assembly):
"""Extends the `Assembly` with the contents of another `Assembly`.
Raises
------
TypeError
Raised if other is any type other than `Assembly`.
"""
if isinstance(assembly, Assembly):
self._molecules.extend(assembly)
... | [
"def",
"extend",
"(",
"self",
",",
"assembly",
")",
":",
"if",
"isinstance",
"(",
"assembly",
",",
"Assembly",
")",
":",
"self",
".",
"_molecules",
".",
"extend",
"(",
"assembly",
")",
"else",
":",
"raise",
"TypeError",
"(",
"'Only Assembly objects may be me... | Extends the `Assembly` with the contents of another `Assembly`.
Raises
------
TypeError
Raised if other is any type other than `Assembly`. | [
"Extends",
"the",
"Assembly",
"with",
"the",
"contents",
"of",
"another",
"Assembly",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/assembly.py#L231-L244 | train | 59,931 |
woolfson-group/isambard | isambard/ampal/assembly.py | Assembly.get_monomers | def get_monomers(self, ligands=True, pseudo_group=False):
"""Retrieves all the `Monomers` from the `Assembly` object.
Parameters
----------
ligands : bool, optional
If `true`, will include ligand `Monomers`.
pseudo_group : bool, optional
If `True`, will i... | python | def get_monomers(self, ligands=True, pseudo_group=False):
"""Retrieves all the `Monomers` from the `Assembly` object.
Parameters
----------
ligands : bool, optional
If `true`, will include ligand `Monomers`.
pseudo_group : bool, optional
If `True`, will i... | [
"def",
"get_monomers",
"(",
"self",
",",
"ligands",
"=",
"True",
",",
"pseudo_group",
"=",
"False",
")",
":",
"base_filters",
"=",
"dict",
"(",
"ligands",
"=",
"ligands",
",",
"pseudo_group",
"=",
"pseudo_group",
")",
"restricted_mol_types",
"=",
"[",
"x",
... | Retrieves all the `Monomers` from the `Assembly` object.
Parameters
----------
ligands : bool, optional
If `true`, will include ligand `Monomers`.
pseudo_group : bool, optional
If `True`, will include pseudo atoms. | [
"Retrieves",
"all",
"the",
"Monomers",
"from",
"the",
"Assembly",
"object",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/assembly.py#L246-L261 | train | 59,932 |
woolfson-group/isambard | isambard/ampal/assembly.py | Assembly.get_ligands | def get_ligands(self, solvent=True):
"""Retrieves all ligands from the `Assembly`.
Parameters
----------
solvent : bool, optional
If `True`, solvent molecules will be included.
"""
if solvent:
ligand_list = [x for x in self.get_monomers()
... | python | def get_ligands(self, solvent=True):
"""Retrieves all ligands from the `Assembly`.
Parameters
----------
solvent : bool, optional
If `True`, solvent molecules will be included.
"""
if solvent:
ligand_list = [x for x in self.get_monomers()
... | [
"def",
"get_ligands",
"(",
"self",
",",
"solvent",
"=",
"True",
")",
":",
"if",
"solvent",
":",
"ligand_list",
"=",
"[",
"x",
"for",
"x",
"in",
"self",
".",
"get_monomers",
"(",
")",
"if",
"isinstance",
"(",
"x",
",",
"Ligand",
")",
"]",
"else",
":... | Retrieves all ligands from the `Assembly`.
Parameters
----------
solvent : bool, optional
If `True`, solvent molecules will be included. | [
"Retrieves",
"all",
"ligands",
"from",
"the",
"Assembly",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/assembly.py#L263-L277 | train | 59,933 |
woolfson-group/isambard | isambard/ampal/assembly.py | Assembly.get_atoms | def get_atoms(self, ligands=True, pseudo_group=False, inc_alt_states=False):
""" Flat list of all the `Atoms` in the `Assembly`.
Parameters
----------
ligands : bool, optional
Include ligand `Atoms`.
pseudo_group : bool, optional
Include pseudo_group `Ato... | python | def get_atoms(self, ligands=True, pseudo_group=False, inc_alt_states=False):
""" Flat list of all the `Atoms` in the `Assembly`.
Parameters
----------
ligands : bool, optional
Include ligand `Atoms`.
pseudo_group : bool, optional
Include pseudo_group `Ato... | [
"def",
"get_atoms",
"(",
"self",
",",
"ligands",
"=",
"True",
",",
"pseudo_group",
"=",
"False",
",",
"inc_alt_states",
"=",
"False",
")",
":",
"atoms",
"=",
"itertools",
".",
"chain",
"(",
"*",
"(",
"list",
"(",
"m",
".",
"get_atoms",
"(",
"inc_alt_st... | Flat list of all the `Atoms` in the `Assembly`.
Parameters
----------
ligands : bool, optional
Include ligand `Atoms`.
pseudo_group : bool, optional
Include pseudo_group `Atoms`.
inc_alt_states : bool, optional
Include alternate sidechain conf... | [
"Flat",
"list",
"of",
"all",
"the",
"Atoms",
"in",
"the",
"Assembly",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/assembly.py#L279-L300 | train | 59,934 |
woolfson-group/isambard | isambard/ampal/assembly.py | Assembly.is_within | def is_within(self, cutoff_dist, point, ligands=True):
"""Returns all atoms in AMPAL object within `cut-off` distance from the `point`."""
return find_atoms_within_distance(self.get_atoms(ligands=ligands), cutoff_dist, point) | python | def is_within(self, cutoff_dist, point, ligands=True):
"""Returns all atoms in AMPAL object within `cut-off` distance from the `point`."""
return find_atoms_within_distance(self.get_atoms(ligands=ligands), cutoff_dist, point) | [
"def",
"is_within",
"(",
"self",
",",
"cutoff_dist",
",",
"point",
",",
"ligands",
"=",
"True",
")",
":",
"return",
"find_atoms_within_distance",
"(",
"self",
".",
"get_atoms",
"(",
"ligands",
"=",
"ligands",
")",
",",
"cutoff_dist",
",",
"point",
")"
] | Returns all atoms in AMPAL object within `cut-off` distance from the `point`. | [
"Returns",
"all",
"atoms",
"in",
"AMPAL",
"object",
"within",
"cut",
"-",
"off",
"distance",
"from",
"the",
"point",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/assembly.py#L302-L304 | train | 59,935 |
woolfson-group/isambard | isambard/ampal/assembly.py | Assembly.relabel_polymers | def relabel_polymers(self, labels=None):
"""Relabels the component Polymers either in alphabetical order or using a list of labels.
Parameters
----------
labels : list, optional
A list of new labels.
Raises
------
ValueError
Raised if the... | python | def relabel_polymers(self, labels=None):
"""Relabels the component Polymers either in alphabetical order or using a list of labels.
Parameters
----------
labels : list, optional
A list of new labels.
Raises
------
ValueError
Raised if the... | [
"def",
"relabel_polymers",
"(",
"self",
",",
"labels",
"=",
"None",
")",
":",
"if",
"labels",
":",
"if",
"len",
"(",
"self",
".",
"_molecules",
")",
"==",
"len",
"(",
"labels",
")",
":",
"for",
"polymer",
",",
"label",
"in",
"zip",
"(",
"self",
"."... | Relabels the component Polymers either in alphabetical order or using a list of labels.
Parameters
----------
labels : list, optional
A list of new labels.
Raises
------
ValueError
Raised if the number of labels does not match the number of compo... | [
"Relabels",
"the",
"component",
"Polymers",
"either",
"in",
"alphabetical",
"order",
"or",
"using",
"a",
"list",
"of",
"labels",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/assembly.py#L313-L336 | train | 59,936 |
woolfson-group/isambard | isambard/ampal/assembly.py | Assembly.relabel_atoms | def relabel_atoms(self, start=1):
"""Relabels all Atoms in numerical order, offset by the start parameter.
Parameters
----------
start : int, optional
Defines an offset for the labelling.
"""
counter = start
for atom in self.get_atoms(ligands=True):
... | python | def relabel_atoms(self, start=1):
"""Relabels all Atoms in numerical order, offset by the start parameter.
Parameters
----------
start : int, optional
Defines an offset for the labelling.
"""
counter = start
for atom in self.get_atoms(ligands=True):
... | [
"def",
"relabel_atoms",
"(",
"self",
",",
"start",
"=",
"1",
")",
":",
"counter",
"=",
"start",
"for",
"atom",
"in",
"self",
".",
"get_atoms",
"(",
"ligands",
"=",
"True",
")",
":",
"atom",
".",
"id",
"=",
"counter",
"counter",
"+=",
"1",
"return"
] | Relabels all Atoms in numerical order, offset by the start parameter.
Parameters
----------
start : int, optional
Defines an offset for the labelling. | [
"Relabels",
"all",
"Atoms",
"in",
"numerical",
"order",
"offset",
"by",
"the",
"start",
"parameter",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/assembly.py#L344-L356 | train | 59,937 |
woolfson-group/isambard | isambard/ampal/assembly.py | Assembly.make_pdb | def make_pdb(self, ligands=True, alt_states=False, pseudo_group=False, header=True, footer=True):
"""Generates a PDB string for the Assembly.
Parameters
----------
ligands : bool, optional
If `True`, will include ligands in the output.
alt_states : bool, optional
... | python | def make_pdb(self, ligands=True, alt_states=False, pseudo_group=False, header=True, footer=True):
"""Generates a PDB string for the Assembly.
Parameters
----------
ligands : bool, optional
If `True`, will include ligands in the output.
alt_states : bool, optional
... | [
"def",
"make_pdb",
"(",
"self",
",",
"ligands",
"=",
"True",
",",
"alt_states",
"=",
"False",
",",
"pseudo_group",
"=",
"False",
",",
"header",
"=",
"True",
",",
"footer",
"=",
"True",
")",
":",
"base_filters",
"=",
"dict",
"(",
"ligands",
"=",
"ligand... | Generates a PDB string for the Assembly.
Parameters
----------
ligands : bool, optional
If `True`, will include ligands in the output.
alt_states : bool, optional
If `True`, will include alternate conformations in the output.
pseudo_group : bool, optional... | [
"Generates",
"a",
"PDB",
"string",
"for",
"the",
"Assembly",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/assembly.py#L363-L395 | train | 59,938 |
woolfson-group/isambard | isambard/ampal/assembly.py | Assembly.backbone | def backbone(self):
"""Generates a new `Assembly` containing only the backbone atoms.
Notes
-----
Metadata is not currently preserved from the parent object.
Sequence data is retained, but only the main chain atoms are
retained.
Returns
-------
b... | python | def backbone(self):
"""Generates a new `Assembly` containing only the backbone atoms.
Notes
-----
Metadata is not currently preserved from the parent object.
Sequence data is retained, but only the main chain atoms are
retained.
Returns
-------
b... | [
"def",
"backbone",
"(",
"self",
")",
":",
"bb_molecules",
"=",
"[",
"p",
".",
"backbone",
"for",
"p",
"in",
"self",
".",
"_molecules",
"if",
"hasattr",
"(",
"p",
",",
"'backbone'",
")",
"]",
"bb_assembly",
"=",
"Assembly",
"(",
"bb_molecules",
",",
"as... | Generates a new `Assembly` containing only the backbone atoms.
Notes
-----
Metadata is not currently preserved from the parent object.
Sequence data is retained, but only the main chain atoms are
retained.
Returns
-------
bb_assembly : ampal.Protein
... | [
"Generates",
"a",
"new",
"Assembly",
"containing",
"only",
"the",
"backbone",
"atoms",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/assembly.py#L399-L417 | train | 59,939 |
woolfson-group/isambard | isambard/ampal/assembly.py | Assembly.primitives | def primitives(self):
"""Generates a new `Assembly` containing the primitives of each Polymer.
Notes
-----
Metadata is not currently preserved from the parent object.
Returns
-------
prim_assembly : ampal.Protein
`Assembly` containing only the primit... | python | def primitives(self):
"""Generates a new `Assembly` containing the primitives of each Polymer.
Notes
-----
Metadata is not currently preserved from the parent object.
Returns
-------
prim_assembly : ampal.Protein
`Assembly` containing only the primit... | [
"def",
"primitives",
"(",
"self",
")",
":",
"prim_molecules",
"=",
"[",
"p",
".",
"primitive",
"for",
"p",
"in",
"self",
".",
"_molecules",
"if",
"hasattr",
"(",
"p",
",",
"'primitive'",
")",
"]",
"prim_assembly",
"=",
"Assembly",
"(",
"molecules",
"=",
... | Generates a new `Assembly` containing the primitives of each Polymer.
Notes
-----
Metadata is not currently preserved from the parent object.
Returns
-------
prim_assembly : ampal.Protein
`Assembly` containing only the primitives of the `Polymers`
... | [
"Generates",
"a",
"new",
"Assembly",
"containing",
"the",
"primitives",
"of",
"each",
"Polymer",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/assembly.py#L420-L436 | train | 59,940 |
woolfson-group/isambard | isambard/ampal/assembly.py | Assembly.sequences | def sequences(self):
"""Returns the sequence of each `Polymer` in the `Assembly` as a list.
Returns
-------
sequences : [str]
List of sequences.
"""
seqs = [x.sequence for x in self._molecules if hasattr(x, 'sequence')]
return seqs | python | def sequences(self):
"""Returns the sequence of each `Polymer` in the `Assembly` as a list.
Returns
-------
sequences : [str]
List of sequences.
"""
seqs = [x.sequence for x in self._molecules if hasattr(x, 'sequence')]
return seqs | [
"def",
"sequences",
"(",
"self",
")",
":",
"seqs",
"=",
"[",
"x",
".",
"sequence",
"for",
"x",
"in",
"self",
".",
"_molecules",
"if",
"hasattr",
"(",
"x",
",",
"'sequence'",
")",
"]",
"return",
"seqs"
] | Returns the sequence of each `Polymer` in the `Assembly` as a list.
Returns
-------
sequences : [str]
List of sequences. | [
"Returns",
"the",
"sequence",
"of",
"each",
"Polymer",
"in",
"the",
"Assembly",
"as",
"a",
"list",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/assembly.py#L477-L486 | train | 59,941 |
woolfson-group/isambard | isambard/ampal/assembly.py | Assembly.fasta | def fasta(self):
"""Generates a FASTA string for the `Assembly`.
Notes
-----
Explanation of FASTA format: https://en.wikipedia.org/wiki/FASTA_format
Recommendation that all lines of text be shorter than 80
characters is adhered to. Format of PDBID|CHAIN|SEQUENCE is
... | python | def fasta(self):
"""Generates a FASTA string for the `Assembly`.
Notes
-----
Explanation of FASTA format: https://en.wikipedia.org/wiki/FASTA_format
Recommendation that all lines of text be shorter than 80
characters is adhered to. Format of PDBID|CHAIN|SEQUENCE is
... | [
"def",
"fasta",
"(",
"self",
")",
":",
"fasta_str",
"=",
"''",
"max_line_length",
"=",
"79",
"for",
"p",
"in",
"self",
".",
"_molecules",
":",
"if",
"hasattr",
"(",
"p",
",",
"'sequence'",
")",
":",
"fasta_str",
"+=",
"'>{0}:{1}|PDBID|CHAIN|SEQUENCE\\n'",
... | Generates a FASTA string for the `Assembly`.
Notes
-----
Explanation of FASTA format: https://en.wikipedia.org/wiki/FASTA_format
Recommendation that all lines of text be shorter than 80
characters is adhered to. Format of PDBID|CHAIN|SEQUENCE is
consistent with files do... | [
"Generates",
"a",
"FASTA",
"string",
"for",
"the",
"Assembly",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/assembly.py#L504-L532 | train | 59,942 |
woolfson-group/isambard | isambard/ampal/assembly.py | Assembly.get_interaction_energy | def get_interaction_energy(self, assign_ff=True, ff=None, mol2=False,
force_ff_assign=False):
"""Calculates the interaction energy of the AMPAL object.
Parameters
----------
assign_ff: bool, optional
If true the force field will be updated if r... | python | def get_interaction_energy(self, assign_ff=True, ff=None, mol2=False,
force_ff_assign=False):
"""Calculates the interaction energy of the AMPAL object.
Parameters
----------
assign_ff: bool, optional
If true the force field will be updated if r... | [
"def",
"get_interaction_energy",
"(",
"self",
",",
"assign_ff",
"=",
"True",
",",
"ff",
"=",
"None",
",",
"mol2",
"=",
"False",
",",
"force_ff_assign",
"=",
"False",
")",
":",
"if",
"not",
"ff",
":",
"ff",
"=",
"global_settings",
"[",
"'buff'",
"]",
"[... | Calculates the interaction energy of the AMPAL object.
Parameters
----------
assign_ff: bool, optional
If true the force field will be updated if required.
ff: BuffForceField, optional
The force field to be used for scoring.
mol2: bool, optional
... | [
"Calculates",
"the",
"interaction",
"energy",
"of",
"the",
"AMPAL",
"object",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/assembly.py#L534-L576 | train | 59,943 |
woolfson-group/isambard | isambard/ampal/assembly.py | Assembly.pack_new_sequences | def pack_new_sequences(self, sequences):
"""Packs a new sequence onto each Polymer in the Assembly using Scwrl4.
Notes
-----
The Scwrl packing score is saved in `Assembly.tags['scwrl_score']`
for reference.
Scwrl must be available to call. Check by running
`isam... | python | def pack_new_sequences(self, sequences):
"""Packs a new sequence onto each Polymer in the Assembly using Scwrl4.
Notes
-----
The Scwrl packing score is saved in `Assembly.tags['scwrl_score']`
for reference.
Scwrl must be available to call. Check by running
`isam... | [
"def",
"pack_new_sequences",
"(",
"self",
",",
"sequences",
")",
":",
"from",
"ampal",
".",
"pdb_parser",
"import",
"convert_pdb_to_ampal",
"assembly_bb",
"=",
"self",
".",
"backbone",
"total_seq_len",
"=",
"sum",
"(",
"[",
"len",
"(",
"x",
")",
"for",
"x",
... | Packs a new sequence onto each Polymer in the Assembly using Scwrl4.
Notes
-----
The Scwrl packing score is saved in `Assembly.tags['scwrl_score']`
for reference.
Scwrl must be available to call. Check by running
`isambard.external_programs.scwrl.test_scwrl`. If Scwrl i... | [
"Packs",
"a",
"new",
"sequence",
"onto",
"each",
"Polymer",
"in",
"the",
"Assembly",
"using",
"Scwrl4",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/assembly.py#L633-L684 | train | 59,944 |
woolfson-group/isambard | isambard/ampal/assembly.py | Assembly.repack_all | def repack_all(self):
"""Repacks the side chains of all Polymers in the Assembly."""
non_na_sequences = [s for s in self.sequences if ' ' not in s]
self.pack_new_sequences(non_na_sequences)
return | python | def repack_all(self):
"""Repacks the side chains of all Polymers in the Assembly."""
non_na_sequences = [s for s in self.sequences if ' ' not in s]
self.pack_new_sequences(non_na_sequences)
return | [
"def",
"repack_all",
"(",
"self",
")",
":",
"non_na_sequences",
"=",
"[",
"s",
"for",
"s",
"in",
"self",
".",
"sequences",
"if",
"' '",
"not",
"in",
"s",
"]",
"self",
".",
"pack_new_sequences",
"(",
"non_na_sequences",
")",
"return"
] | Repacks the side chains of all Polymers in the Assembly. | [
"Repacks",
"the",
"side",
"chains",
"of",
"all",
"Polymers",
"in",
"the",
"Assembly",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/assembly.py#L686-L690 | train | 59,945 |
woolfson-group/isambard | isambard/ampal/assembly.py | Assembly.tag_secondary_structure | def tag_secondary_structure(self, force=False):
"""Tags each `Monomer` in the `Assembly` with it's secondary structure.
Notes
-----
DSSP must be available to call. Check by running
`isambard.external_programs.dssp.test_dssp`. If DSSP is not
available, please follow instr... | python | def tag_secondary_structure(self, force=False):
"""Tags each `Monomer` in the `Assembly` with it's secondary structure.
Notes
-----
DSSP must be available to call. Check by running
`isambard.external_programs.dssp.test_dssp`. If DSSP is not
available, please follow instr... | [
"def",
"tag_secondary_structure",
"(",
"self",
",",
"force",
"=",
"False",
")",
":",
"for",
"polymer",
"in",
"self",
".",
"_molecules",
":",
"if",
"polymer",
".",
"molecule_type",
"==",
"'protein'",
":",
"polymer",
".",
"tag_secondary_structure",
"(",
"force",... | Tags each `Monomer` in the `Assembly` with it's secondary structure.
Notes
-----
DSSP must be available to call. Check by running
`isambard.external_programs.dssp.test_dssp`. If DSSP is not
available, please follow instruction here to add it:
https://github.com/woolfson-... | [
"Tags",
"each",
"Monomer",
"in",
"the",
"Assembly",
"with",
"it",
"s",
"secondary",
"structure",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/assembly.py#L692-L718 | train | 59,946 |
woolfson-group/isambard | isambard/ampal/assembly.py | Assembly.tag_dssp_solvent_accessibility | def tag_dssp_solvent_accessibility(self, force=False):
"""Tags each `Monomer` in the Assembly with its solvent accessibility.
Notes
-----
For more about DSSP's solvent accessibilty metric, see:
http://swift.cmbi.ru.nl/gv/dssp/HTML/descrip.html#ACC
DSSP must be avail... | python | def tag_dssp_solvent_accessibility(self, force=False):
"""Tags each `Monomer` in the Assembly with its solvent accessibility.
Notes
-----
For more about DSSP's solvent accessibilty metric, see:
http://swift.cmbi.ru.nl/gv/dssp/HTML/descrip.html#ACC
DSSP must be avail... | [
"def",
"tag_dssp_solvent_accessibility",
"(",
"self",
",",
"force",
"=",
"False",
")",
":",
"for",
"polymer",
"in",
"self",
".",
"_molecules",
":",
"polymer",
".",
"tag_dssp_solvent_accessibility",
"(",
"force",
"=",
"force",
")",
"return"
] | Tags each `Monomer` in the Assembly with its solvent accessibility.
Notes
-----
For more about DSSP's solvent accessibilty metric, see:
http://swift.cmbi.ru.nl/gv/dssp/HTML/descrip.html#ACC
DSSP must be available to call. Check by running
`isambard.external_programs... | [
"Tags",
"each",
"Monomer",
"in",
"the",
"Assembly",
"with",
"its",
"solvent",
"accessibility",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/assembly.py#L720-L748 | train | 59,947 |
woolfson-group/isambard | isambard/ampal/assembly.py | Assembly.tag_torsion_angles | def tag_torsion_angles(self, force=False):
"""Tags each `Monomer` in the `Assembly` with its torsion angles.
Parameters
----------
force : bool, optional
If `True`, the tag will be run even if `Monomers` are already
tagged.
"""
for polymer in self... | python | def tag_torsion_angles(self, force=False):
"""Tags each `Monomer` in the `Assembly` with its torsion angles.
Parameters
----------
force : bool, optional
If `True`, the tag will be run even if `Monomers` are already
tagged.
"""
for polymer in self... | [
"def",
"tag_torsion_angles",
"(",
"self",
",",
"force",
"=",
"False",
")",
":",
"for",
"polymer",
"in",
"self",
".",
"_molecules",
":",
"if",
"polymer",
".",
"molecule_type",
"==",
"'protein'",
":",
"polymer",
".",
"tag_torsion_angles",
"(",
"force",
"=",
... | Tags each `Monomer` in the `Assembly` with its torsion angles.
Parameters
----------
force : bool, optional
If `True`, the tag will be run even if `Monomers` are already
tagged. | [
"Tags",
"each",
"Monomer",
"in",
"the",
"Assembly",
"with",
"its",
"torsion",
"angles",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/assembly.py#L750-L762 | train | 59,948 |
woolfson-group/isambard | isambard/ampal/assembly.py | Assembly.tag_ca_geometry | def tag_ca_geometry(self, force=False, reference_axis=None,
reference_axis_name='ref_axis'):
"""Tags each `Monomer` in the `Assembly` with its helical geometry.
Parameters
----------
force : bool, optional
If True the tag will be run even if `Monomers... | python | def tag_ca_geometry(self, force=False, reference_axis=None,
reference_axis_name='ref_axis'):
"""Tags each `Monomer` in the `Assembly` with its helical geometry.
Parameters
----------
force : bool, optional
If True the tag will be run even if `Monomers... | [
"def",
"tag_ca_geometry",
"(",
"self",
",",
"force",
"=",
"False",
",",
"reference_axis",
"=",
"None",
",",
"reference_axis_name",
"=",
"'ref_axis'",
")",
":",
"for",
"polymer",
"in",
"self",
".",
"_molecules",
":",
"if",
"polymer",
".",
"molecule_type",
"==... | Tags each `Monomer` in the `Assembly` with its helical geometry.
Parameters
----------
force : bool, optional
If True the tag will be run even if `Monomers` are already tagged.
reference_axis : list(numpy.array or tuple or list), optional
Coordinates to feed to g... | [
"Tags",
"each",
"Monomer",
"in",
"the",
"Assembly",
"with",
"its",
"helical",
"geometry",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/assembly.py#L764-L783 | train | 59,949 |
woolfson-group/isambard | isambard/ampal/assembly.py | Assembly.tag_atoms_unique_ids | def tag_atoms_unique_ids(self, force=False):
""" Tags each Atom in the Assembly with its unique_id.
Notes
-----
The unique_id for each atom is a tuple (a double). `unique_id[0]`
is the unique_id for its parent `Monomer` (see `Monomer.unique_id`
for more information). `un... | python | def tag_atoms_unique_ids(self, force=False):
""" Tags each Atom in the Assembly with its unique_id.
Notes
-----
The unique_id for each atom is a tuple (a double). `unique_id[0]`
is the unique_id for its parent `Monomer` (see `Monomer.unique_id`
for more information). `un... | [
"def",
"tag_atoms_unique_ids",
"(",
"self",
",",
"force",
"=",
"False",
")",
":",
"tagged",
"=",
"[",
"'unique_id'",
"in",
"x",
".",
"tags",
".",
"keys",
"(",
")",
"for",
"x",
"in",
"self",
".",
"get_atoms",
"(",
")",
"]",
"if",
"(",
"not",
"all",
... | Tags each Atom in the Assembly with its unique_id.
Notes
-----
The unique_id for each atom is a tuple (a double). `unique_id[0]`
is the unique_id for its parent `Monomer` (see `Monomer.unique_id`
for more information). `unique_id[1]` is the atom_type in the
`Assembly` as... | [
"Tags",
"each",
"Atom",
"in",
"the",
"Assembly",
"with",
"its",
"unique_id",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/assembly.py#L785-L807 | train | 59,950 |
woolfson-group/isambard | isambard/ampal/non_canonical.py | convert_pro_to_hyp | def convert_pro_to_hyp(pro):
"""Converts a pro residue to a hydroxypro residue.
All metadata associated with the original pro will be lost i.e. tags.
As a consequence, it is advisable to relabel all atoms in the structure
in order to make them contiguous.
Parameters
----------
pro: ampal.R... | python | def convert_pro_to_hyp(pro):
"""Converts a pro residue to a hydroxypro residue.
All metadata associated with the original pro will be lost i.e. tags.
As a consequence, it is advisable to relabel all atoms in the structure
in order to make them contiguous.
Parameters
----------
pro: ampal.R... | [
"def",
"convert_pro_to_hyp",
"(",
"pro",
")",
":",
"with",
"open",
"(",
"str",
"(",
"REF_PATH",
"/",
"'hydroxyproline_ref_1bkv_0_6.pickle'",
")",
",",
"'rb'",
")",
"as",
"inf",
":",
"hyp_ref",
"=",
"pickle",
".",
"load",
"(",
"inf",
")",
"align_nab",
"(",
... | Converts a pro residue to a hydroxypro residue.
All metadata associated with the original pro will be lost i.e. tags.
As a consequence, it is advisable to relabel all atoms in the structure
in order to make them contiguous.
Parameters
----------
pro: ampal.Residue
The proline residue t... | [
"Converts",
"a",
"pro",
"residue",
"to",
"a",
"hydroxypro",
"residue",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/non_canonical.py#L16-L66 | train | 59,951 |
woolfson-group/isambard | isambard/ampal/non_canonical.py | align_nab | def align_nab(tar, ref):
"""Aligns the N-CA and CA-CB vector of the target monomer.
Parameters
----------
tar: ampal.Residue
The residue that will be aligned to the reference.
ref: ampal.Residue
The reference residue for the alignment.
"""
rot_trans_1 = find_transformations(... | python | def align_nab(tar, ref):
"""Aligns the N-CA and CA-CB vector of the target monomer.
Parameters
----------
tar: ampal.Residue
The residue that will be aligned to the reference.
ref: ampal.Residue
The reference residue for the alignment.
"""
rot_trans_1 = find_transformations(... | [
"def",
"align_nab",
"(",
"tar",
",",
"ref",
")",
":",
"rot_trans_1",
"=",
"find_transformations",
"(",
"tar",
"[",
"'N'",
"]",
".",
"array",
",",
"tar",
"[",
"'CA'",
"]",
".",
"array",
",",
"ref",
"[",
"'N'",
"]",
".",
"array",
",",
"ref",
"[",
"... | Aligns the N-CA and CA-CB vector of the target monomer.
Parameters
----------
tar: ampal.Residue
The residue that will be aligned to the reference.
ref: ampal.Residue
The reference residue for the alignment. | [
"Aligns",
"the",
"N",
"-",
"CA",
"and",
"CA",
"-",
"CB",
"vector",
"of",
"the",
"target",
"monomer",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/non_canonical.py#L69-L84 | train | 59,952 |
woolfson-group/isambard | isambard/ampal/non_canonical.py | apply_trans_rot | def apply_trans_rot(ampal, translation, angle, axis, point, radians=False):
"""Applies a translation and rotation to an AMPAL object."""
if not numpy.isclose(angle, 0.0):
ampal.rotate(angle=angle, axis=axis, point=point, radians=radians)
ampal.translate(vector=translation)
return | python | def apply_trans_rot(ampal, translation, angle, axis, point, radians=False):
"""Applies a translation and rotation to an AMPAL object."""
if not numpy.isclose(angle, 0.0):
ampal.rotate(angle=angle, axis=axis, point=point, radians=radians)
ampal.translate(vector=translation)
return | [
"def",
"apply_trans_rot",
"(",
"ampal",
",",
"translation",
",",
"angle",
",",
"axis",
",",
"point",
",",
"radians",
"=",
"False",
")",
":",
"if",
"not",
"numpy",
".",
"isclose",
"(",
"angle",
",",
"0.0",
")",
":",
"ampal",
".",
"rotate",
"(",
"angle... | Applies a translation and rotation to an AMPAL object. | [
"Applies",
"a",
"translation",
"and",
"rotation",
"to",
"an",
"AMPAL",
"object",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/non_canonical.py#L87-L92 | train | 59,953 |
woolfson-group/isambard | isambard/ampal/protein.py | find_ss_regions_polymer | def find_ss_regions_polymer(polymer, ss):
"""Returns an `Assembly` of regions tagged as secondary structure.
Parameters
----------
polymer : Polypeptide
`Polymer` object to be searched secondary structure regions.
ss : list
List of secondary structure tags to be separate i.e. ['H']
... | python | def find_ss_regions_polymer(polymer, ss):
"""Returns an `Assembly` of regions tagged as secondary structure.
Parameters
----------
polymer : Polypeptide
`Polymer` object to be searched secondary structure regions.
ss : list
List of secondary structure tags to be separate i.e. ['H']
... | [
"def",
"find_ss_regions_polymer",
"(",
"polymer",
",",
"ss",
")",
":",
"if",
"isinstance",
"(",
"ss",
",",
"str",
")",
":",
"ss",
"=",
"[",
"ss",
"[",
":",
"]",
"]",
"tag_key",
"=",
"'secondary_structure'",
"monomers",
"=",
"[",
"x",
"for",
"x",
"in"... | Returns an `Assembly` of regions tagged as secondary structure.
Parameters
----------
polymer : Polypeptide
`Polymer` object to be searched secondary structure regions.
ss : list
List of secondary structure tags to be separate i.e. ['H']
would return helices, ['H', 'E'] would re... | [
"Returns",
"an",
"Assembly",
"of",
"regions",
"tagged",
"as",
"secondary",
"structure",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/protein.py#L34-L77 | train | 59,954 |
woolfson-group/isambard | isambard/ampal/protein.py | flat_list_to_polymer | def flat_list_to_polymer(atom_list, atom_group_s=4):
"""Takes a flat list of atomic coordinates and converts it to a `Polymer`.
Parameters
----------
atom_list : [Atom]
Flat list of coordinates.
atom_group_s : int, optional
Size of atom groups.
Returns
-------
polymer :... | python | def flat_list_to_polymer(atom_list, atom_group_s=4):
"""Takes a flat list of atomic coordinates and converts it to a `Polymer`.
Parameters
----------
atom_list : [Atom]
Flat list of coordinates.
atom_group_s : int, optional
Size of atom groups.
Returns
-------
polymer :... | [
"def",
"flat_list_to_polymer",
"(",
"atom_list",
",",
"atom_group_s",
"=",
"4",
")",
":",
"atom_labels",
"=",
"[",
"'N'",
",",
"'CA'",
",",
"'C'",
",",
"'O'",
",",
"'CB'",
"]",
"atom_elements",
"=",
"[",
"'N'",
",",
"'C'",
",",
"'C'",
",",
"'O'",
","... | Takes a flat list of atomic coordinates and converts it to a `Polymer`.
Parameters
----------
atom_list : [Atom]
Flat list of coordinates.
atom_group_s : int, optional
Size of atom groups.
Returns
-------
polymer : Polypeptide
`Polymer` object containing atom coords... | [
"Takes",
"a",
"flat",
"list",
"of",
"atomic",
"coordinates",
"and",
"converts",
"it",
"to",
"a",
"Polymer",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/protein.py#L80-L116 | train | 59,955 |
woolfson-group/isambard | isambard/ampal/protein.py | Polypeptide.backbone | def backbone(self):
"""Returns a new `Polymer` containing only the backbone atoms.
Notes
-----
Metadata is not currently preserved from the parent object.
Sequence data is retained, but only the main chain atoms are retained.
Returns
-------
bb_poly : Po... | python | def backbone(self):
"""Returns a new `Polymer` containing only the backbone atoms.
Notes
-----
Metadata is not currently preserved from the parent object.
Sequence data is retained, but only the main chain atoms are retained.
Returns
-------
bb_poly : Po... | [
"def",
"backbone",
"(",
"self",
")",
":",
"bb_poly",
"=",
"Polypeptide",
"(",
"[",
"x",
".",
"backbone",
"for",
"x",
"in",
"self",
".",
"_monomers",
"]",
",",
"self",
".",
"id",
")",
"return",
"bb_poly"
] | Returns a new `Polymer` containing only the backbone atoms.
Notes
-----
Metadata is not currently preserved from the parent object.
Sequence data is retained, but only the main chain atoms are retained.
Returns
-------
bb_poly : Polypeptide
Polymer c... | [
"Returns",
"a",
"new",
"Polymer",
"containing",
"only",
"the",
"backbone",
"atoms",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/protein.py#L282-L297 | train | 59,956 |
woolfson-group/isambard | isambard/ampal/protein.py | Polypeptide.pack_new_sequence | def pack_new_sequence(self, sequence):
"""Packs a new sequence onto the polymer using Scwrl4.
Parameters
----------
sequence : str
String containing the amino acid sequence. This must
be the same length as the Polymer
Raises
------
ValueE... | python | def pack_new_sequence(self, sequence):
"""Packs a new sequence onto the polymer using Scwrl4.
Parameters
----------
sequence : str
String containing the amino acid sequence. This must
be the same length as the Polymer
Raises
------
ValueE... | [
"def",
"pack_new_sequence",
"(",
"self",
",",
"sequence",
")",
":",
"# This import is here to prevent a circular import.",
"from",
"ampal",
".",
"pdb_parser",
"import",
"convert_pdb_to_ampal",
"polymer_bb",
"=",
"self",
".",
"backbone",
"if",
"len",
"(",
"sequence",
"... | Packs a new sequence onto the polymer using Scwrl4.
Parameters
----------
sequence : str
String containing the amino acid sequence. This must
be the same length as the Polymer
Raises
------
ValueError
Raised if the sequence length doe... | [
"Packs",
"a",
"new",
"sequence",
"onto",
"the",
"polymer",
"using",
"Scwrl4",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/protein.py#L366-L397 | train | 59,957 |
woolfson-group/isambard | isambard/ampal/protein.py | Polypeptide.sequence | def sequence(self):
"""Returns the sequence of the `Polymer` as a string.
Returns
-------
sequence : str
String of the `Residue` sequence of the `Polypeptide`.
"""
seq = [x.mol_letter for x in self._monomers]
return ''.join(seq) | python | def sequence(self):
"""Returns the sequence of the `Polymer` as a string.
Returns
-------
sequence : str
String of the `Residue` sequence of the `Polypeptide`.
"""
seq = [x.mol_letter for x in self._monomers]
return ''.join(seq) | [
"def",
"sequence",
"(",
"self",
")",
":",
"seq",
"=",
"[",
"x",
".",
"mol_letter",
"for",
"x",
"in",
"self",
".",
"_monomers",
"]",
"return",
"''",
".",
"join",
"(",
"seq",
")"
] | Returns the sequence of the `Polymer` as a string.
Returns
-------
sequence : str
String of the `Residue` sequence of the `Polypeptide`. | [
"Returns",
"the",
"sequence",
"of",
"the",
"Polymer",
"as",
"a",
"string",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/protein.py#L405-L414 | train | 59,958 |
woolfson-group/isambard | isambard/ampal/protein.py | Polypeptide.backbone_bond_lengths | def backbone_bond_lengths(self):
"""Dictionary containing backbone bond lengths as lists of floats.
Returns
-------
bond_lengths : dict
Keys are `n_ca`, `ca_c`, `c_o` and `c_n`, referring to the
N-CA, CA-C, C=O and C-N bonds respectively. Values are
l... | python | def backbone_bond_lengths(self):
"""Dictionary containing backbone bond lengths as lists of floats.
Returns
-------
bond_lengths : dict
Keys are `n_ca`, `ca_c`, `c_o` and `c_n`, referring to the
N-CA, CA-C, C=O and C-N bonds respectively. Values are
l... | [
"def",
"backbone_bond_lengths",
"(",
"self",
")",
":",
"bond_lengths",
"=",
"dict",
"(",
"n_ca",
"=",
"[",
"distance",
"(",
"r",
"[",
"'N'",
"]",
",",
"r",
"[",
"'CA'",
"]",
")",
"for",
"r",
"in",
"self",
".",
"get_monomers",
"(",
"ligands",
"=",
"... | Dictionary containing backbone bond lengths as lists of floats.
Returns
-------
bond_lengths : dict
Keys are `n_ca`, `ca_c`, `c_o` and `c_n`, referring to the
N-CA, CA-C, C=O and C-N bonds respectively. Values are
lists of floats : the bond lengths in Angstro... | [
"Dictionary",
"containing",
"backbone",
"bond",
"lengths",
"as",
"lists",
"of",
"floats",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/protein.py#L432-L456 | train | 59,959 |
woolfson-group/isambard | isambard/ampal/protein.py | Polypeptide.backbone_bond_angles | def backbone_bond_angles(self):
"""Dictionary containing backbone bond angles as lists of floats.
Returns
-------
bond_angles : dict
Keys are `n_ca_c`, `ca_c_o`, `ca_c_n` and `c_n_ca`, referring
to the N-CA-C, CA-C=O, CA-C-N and C-N-CA angles respectively.
... | python | def backbone_bond_angles(self):
"""Dictionary containing backbone bond angles as lists of floats.
Returns
-------
bond_angles : dict
Keys are `n_ca_c`, `ca_c_o`, `ca_c_n` and `c_n_ca`, referring
to the N-CA-C, CA-C=O, CA-C-N and C-N-CA angles respectively.
... | [
"def",
"backbone_bond_angles",
"(",
"self",
")",
":",
"bond_angles",
"=",
"dict",
"(",
"n_ca_c",
"=",
"[",
"angle_between_vectors",
"(",
"r",
"[",
"'N'",
"]",
"-",
"r",
"[",
"'CA'",
"]",
",",
"r",
"[",
"'C'",
"]",
"-",
"r",
"[",
"'CA'",
"]",
")",
... | Dictionary containing backbone bond angles as lists of floats.
Returns
-------
bond_angles : dict
Keys are `n_ca_c`, `ca_c_o`, `ca_c_n` and `c_n_ca`, referring
to the N-CA-C, CA-C=O, CA-C-N and C-N-CA angles respectively.
Values are lists of floats : the bond... | [
"Dictionary",
"containing",
"backbone",
"bond",
"angles",
"as",
"lists",
"of",
"floats",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/protein.py#L459-L484 | train | 59,960 |
woolfson-group/isambard | isambard/ampal/protein.py | Polypeptide.tag_secondary_structure | def tag_secondary_structure(self, force=False):
"""Tags each `Residue` of the `Polypeptide` with secondary structure.
Notes
-----
DSSP must be available to call. Check by running
`isambard.external_programs.dssp.test_dssp`. If DSSP is not
available, please follow instruc... | python | def tag_secondary_structure(self, force=False):
"""Tags each `Residue` of the `Polypeptide` with secondary structure.
Notes
-----
DSSP must be available to call. Check by running
`isambard.external_programs.dssp.test_dssp`. If DSSP is not
available, please follow instruc... | [
"def",
"tag_secondary_structure",
"(",
"self",
",",
"force",
"=",
"False",
")",
":",
"tagged",
"=",
"[",
"'secondary_structure'",
"in",
"x",
".",
"tags",
".",
"keys",
"(",
")",
"for",
"x",
"in",
"self",
".",
"_monomers",
"]",
"if",
"(",
"not",
"all",
... | Tags each `Residue` of the `Polypeptide` with secondary structure.
Notes
-----
DSSP must be available to call. Check by running
`isambard.external_programs.dssp.test_dssp`. If DSSP is not
available, please follow instruction here to add it:
https://github.com/woolfson-gr... | [
"Tags",
"each",
"Residue",
"of",
"the",
"Polypeptide",
"with",
"secondary",
"structure",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/protein.py#L686-L719 | train | 59,961 |
woolfson-group/isambard | isambard/ampal/protein.py | Polypeptide.tag_residue_solvent_accessibility | def tag_residue_solvent_accessibility(self, tag_type=False, tag_total=False,
force=False, include_hetatms=False):
"""Tags `Residues` wirh relative residue solvent accessibility.
Notes
-----
THIS FUNCTIONALITY REQUIRES NACESS.
This functi... | python | def tag_residue_solvent_accessibility(self, tag_type=False, tag_total=False,
force=False, include_hetatms=False):
"""Tags `Residues` wirh relative residue solvent accessibility.
Notes
-----
THIS FUNCTIONALITY REQUIRES NACESS.
This functi... | [
"def",
"tag_residue_solvent_accessibility",
"(",
"self",
",",
"tag_type",
"=",
"False",
",",
"tag_total",
"=",
"False",
",",
"force",
"=",
"False",
",",
"include_hetatms",
"=",
"False",
")",
":",
"if",
"tag_type",
":",
"tag_type",
"=",
"tag_type",
"else",
":... | Tags `Residues` wirh relative residue solvent accessibility.
Notes
-----
THIS FUNCTIONALITY REQUIRES NACESS.
This function tags the Monomer with the *relative* RSA of
the *whole side chain*, i.e. column 2 of the .rsa file that
NACCESS writes.
References
... | [
"Tags",
"Residues",
"wirh",
"relative",
"residue",
"solvent",
"accessibility",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/protein.py#L721-L770 | train | 59,962 |
woolfson-group/isambard | isambard/ampal/protein.py | Polypeptide.tag_dssp_solvent_accessibility | def tag_dssp_solvent_accessibility(self, force=False):
"""Tags each `Residues` Polymer with its solvent accessibility.
Notes
-----
For more about DSSP's solvent accessibilty metric, see:
http://swift.cmbi.ru.nl/gv/dssp/HTML/descrip.html#ACC
References
------... | python | def tag_dssp_solvent_accessibility(self, force=False):
"""Tags each `Residues` Polymer with its solvent accessibility.
Notes
-----
For more about DSSP's solvent accessibilty metric, see:
http://swift.cmbi.ru.nl/gv/dssp/HTML/descrip.html#ACC
References
------... | [
"def",
"tag_dssp_solvent_accessibility",
"(",
"self",
",",
"force",
"=",
"False",
")",
":",
"tagged",
"=",
"[",
"'dssp_acc'",
"in",
"x",
".",
"tags",
".",
"keys",
"(",
")",
"for",
"x",
"in",
"self",
".",
"_monomers",
"]",
"if",
"(",
"not",
"all",
"("... | Tags each `Residues` Polymer with its solvent accessibility.
Notes
-----
For more about DSSP's solvent accessibilty metric, see:
http://swift.cmbi.ru.nl/gv/dssp/HTML/descrip.html#ACC
References
----------
.. [1] Kabsch W, Sander C (1983) "Dictionary of prote... | [
"Tags",
"each",
"Residues",
"Polymer",
"with",
"its",
"solvent",
"accessibility",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/protein.py#L772-L801 | train | 59,963 |
woolfson-group/isambard | isambard/ampal/protein.py | Polypeptide.tag_sidechain_dihedrals | def tag_sidechain_dihedrals(self, force=False):
"""Tags each monomer with side-chain dihedral angles
force: bool, optional
If `True` the tag will be run even if `Residues` are
already tagged.
"""
tagged = ['chi_angles' in x.tags.keys() for x in self._monomers]
... | python | def tag_sidechain_dihedrals(self, force=False):
"""Tags each monomer with side-chain dihedral angles
force: bool, optional
If `True` the tag will be run even if `Residues` are
already tagged.
"""
tagged = ['chi_angles' in x.tags.keys() for x in self._monomers]
... | [
"def",
"tag_sidechain_dihedrals",
"(",
"self",
",",
"force",
"=",
"False",
")",
":",
"tagged",
"=",
"[",
"'chi_angles'",
"in",
"x",
".",
"tags",
".",
"keys",
"(",
")",
"for",
"x",
"in",
"self",
".",
"_monomers",
"]",
"if",
"(",
"not",
"all",
"(",
"... | Tags each monomer with side-chain dihedral angles
force: bool, optional
If `True` the tag will be run even if `Residues` are
already tagged. | [
"Tags",
"each",
"monomer",
"with",
"side",
"-",
"chain",
"dihedral",
"angles"
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/protein.py#L803-L816 | train | 59,964 |
woolfson-group/isambard | isambard/ampal/protein.py | Polypeptide.tag_torsion_angles | def tag_torsion_angles(self, force=False):
"""Tags each Monomer of the Polymer with its omega, phi and psi torsion angle.
Parameters
----------
force : bool, optional
If `True` the tag will be run even if `Residues` are
already tagged.
"""
tagged ... | python | def tag_torsion_angles(self, force=False):
"""Tags each Monomer of the Polymer with its omega, phi and psi torsion angle.
Parameters
----------
force : bool, optional
If `True` the tag will be run even if `Residues` are
already tagged.
"""
tagged ... | [
"def",
"tag_torsion_angles",
"(",
"self",
",",
"force",
"=",
"False",
")",
":",
"tagged",
"=",
"[",
"'omega'",
"in",
"x",
".",
"tags",
".",
"keys",
"(",
")",
"for",
"x",
"in",
"self",
".",
"_monomers",
"]",
"if",
"(",
"not",
"all",
"(",
"tagged",
... | Tags each Monomer of the Polymer with its omega, phi and psi torsion angle.
Parameters
----------
force : bool, optional
If `True` the tag will be run even if `Residues` are
already tagged. | [
"Tags",
"each",
"Monomer",
"of",
"the",
"Polymer",
"with",
"its",
"omega",
"phi",
"and",
"psi",
"torsion",
"angle",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/protein.py#L818-L835 | train | 59,965 |
woolfson-group/isambard | isambard/ampal/protein.py | Polypeptide.tag_ca_geometry | def tag_ca_geometry(self, force=False, reference_axis=None,
reference_axis_name='ref_axis'):
"""Tags each `Residue` with rise_per_residue, radius_of_curvature and residues_per_turn.
Parameters
----------
force : bool, optional
If `True` the tag will b... | python | def tag_ca_geometry(self, force=False, reference_axis=None,
reference_axis_name='ref_axis'):
"""Tags each `Residue` with rise_per_residue, radius_of_curvature and residues_per_turn.
Parameters
----------
force : bool, optional
If `True` the tag will b... | [
"def",
"tag_ca_geometry",
"(",
"self",
",",
"force",
"=",
"False",
",",
"reference_axis",
"=",
"None",
",",
"reference_axis_name",
"=",
"'ref_axis'",
")",
":",
"tagged",
"=",
"[",
"'rise_per_residue'",
"in",
"x",
".",
"tags",
".",
"keys",
"(",
")",
"for",
... | Tags each `Residue` with rise_per_residue, radius_of_curvature and residues_per_turn.
Parameters
----------
force : bool, optional
If `True` the tag will be run even if `Residues` are already
tagged.
reference_axis : list(numpy.array or tuple or list), optional
... | [
"Tags",
"each",
"Residue",
"with",
"rise_per_residue",
"radius_of_curvature",
"and",
"residues_per_turn",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/protein.py#L848-L889 | train | 59,966 |
woolfson-group/isambard | isambard/ampal/protein.py | Polypeptide.valid_backbone_bond_lengths | def valid_backbone_bond_lengths(self, atol=0.1):
"""True if all backbone bonds are within atol Angstroms of the expected distance.
Notes
-----
Ideal bond lengths taken from [1].
References
----------
.. [1] Schulz, G. E, and R. Heiner Schirmer. Principles Of
... | python | def valid_backbone_bond_lengths(self, atol=0.1):
"""True if all backbone bonds are within atol Angstroms of the expected distance.
Notes
-----
Ideal bond lengths taken from [1].
References
----------
.. [1] Schulz, G. E, and R. Heiner Schirmer. Principles Of
... | [
"def",
"valid_backbone_bond_lengths",
"(",
"self",
",",
"atol",
"=",
"0.1",
")",
":",
"bond_lengths",
"=",
"self",
".",
"backbone_bond_lengths",
"a1",
"=",
"numpy",
".",
"allclose",
"(",
"bond_lengths",
"[",
"'n_ca'",
"]",
",",
"[",
"ideal_backbone_bond_lengths"... | True if all backbone bonds are within atol Angstroms of the expected distance.
Notes
-----
Ideal bond lengths taken from [1].
References
----------
.. [1] Schulz, G. E, and R. Heiner Schirmer. Principles Of
Protein Structure. New York: Springer-Verlag, 1979.
... | [
"True",
"if",
"all",
"backbone",
"bonds",
"are",
"within",
"atol",
"Angstroms",
"of",
"the",
"expected",
"distance",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/protein.py#L891-L923 | train | 59,967 |
woolfson-group/isambard | isambard/ampal/protein.py | Polypeptide.valid_backbone_bond_angles | def valid_backbone_bond_angles(self, atol=20):
"""True if all backbone bond angles are within atol degrees of their expected values.
Notes
-----
Ideal bond angles taken from [1].
References
----------
.. [1] Schulz, G. E, and R. Heiner Schirmer. Principles Of
... | python | def valid_backbone_bond_angles(self, atol=20):
"""True if all backbone bond angles are within atol degrees of their expected values.
Notes
-----
Ideal bond angles taken from [1].
References
----------
.. [1] Schulz, G. E, and R. Heiner Schirmer. Principles Of
... | [
"def",
"valid_backbone_bond_angles",
"(",
"self",
",",
"atol",
"=",
"20",
")",
":",
"bond_angles",
"=",
"self",
".",
"backbone_bond_angles",
"omegas",
"=",
"[",
"x",
"[",
"0",
"]",
"for",
"x",
"in",
"measure_torsion_angles",
"(",
"self",
")",
"]",
"trans",... | True if all backbone bond angles are within atol degrees of their expected values.
Notes
-----
Ideal bond angles taken from [1].
References
----------
.. [1] Schulz, G. E, and R. Heiner Schirmer. Principles Of
Protein Structure. New York: Springer-Verlag, 197... | [
"True",
"if",
"all",
"backbone",
"bond",
"angles",
"are",
"within",
"atol",
"degrees",
"of",
"their",
"expected",
"values",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/protein.py#L925-L959 | train | 59,968 |
woolfson-group/isambard | isambard/ampal/protein.py | Residue.backbone | def backbone(self):
"""Returns a new `Residue` containing only the backbone atoms.
Returns
-------
bb_monomer : Residue
`Residue` containing only the backbone atoms of the original
`Monomer`.
Raises
------
IndexError
Raise if ... | python | def backbone(self):
"""Returns a new `Residue` containing only the backbone atoms.
Returns
-------
bb_monomer : Residue
`Residue` containing only the backbone atoms of the original
`Monomer`.
Raises
------
IndexError
Raise if ... | [
"def",
"backbone",
"(",
"self",
")",
":",
"try",
":",
"backbone",
"=",
"OrderedDict",
"(",
"[",
"(",
"'N'",
",",
"self",
".",
"atoms",
"[",
"'N'",
"]",
")",
",",
"(",
"'CA'",
",",
"self",
".",
"atoms",
"[",
"'CA'",
"]",
")",
",",
"(",
"'C'",
... | Returns a new `Residue` containing only the backbone atoms.
Returns
-------
bb_monomer : Residue
`Residue` containing only the backbone atoms of the original
`Monomer`.
Raises
------
IndexError
Raise if the `atoms` dict does not conta... | [
"Returns",
"a",
"new",
"Residue",
"containing",
"only",
"the",
"backbone",
"atoms",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/protein.py#L1218-L1250 | train | 59,969 |
woolfson-group/isambard | isambard/ampal/protein.py | Residue.unique_id | def unique_id(self):
"""Generates a tuple that uniquely identifies a `Monomer` in an `Assembly`.
Notes
-----
The unique_id will uniquely identify each monomer within a polymer.
If each polymer in an assembly has a distinct id, it will uniquely
identify each monomer withi... | python | def unique_id(self):
"""Generates a tuple that uniquely identifies a `Monomer` in an `Assembly`.
Notes
-----
The unique_id will uniquely identify each monomer within a polymer.
If each polymer in an assembly has a distinct id, it will uniquely
identify each monomer withi... | [
"def",
"unique_id",
"(",
"self",
")",
":",
"if",
"self",
".",
"is_hetero",
":",
"if",
"self",
".",
"mol_code",
"==",
"'HOH'",
":",
"hetero_flag",
"=",
"'W'",
"else",
":",
"hetero_flag",
"=",
"'H_{0}'",
".",
"format",
"(",
"self",
".",
"mol_code",
")",
... | Generates a tuple that uniquely identifies a `Monomer` in an `Assembly`.
Notes
-----
The unique_id will uniquely identify each monomer within a polymer.
If each polymer in an assembly has a distinct id, it will uniquely
identify each monomer within the assembly.
The het... | [
"Generates",
"a",
"tuple",
"that",
"uniquely",
"identifies",
"a",
"Monomer",
"in",
"an",
"Assembly",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/protein.py#L1253-L1286 | train | 59,970 |
woolfson-group/isambard | isambard/ampal/protein.py | Residue.side_chain_environment | def side_chain_environment(self, cutoff=4, include_neighbours=True,
inter_chain=True, include_ligands=False, include_solvent=False):
"""Finds `Residues` with any atom within the cutoff distance of side-chain.
Notes
-----
Includes the parent residue in the ... | python | def side_chain_environment(self, cutoff=4, include_neighbours=True,
inter_chain=True, include_ligands=False, include_solvent=False):
"""Finds `Residues` with any atom within the cutoff distance of side-chain.
Notes
-----
Includes the parent residue in the ... | [
"def",
"side_chain_environment",
"(",
"self",
",",
"cutoff",
"=",
"4",
",",
"include_neighbours",
"=",
"True",
",",
"inter_chain",
"=",
"True",
",",
"include_ligands",
"=",
"False",
",",
"include_solvent",
"=",
"False",
")",
":",
"if",
"self",
".",
"mol_code... | Finds `Residues` with any atom within the cutoff distance of side-chain.
Notes
-----
Includes the parent residue in the list.
Parameters
----------
cutoff : float, optional
Maximum inter-atom distance for residue to be included.
Defaults to 4.
... | [
"Finds",
"Residues",
"with",
"any",
"atom",
"within",
"the",
"cutoff",
"distance",
"of",
"side",
"-",
"chain",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/protein.py#L1327-L1370 | train | 59,971 |
woolfson-group/isambard | isambard/settings.py | load_global_settings | def load_global_settings():
"""Loads settings file containing paths to dependencies and other optional configuration elements."""
with open(settings_path, 'r') as settings_f:
global global_settings
settings_json = json.loads(settings_f.read())
if global_settings is None:
glob... | python | def load_global_settings():
"""Loads settings file containing paths to dependencies and other optional configuration elements."""
with open(settings_path, 'r') as settings_f:
global global_settings
settings_json = json.loads(settings_f.read())
if global_settings is None:
glob... | [
"def",
"load_global_settings",
"(",
")",
":",
"with",
"open",
"(",
"settings_path",
",",
"'r'",
")",
"as",
"settings_f",
":",
"global",
"global_settings",
"settings_json",
"=",
"json",
".",
"loads",
"(",
"settings_f",
".",
"read",
"(",
")",
")",
"if",
"glo... | Loads settings file containing paths to dependencies and other optional configuration elements. | [
"Loads",
"settings",
"file",
"containing",
"paths",
"to",
"dependencies",
"and",
"other",
"optional",
"configuration",
"elements",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/settings.py#L29-L42 | train | 59,972 |
woolfson-group/isambard | isambard/ampal/specifications/assembly_specs/solenoid.py | HelixPair.build | def build(self):
"""Builds a `HelixPair` using the defined attributes."""
for i in range(2):
self._molecules.append(
self.make_helix(self.aas[i], self.axis_distances[i],
self.z_shifts[i], self.phis[i], self.splays[i],
... | python | def build(self):
"""Builds a `HelixPair` using the defined attributes."""
for i in range(2):
self._molecules.append(
self.make_helix(self.aas[i], self.axis_distances[i],
self.z_shifts[i], self.phis[i], self.splays[i],
... | [
"def",
"build",
"(",
"self",
")",
":",
"for",
"i",
"in",
"range",
"(",
"2",
")",
":",
"self",
".",
"_molecules",
".",
"append",
"(",
"self",
".",
"make_helix",
"(",
"self",
".",
"aas",
"[",
"i",
"]",
",",
"self",
".",
"axis_distances",
"[",
"i",
... | Builds a `HelixPair` using the defined attributes. | [
"Builds",
"a",
"HelixPair",
"using",
"the",
"defined",
"attributes",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/specifications/assembly_specs/solenoid.py#L61-L68 | train | 59,973 |
woolfson-group/isambard | isambard/ampal/specifications/assembly_specs/solenoid.py | HelixPair.make_helix | def make_helix(aa, axis_distance, z_shift, phi, splay, off_plane):
"""Builds a helix for a given set of parameters."""
start = numpy.array([axis_distance, 0 + z_shift, 0])
end = numpy.array([axis_distance, (aa * 1.52) + z_shift, 0])
mid = (start + end) / 2
helix = Helix.from_sta... | python | def make_helix(aa, axis_distance, z_shift, phi, splay, off_plane):
"""Builds a helix for a given set of parameters."""
start = numpy.array([axis_distance, 0 + z_shift, 0])
end = numpy.array([axis_distance, (aa * 1.52) + z_shift, 0])
mid = (start + end) / 2
helix = Helix.from_sta... | [
"def",
"make_helix",
"(",
"aa",
",",
"axis_distance",
",",
"z_shift",
",",
"phi",
",",
"splay",
",",
"off_plane",
")",
":",
"start",
"=",
"numpy",
".",
"array",
"(",
"[",
"axis_distance",
",",
"0",
"+",
"z_shift",
",",
"0",
"]",
")",
"end",
"=",
"n... | Builds a helix for a given set of parameters. | [
"Builds",
"a",
"helix",
"for",
"a",
"given",
"set",
"of",
"parameters",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/specifications/assembly_specs/solenoid.py#L71-L81 | train | 59,974 |
woolfson-group/isambard | isambard/ampal/specifications/assembly_specs/solenoid.py | Solenoid.build | def build(self):
"""Builds a Solenoid using the defined attributes."""
self._molecules = []
if self.handedness == 'l':
handedness = -1
else:
handedness = 1
rot_ang = self.rot_ang * handedness
for i in range(self.num_of_repeats):
dup_uni... | python | def build(self):
"""Builds a Solenoid using the defined attributes."""
self._molecules = []
if self.handedness == 'l':
handedness = -1
else:
handedness = 1
rot_ang = self.rot_ang * handedness
for i in range(self.num_of_repeats):
dup_uni... | [
"def",
"build",
"(",
"self",
")",
":",
"self",
".",
"_molecules",
"=",
"[",
"]",
"if",
"self",
".",
"handedness",
"==",
"'l'",
":",
"handedness",
"=",
"-",
"1",
"else",
":",
"handedness",
"=",
"1",
"rot_ang",
"=",
"self",
".",
"rot_ang",
"*",
"hand... | Builds a Solenoid using the defined attributes. | [
"Builds",
"a",
"Solenoid",
"using",
"the",
"defined",
"attributes",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/specifications/assembly_specs/solenoid.py#L132-L147 | train | 59,975 |
woolfson-group/isambard | isambard/ampal/specifications/polymer_specs/nucleic_acid_strand.py | NucleicAcidStrand.from_start_and_end | def from_start_and_end(cls, start, end, sequence, helix_type='b_dna',
phos_3_prime=False):
"""Generates a helical `Polynucleotide` that is built along an axis.
Parameters
----------
start: [float, float, float]
Start of the build axis.
end:... | python | def from_start_and_end(cls, start, end, sequence, helix_type='b_dna',
phos_3_prime=False):
"""Generates a helical `Polynucleotide` that is built along an axis.
Parameters
----------
start: [float, float, float]
Start of the build axis.
end:... | [
"def",
"from_start_and_end",
"(",
"cls",
",",
"start",
",",
"end",
",",
"sequence",
",",
"helix_type",
"=",
"'b_dna'",
",",
"phos_3_prime",
"=",
"False",
")",
":",
"start",
"=",
"numpy",
".",
"array",
"(",
"start",
")",
"end",
"=",
"numpy",
".",
"array... | Generates a helical `Polynucleotide` that is built along an axis.
Parameters
----------
start: [float, float, float]
Start of the build axis.
end: [float, float, float]
End of build axis.
sequence: str
The nucleotide sequence of the nucleic ac... | [
"Generates",
"a",
"helical",
"Polynucleotide",
"that",
"is",
"built",
"along",
"an",
"axis",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/specifications/polymer_specs/nucleic_acid_strand.py#L196-L218 | train | 59,976 |
woolfson-group/isambard | isambard/ampal/specifications/polymer_specs/nucleic_acid_strand.py | NucleicAcidStrand.move_to | def move_to(self, start, end):
"""Moves the `Polynucleotide` to lie on the `start` and `end` vector.
Parameters
----------
start : 3D Vector (tuple or list or numpy.array)
The coordinate of the start of the helix primitive.
end : 3D Vector (tuple or list or numpy.arr... | python | def move_to(self, start, end):
"""Moves the `Polynucleotide` to lie on the `start` and `end` vector.
Parameters
----------
start : 3D Vector (tuple or list or numpy.array)
The coordinate of the start of the helix primitive.
end : 3D Vector (tuple or list or numpy.arr... | [
"def",
"move_to",
"(",
"self",
",",
"start",
",",
"end",
")",
":",
"start",
"=",
"numpy",
".",
"array",
"(",
"start",
")",
"end",
"=",
"numpy",
".",
"array",
"(",
"end",
")",
"if",
"numpy",
".",
"allclose",
"(",
"start",
",",
"end",
")",
":",
"... | Moves the `Polynucleotide` to lie on the `start` and `end` vector.
Parameters
----------
start : 3D Vector (tuple or list or numpy.array)
The coordinate of the start of the helix primitive.
end : 3D Vector (tuple or list or numpy.array)
The coordinate of the end ... | [
"Moves",
"the",
"Polynucleotide",
"to",
"lie",
"on",
"the",
"start",
"and",
"end",
"vector",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/specifications/polymer_specs/nucleic_acid_strand.py#L323-L347 | train | 59,977 |
woolfson-group/isambard | isambard/add_ons/pacc.py | fit_heptad_register | def fit_heptad_register(crangles):
"""Attempts to fit a heptad repeat to a set of Crick angles.
Parameters
----------
crangles: [float]
A list of average Crick angles for the coiled coil.
Returns
-------
fit_data: [(float, float, float)]
Sorted list of fits for each heptad ... | python | def fit_heptad_register(crangles):
"""Attempts to fit a heptad repeat to a set of Crick angles.
Parameters
----------
crangles: [float]
A list of average Crick angles for the coiled coil.
Returns
-------
fit_data: [(float, float, float)]
Sorted list of fits for each heptad ... | [
"def",
"fit_heptad_register",
"(",
"crangles",
")",
":",
"crangles",
"=",
"[",
"x",
"if",
"x",
">",
"0",
"else",
"360",
"+",
"x",
"for",
"x",
"in",
"crangles",
"]",
"hept_p",
"=",
"[",
"x",
"*",
"(",
"360.0",
"/",
"7.0",
")",
"+",
"(",
"(",
"36... | Attempts to fit a heptad repeat to a set of Crick angles.
Parameters
----------
crangles: [float]
A list of average Crick angles for the coiled coil.
Returns
-------
fit_data: [(float, float, float)]
Sorted list of fits for each heptad position. | [
"Attempts",
"to",
"fit",
"a",
"heptad",
"repeat",
"to",
"a",
"set",
"of",
"Crick",
"angles",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/add_ons/pacc.py#L115-L146 | train | 59,978 |
woolfson-group/isambard | isambard/add_ons/pacc.py | PACCAnalysis.gather_layer_info | def gather_layer_info(self):
"""Extracts the tagged coiled-coil parameters for each layer."""
for i in range(len(self.cc[0])):
layer_radii = [x[i].tags['distance_to_ref_axis'] for x in self.cc]
self.radii_layers.append(layer_radii)
layer_alpha = [x[i].tags['alpha_angl... | python | def gather_layer_info(self):
"""Extracts the tagged coiled-coil parameters for each layer."""
for i in range(len(self.cc[0])):
layer_radii = [x[i].tags['distance_to_ref_axis'] for x in self.cc]
self.radii_layers.append(layer_radii)
layer_alpha = [x[i].tags['alpha_angl... | [
"def",
"gather_layer_info",
"(",
"self",
")",
":",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"self",
".",
"cc",
"[",
"0",
"]",
")",
")",
":",
"layer_radii",
"=",
"[",
"x",
"[",
"i",
"]",
".",
"tags",
"[",
"'distance_to_ref_axis'",
"]",
"for",
"... | Extracts the tagged coiled-coil parameters for each layer. | [
"Extracts",
"the",
"tagged",
"coiled",
"-",
"coil",
"parameters",
"for",
"each",
"layer",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/add_ons/pacc.py#L36-L45 | train | 59,979 |
woolfson-group/isambard | isambard/add_ons/pacc.py | PACCAnalysis.calc_average_parameters | def calc_average_parameters(parameter_layers):
"""Takes a group of equal length lists and averages them across each index.
Returns
-------
mean_layers: [float]
List of values averaged by index
overall_mean: float
Mean of the averaged values.
"""
... | python | def calc_average_parameters(parameter_layers):
"""Takes a group of equal length lists and averages them across each index.
Returns
-------
mean_layers: [float]
List of values averaged by index
overall_mean: float
Mean of the averaged values.
"""
... | [
"def",
"calc_average_parameters",
"(",
"parameter_layers",
")",
":",
"mean_layers",
"=",
"[",
"numpy",
".",
"mean",
"(",
"x",
")",
"if",
"x",
"[",
"0",
"]",
"else",
"0",
"for",
"x",
"in",
"parameter_layers",
"]",
"overall_mean",
"=",
"numpy",
".",
"mean"... | Takes a group of equal length lists and averages them across each index.
Returns
-------
mean_layers: [float]
List of values averaged by index
overall_mean: float
Mean of the averaged values. | [
"Takes",
"a",
"group",
"of",
"equal",
"length",
"lists",
"and",
"averages",
"them",
"across",
"each",
"index",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/add_ons/pacc.py#L48-L60 | train | 59,980 |
woolfson-group/isambard | isambard/add_ons/pacc.py | PACCAnalysis.heptad_register | def heptad_register(self):
"""Returns the calculated register of the coiled coil and the fit quality."""
base_reg = 'abcdefg'
exp_base = base_reg * (self.cc_len//7+2)
ave_ca_layers = self.calc_average_parameters(self.ca_layers)[0][:-1]
reg_fit = fit_heptad_register(ave_ca_layers)... | python | def heptad_register(self):
"""Returns the calculated register of the coiled coil and the fit quality."""
base_reg = 'abcdefg'
exp_base = base_reg * (self.cc_len//7+2)
ave_ca_layers = self.calc_average_parameters(self.ca_layers)[0][:-1]
reg_fit = fit_heptad_register(ave_ca_layers)... | [
"def",
"heptad_register",
"(",
"self",
")",
":",
"base_reg",
"=",
"'abcdefg'",
"exp_base",
"=",
"base_reg",
"*",
"(",
"self",
".",
"cc_len",
"//",
"7",
"+",
"2",
")",
"ave_ca_layers",
"=",
"self",
".",
"calc_average_parameters",
"(",
"self",
".",
"ca_layer... | Returns the calculated register of the coiled coil and the fit quality. | [
"Returns",
"the",
"calculated",
"register",
"of",
"the",
"coiled",
"coil",
"and",
"the",
"fit",
"quality",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/add_ons/pacc.py#L62-L69 | train | 59,981 |
woolfson-group/isambard | isambard/add_ons/pacc.py | PACCAnalysis.generate_report | def generate_report(self):
"""Generates a report on the coiled coil parameters.
Returns
-------
report: str
A string detailing the register and parameters of the coiled coil.
"""
# Find register
lines = ['Register Assignment\n-------------------']
... | python | def generate_report(self):
"""Generates a report on the coiled coil parameters.
Returns
-------
report: str
A string detailing the register and parameters of the coiled coil.
"""
# Find register
lines = ['Register Assignment\n-------------------']
... | [
"def",
"generate_report",
"(",
"self",
")",
":",
"# Find register",
"lines",
"=",
"[",
"'Register Assignment\\n-------------------'",
"]",
"register",
",",
"fit",
"=",
"self",
".",
"heptad_register",
"(",
")",
"lines",
".",
"append",
"(",
"'{}\\n{}\\n'",
".",
"f... | Generates a report on the coiled coil parameters.
Returns
-------
report: str
A string detailing the register and parameters of the coiled coil. | [
"Generates",
"a",
"report",
"on",
"the",
"coiled",
"coil",
"parameters",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/add_ons/pacc.py#L71-L112 | train | 59,982 |
woolfson-group/isambard | isambard/optimisation/base_evo_opt.py | BaseOptimizer.buff_interaction_eval | def buff_interaction_eval(cls, specification, sequences, parameters,
**kwargs):
"""Creates optimizer with default build and BUFF interaction eval.
Notes
-----
Any keyword arguments will be propagated down to BaseOptimizer.
Parameters
------... | python | def buff_interaction_eval(cls, specification, sequences, parameters,
**kwargs):
"""Creates optimizer with default build and BUFF interaction eval.
Notes
-----
Any keyword arguments will be propagated down to BaseOptimizer.
Parameters
------... | [
"def",
"buff_interaction_eval",
"(",
"cls",
",",
"specification",
",",
"sequences",
",",
"parameters",
",",
"*",
"*",
"kwargs",
")",
":",
"instance",
"=",
"cls",
"(",
"specification",
",",
"sequences",
",",
"parameters",
",",
"build_fn",
"=",
"default_build",
... | Creates optimizer with default build and BUFF interaction eval.
Notes
-----
Any keyword arguments will be propagated down to BaseOptimizer.
Parameters
----------
specification : ampal.assembly.specification
Any assembly level specification.
sequences... | [
"Creates",
"optimizer",
"with",
"default",
"build",
"and",
"BUFF",
"interaction",
"eval",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/optimisation/base_evo_opt.py#L76-L100 | train | 59,983 |
woolfson-group/isambard | isambard/optimisation/base_evo_opt.py | BaseOptimizer.rmsd_eval | def rmsd_eval(cls, specification, sequences, parameters, reference_ampal,
**kwargs):
"""Creates optimizer with default build and RMSD eval.
Notes
-----
Any keyword arguments will be propagated down to BaseOptimizer.
RMSD eval is restricted to a single core onl... | python | def rmsd_eval(cls, specification, sequences, parameters, reference_ampal,
**kwargs):
"""Creates optimizer with default build and RMSD eval.
Notes
-----
Any keyword arguments will be propagated down to BaseOptimizer.
RMSD eval is restricted to a single core onl... | [
"def",
"rmsd_eval",
"(",
"cls",
",",
"specification",
",",
"sequences",
",",
"parameters",
",",
"reference_ampal",
",",
"*",
"*",
"kwargs",
")",
":",
"eval_fn",
"=",
"make_rmsd_eval",
"(",
"reference_ampal",
")",
"instance",
"=",
"cls",
"(",
"specification",
... | Creates optimizer with default build and RMSD eval.
Notes
-----
Any keyword arguments will be propagated down to BaseOptimizer.
RMSD eval is restricted to a single core only, due to restrictions
on closure pickling.
Parameters
----------
specification :... | [
"Creates",
"optimizer",
"with",
"default",
"build",
"and",
"RMSD",
"eval",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/optimisation/base_evo_opt.py#L129-L160 | train | 59,984 |
woolfson-group/isambard | isambard/optimisation/base_evo_opt.py | BaseOptimizer.parse_individual | def parse_individual(self, individual):
"""Converts a deap individual into a full list of parameters.
Parameters
----------
individual: deap individual from optimization
Details vary according to type of optimization, but
parameters within deap individual are alw... | python | def parse_individual(self, individual):
"""Converts a deap individual into a full list of parameters.
Parameters
----------
individual: deap individual from optimization
Details vary according to type of optimization, but
parameters within deap individual are alw... | [
"def",
"parse_individual",
"(",
"self",
",",
"individual",
")",
":",
"scaled_ind",
"=",
"[",
"]",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"self",
".",
"value_means",
")",
")",
":",
"scaled_ind",
".",
"append",
"(",
"self",
".",
"value_means",
"[",
... | Converts a deap individual into a full list of parameters.
Parameters
----------
individual: deap individual from optimization
Details vary according to type of optimization, but
parameters within deap individual are always between -1
and 1. This function con... | [
"Converts",
"a",
"deap",
"individual",
"into",
"a",
"full",
"list",
"of",
"parameters",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/optimisation/base_evo_opt.py#L162-L187 | train | 59,985 |
woolfson-group/isambard | isambard/optimisation/base_evo_opt.py | BaseOptimizer.run_opt | def run_opt(self, pop_size, generations, cores=1, plot=False, log=False,
log_path=None, run_id=None, store_params=True, **kwargs):
"""Runs the optimizer.
Parameters
----------
pop_size: int
Size of the population each generation.
generation: int
... | python | def run_opt(self, pop_size, generations, cores=1, plot=False, log=False,
log_path=None, run_id=None, store_params=True, **kwargs):
"""Runs the optimizer.
Parameters
----------
pop_size: int
Size of the population each generation.
generation: int
... | [
"def",
"run_opt",
"(",
"self",
",",
"pop_size",
",",
"generations",
",",
"cores",
"=",
"1",
",",
"plot",
"=",
"False",
",",
"log",
"=",
"False",
",",
"log_path",
"=",
"None",
",",
"run_id",
"=",
"None",
",",
"store_params",
"=",
"True",
",",
"*",
"... | Runs the optimizer.
Parameters
----------
pop_size: int
Size of the population each generation.
generation: int
Number of generations in optimisation.
cores: int, optional
Number of CPU cores used to run the optimisation.
If the 'm... | [
"Runs",
"the",
"optimizer",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/optimisation/base_evo_opt.py#L189-L268 | train | 59,986 |
woolfson-group/isambard | isambard/optimisation/base_evo_opt.py | BaseOptimizer._make_parameters | def _make_parameters(self):
"""Converts a list of Parameters into DEAP format."""
self.value_means = []
self.value_ranges = []
self.arrangement = []
self.variable_parameters = []
current_var = 0
for parameter in self.parameters:
if parameter.type == Pa... | python | def _make_parameters(self):
"""Converts a list of Parameters into DEAP format."""
self.value_means = []
self.value_ranges = []
self.arrangement = []
self.variable_parameters = []
current_var = 0
for parameter in self.parameters:
if parameter.type == Pa... | [
"def",
"_make_parameters",
"(",
"self",
")",
":",
"self",
".",
"value_means",
"=",
"[",
"]",
"self",
".",
"value_ranges",
"=",
"[",
"]",
"self",
".",
"arrangement",
"=",
"[",
"]",
"self",
".",
"variable_parameters",
"=",
"[",
"]",
"current_var",
"=",
"... | Converts a list of Parameters into DEAP format. | [
"Converts",
"a",
"list",
"of",
"Parameters",
"into",
"DEAP",
"format",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/optimisation/base_evo_opt.py#L270-L295 | train | 59,987 |
woolfson-group/isambard | isambard/optimisation/base_evo_opt.py | BaseOptimizer.assign_fitnesses | def assign_fitnesses(self, targets):
"""Assigns fitnesses to parameters.
Notes
-----
Uses `self.eval_fn` to evaluate each member of target.
Parameters
---------
targets
Parameter values for each member of the population.
"""
self._eva... | python | def assign_fitnesses(self, targets):
"""Assigns fitnesses to parameters.
Notes
-----
Uses `self.eval_fn` to evaluate each member of target.
Parameters
---------
targets
Parameter values for each member of the population.
"""
self._eva... | [
"def",
"assign_fitnesses",
"(",
"self",
",",
"targets",
")",
":",
"self",
".",
"_evals",
"=",
"len",
"(",
"targets",
")",
"px_parameters",
"=",
"zip",
"(",
"[",
"self",
".",
"specification",
"]",
"*",
"len",
"(",
"targets",
")",
",",
"[",
"self",
"."... | Assigns fitnesses to parameters.
Notes
-----
Uses `self.eval_fn` to evaluate each member of target.
Parameters
---------
targets
Parameter values for each member of the population. | [
"Assigns",
"fitnesses",
"to",
"parameters",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/optimisation/base_evo_opt.py#L297-L327 | train | 59,988 |
woolfson-group/isambard | isambard/optimisation/base_evo_opt.py | Parameter.dynamic | def dynamic(cls, label, val_mean, val_range):
"""Creates a static parameter.
Parameters
----------
label : str
A human-readable label for the parameter.
val_mean : float
The mean value of the parameter.
val_range : float
The minimum an... | python | def dynamic(cls, label, val_mean, val_range):
"""Creates a static parameter.
Parameters
----------
label : str
A human-readable label for the parameter.
val_mean : float
The mean value of the parameter.
val_range : float
The minimum an... | [
"def",
"dynamic",
"(",
"cls",
",",
"label",
",",
"val_mean",
",",
"val_range",
")",
":",
"return",
"cls",
"(",
"label",
",",
"ParameterType",
".",
"DYNAMIC",
",",
"(",
"val_mean",
",",
"val_range",
")",
")"
] | Creates a static parameter.
Parameters
----------
label : str
A human-readable label for the parameter.
val_mean : float
The mean value of the parameter.
val_range : float
The minimum and maximum variance from the mean allowed for
... | [
"Creates",
"a",
"static",
"parameter",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/optimisation/base_evo_opt.py#L501-L514 | train | 59,989 |
woolfson-group/isambard | isambard/external_programs/scwrl.py | run_scwrl | def run_scwrl(pdb, sequence, path=True):
"""Runs SCWRL on input PDB strong or path to PDB and a sequence string.
Parameters
----------
pdb : str
PDB string or a path to a PDB file.
sequence : str
Amino acid sequence for SCWRL to pack in single-letter code.
path : bool, optional
... | python | def run_scwrl(pdb, sequence, path=True):
"""Runs SCWRL on input PDB strong or path to PDB and a sequence string.
Parameters
----------
pdb : str
PDB string or a path to a PDB file.
sequence : str
Amino acid sequence for SCWRL to pack in single-letter code.
path : bool, optional
... | [
"def",
"run_scwrl",
"(",
"pdb",
",",
"sequence",
",",
"path",
"=",
"True",
")",
":",
"if",
"path",
":",
"with",
"open",
"(",
"pdb",
",",
"'r'",
")",
"as",
"inf",
":",
"pdb",
"=",
"inf",
".",
"read",
"(",
")",
"pdb",
"=",
"pdb",
".",
"encode",
... | Runs SCWRL on input PDB strong or path to PDB and a sequence string.
Parameters
----------
pdb : str
PDB string or a path to a PDB file.
sequence : str
Amino acid sequence for SCWRL to pack in single-letter code.
path : bool, optional
True if pdb is a path.
Returns
... | [
"Runs",
"SCWRL",
"on",
"input",
"PDB",
"strong",
"or",
"path",
"to",
"PDB",
"and",
"a",
"sequence",
"string",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/external_programs/scwrl.py#L38-L96 | train | 59,990 |
woolfson-group/isambard | isambard/external_programs/scwrl.py | parse_scwrl_out | def parse_scwrl_out(scwrl_std_out, scwrl_pdb):
"""Parses SCWRL output and returns PDB and SCWRL score.
Parameters
----------
scwrl_std_out : str
Std out from SCWRL.
scwrl_pdb : str
String of packed SCWRL PDB.
Returns
-------
fixed_scwrl_str : str
String of packe... | python | def parse_scwrl_out(scwrl_std_out, scwrl_pdb):
"""Parses SCWRL output and returns PDB and SCWRL score.
Parameters
----------
scwrl_std_out : str
Std out from SCWRL.
scwrl_pdb : str
String of packed SCWRL PDB.
Returns
-------
fixed_scwrl_str : str
String of packe... | [
"def",
"parse_scwrl_out",
"(",
"scwrl_std_out",
",",
"scwrl_pdb",
")",
":",
"score",
"=",
"re",
".",
"findall",
"(",
"r'Total minimal energy of the graph = ([-0-9.]+)'",
",",
"scwrl_std_out",
")",
"[",
"0",
"]",
"# Add temperature factors to SCWRL out",
"split_scwrl",
"... | Parses SCWRL output and returns PDB and SCWRL score.
Parameters
----------
scwrl_std_out : str
Std out from SCWRL.
scwrl_pdb : str
String of packed SCWRL PDB.
Returns
-------
fixed_scwrl_str : str
String of packed SCWRL PDB, with correct PDB format.
score : floa... | [
"Parses",
"SCWRL",
"output",
"and",
"returns",
"PDB",
"and",
"SCWRL",
"score",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/external_programs/scwrl.py#L99-L132 | train | 59,991 |
woolfson-group/isambard | isambard/external_programs/scwrl.py | pack_sidechains | def pack_sidechains(pdb, sequence, path=False):
"""Packs sidechains onto a given PDB file or string.
Parameters
----------
pdb : str
PDB string or a path to a PDB file.
sequence : str
Amino acid sequence for SCWRL to pack in single-letter code.
path : bool, optional
True... | python | def pack_sidechains(pdb, sequence, path=False):
"""Packs sidechains onto a given PDB file or string.
Parameters
----------
pdb : str
PDB string or a path to a PDB file.
sequence : str
Amino acid sequence for SCWRL to pack in single-letter code.
path : bool, optional
True... | [
"def",
"pack_sidechains",
"(",
"pdb",
",",
"sequence",
",",
"path",
"=",
"False",
")",
":",
"scwrl_std_out",
",",
"scwrl_pdb",
"=",
"run_scwrl",
"(",
"pdb",
",",
"sequence",
",",
"path",
"=",
"path",
")",
"return",
"parse_scwrl_out",
"(",
"scwrl_std_out",
... | Packs sidechains onto a given PDB file or string.
Parameters
----------
pdb : str
PDB string or a path to a PDB file.
sequence : str
Amino acid sequence for SCWRL to pack in single-letter code.
path : bool, optional
True if pdb is a path.
Returns
-------
scwrl_p... | [
"Packs",
"sidechains",
"onto",
"a",
"given",
"PDB",
"file",
"or",
"string",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/external_programs/scwrl.py#L136-L156 | train | 59,992 |
woolfson-group/isambard | isambard/ampal/pdb_parser.py | PdbParser.parse_pdb_file | def parse_pdb_file(self):
"""Runs the PDB parser."""
self.pdb_parse_tree = {'info': {},
'data': {
self.state: {}}
}
try:
for line in self.pdb_lines:
self.current_line = li... | python | def parse_pdb_file(self):
"""Runs the PDB parser."""
self.pdb_parse_tree = {'info': {},
'data': {
self.state: {}}
}
try:
for line in self.pdb_lines:
self.current_line = li... | [
"def",
"parse_pdb_file",
"(",
"self",
")",
":",
"self",
".",
"pdb_parse_tree",
"=",
"{",
"'info'",
":",
"{",
"}",
",",
"'data'",
":",
"{",
"self",
".",
"state",
":",
"{",
"}",
"}",
"}",
"try",
":",
"for",
"line",
"in",
"self",
".",
"pdb_lines",
"... | Runs the PDB parser. | [
"Runs",
"the",
"PDB",
"parser",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/pdb_parser.py#L136-L157 | train | 59,993 |
woolfson-group/isambard | isambard/ampal/pdb_parser.py | PdbParser.proc_atom | def proc_atom(self):
"""Processes an "ATOM" or "HETATM" record."""
atom_data = self.proc_line_coordinate(self.current_line)
(at_type, at_ser, at_name, alt_loc, res_name, chain_id, res_seq,
i_code, x, y, z, occupancy, temp_factor, element, charge) = atom_data
# currently active s... | python | def proc_atom(self):
"""Processes an "ATOM" or "HETATM" record."""
atom_data = self.proc_line_coordinate(self.current_line)
(at_type, at_ser, at_name, alt_loc, res_name, chain_id, res_seq,
i_code, x, y, z, occupancy, temp_factor, element, charge) = atom_data
# currently active s... | [
"def",
"proc_atom",
"(",
"self",
")",
":",
"atom_data",
"=",
"self",
".",
"proc_line_coordinate",
"(",
"self",
".",
"current_line",
")",
"(",
"at_type",
",",
"at_ser",
",",
"at_name",
",",
"alt_loc",
",",
"res_name",
",",
"chain_id",
",",
"res_seq",
",",
... | Processes an "ATOM" or "HETATM" record. | [
"Processes",
"an",
"ATOM",
"or",
"HETATM",
"record",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/pdb_parser.py#L159-L185 | train | 59,994 |
woolfson-group/isambard | isambard/ampal/pdb_parser.py | PdbParser.make_ampal | def make_ampal(self):
"""Generates an AMPAL object from the parse tree.
Notes
-----
Will create an `Assembly` if there is a single state in the
parese tree or an `AmpalContainer` if there is more than one.
"""
data = self.pdb_parse_tree['data']
if len(dat... | python | def make_ampal(self):
"""Generates an AMPAL object from the parse tree.
Notes
-----
Will create an `Assembly` if there is a single state in the
parese tree or an `AmpalContainer` if there is more than one.
"""
data = self.pdb_parse_tree['data']
if len(dat... | [
"def",
"make_ampal",
"(",
"self",
")",
":",
"data",
"=",
"self",
".",
"pdb_parse_tree",
"[",
"'data'",
"]",
"if",
"len",
"(",
"data",
")",
">",
"1",
":",
"ac",
"=",
"AmpalContainer",
"(",
"id",
"=",
"self",
".",
"id",
")",
"for",
"state",
",",
"c... | Generates an AMPAL object from the parse tree.
Notes
-----
Will create an `Assembly` if there is a single state in the
parese tree or an `AmpalContainer` if there is more than one. | [
"Generates",
"an",
"AMPAL",
"object",
"from",
"the",
"parse",
"tree",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/pdb_parser.py#L227-L246 | train | 59,995 |
woolfson-group/isambard | isambard/ampal/pdb_parser.py | PdbParser.proc_state | def proc_state(self, state_data, state_id):
"""Processes a state into an `Assembly`.
Parameters
----------
state_data : dict
Contains information about the state, including all
the per line structural data.
state_id : str
ID given to `Assembly... | python | def proc_state(self, state_data, state_id):
"""Processes a state into an `Assembly`.
Parameters
----------
state_data : dict
Contains information about the state, including all
the per line structural data.
state_id : str
ID given to `Assembly... | [
"def",
"proc_state",
"(",
"self",
",",
"state_data",
",",
"state_id",
")",
":",
"assembly",
"=",
"Assembly",
"(",
"assembly_id",
"=",
"state_id",
")",
"for",
"k",
",",
"chain",
"in",
"sorted",
"(",
"state_data",
".",
"items",
"(",
")",
")",
":",
"assem... | Processes a state into an `Assembly`.
Parameters
----------
state_data : dict
Contains information about the state, including all
the per line structural data.
state_id : str
ID given to `Assembly` that represents the state. | [
"Processes",
"a",
"state",
"into",
"an",
"Assembly",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/pdb_parser.py#L248-L262 | train | 59,996 |
woolfson-group/isambard | isambard/ampal/pdb_parser.py | PdbParser.proc_chain | def proc_chain(self, chain_info, parent):
"""Converts a chain into a `Polymer` type object.
Parameters
----------
chain_info : (set, OrderedDict)
Contains a set of chain labels and atom records.
parent : ampal.Assembly
`Assembly` used to assign `ampal_par... | python | def proc_chain(self, chain_info, parent):
"""Converts a chain into a `Polymer` type object.
Parameters
----------
chain_info : (set, OrderedDict)
Contains a set of chain labels and atom records.
parent : ampal.Assembly
`Assembly` used to assign `ampal_par... | [
"def",
"proc_chain",
"(",
"self",
",",
"chain_info",
",",
"parent",
")",
":",
"hetatom_filters",
"=",
"{",
"'nc_aas'",
":",
"self",
".",
"check_for_non_canonical",
"}",
"polymer",
"=",
"False",
"chain_labels",
",",
"chain_data",
"=",
"chain_info",
"chain_label",... | Converts a chain into a `Polymer` type object.
Parameters
----------
chain_info : (set, OrderedDict)
Contains a set of chain labels and atom records.
parent : ampal.Assembly
`Assembly` used to assign `ampal_parent` on created
`Polymer`.
Raise... | [
"Converts",
"a",
"chain",
"into",
"a",
"Polymer",
"type",
"object",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/pdb_parser.py#L264-L335 | train | 59,997 |
woolfson-group/isambard | isambard/ampal/pdb_parser.py | PdbParser.proc_monomer | def proc_monomer(self, monomer_info, parent, mon_cls=False):
"""Processes a records into a `Monomer`.
Parameters
----------
monomer_info : (set, OrderedDict)
Labels and data for a monomer.
parent : ampal.Polymer
`Polymer` used to assign `ampal_parent` on ... | python | def proc_monomer(self, monomer_info, parent, mon_cls=False):
"""Processes a records into a `Monomer`.
Parameters
----------
monomer_info : (set, OrderedDict)
Labels and data for a monomer.
parent : ampal.Polymer
`Polymer` used to assign `ampal_parent` on ... | [
"def",
"proc_monomer",
"(",
"self",
",",
"monomer_info",
",",
"parent",
",",
"mon_cls",
"=",
"False",
")",
":",
"monomer_labels",
",",
"monomer_data",
"=",
"monomer_info",
"if",
"len",
"(",
"monomer_labels",
")",
">",
"1",
":",
"raise",
"ValueError",
"(",
... | Processes a records into a `Monomer`.
Parameters
----------
monomer_info : (set, OrderedDict)
Labels and data for a monomer.
parent : ampal.Polymer
`Polymer` used to assign `ampal_parent` on created
`Monomer`.
mon_cls : `Monomer class or subcl... | [
"Processes",
"a",
"records",
"into",
"a",
"Monomer",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/pdb_parser.py#L337-L374 | train | 59,998 |
woolfson-group/isambard | isambard/ampal/specifications/assembly_specs/nucleic_acid_duplex.py | generate_antisense_sequence | def generate_antisense_sequence(sequence):
"""Creates the antisense sequence of a DNA strand."""
dna_antisense = {
'A': 'T',
'T': 'A',
'C': 'G',
'G': 'C'
}
antisense = [dna_antisense[x] for x in sequence[::-1]]
return ''.join(antisense) | python | def generate_antisense_sequence(sequence):
"""Creates the antisense sequence of a DNA strand."""
dna_antisense = {
'A': 'T',
'T': 'A',
'C': 'G',
'G': 'C'
}
antisense = [dna_antisense[x] for x in sequence[::-1]]
return ''.join(antisense) | [
"def",
"generate_antisense_sequence",
"(",
"sequence",
")",
":",
"dna_antisense",
"=",
"{",
"'A'",
":",
"'T'",
",",
"'T'",
":",
"'A'",
",",
"'C'",
":",
"'G'",
",",
"'G'",
":",
"'C'",
"}",
"antisense",
"=",
"[",
"dna_antisense",
"[",
"x",
"]",
"for",
... | Creates the antisense sequence of a DNA strand. | [
"Creates",
"the",
"antisense",
"sequence",
"of",
"a",
"DNA",
"strand",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/specifications/assembly_specs/nucleic_acid_duplex.py#L9-L18 | train | 59,999 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.