id int32 0 252k | 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 list | docstring stringlengths 3 17.3k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 87 242 |
|---|---|---|---|---|---|---|---|---|---|---|---|
43,000 | 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 |
43,001 | 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 |
43,002 | 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 |
43,003 | 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 |
43,004 | 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 |
43,005 | 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 |
43,006 | 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 |
43,007 | 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 |
43,008 | 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 |
43,009 | 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 |
43,010 | 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 |
43,011 | 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 |
43,012 | 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 |
43,013 | 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 |
43,014 | 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 |
43,015 | 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 |
43,016 | 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 |
43,017 | 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 |
43,018 | 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 |
43,019 | 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 |
43,020 | 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 |
43,021 | 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 |
43,022 | 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 |
43,023 | 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 |
43,024 | 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 |
43,025 | 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 |
43,026 | 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 |
43,027 | 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 |
43,028 | 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 |
43,029 | 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 |
43,030 | 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 |
43,031 | 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 |
43,032 | 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 |
43,033 | 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 |
43,034 | 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 |
43,035 | 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 |
43,036 | 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 |
43,037 | 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 |
43,038 | 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 |
43,039 | 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 |
43,040 | 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 |
43,041 | 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 |
43,042 | 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 |
43,043 | 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 |
43,044 | 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 |
43,045 | 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 |
43,046 | 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 |
43,047 | 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 |
43,048 | 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 |
43,049 | 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 |
43,050 | 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 |
43,051 | 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 |
43,052 | 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 |
43,053 | 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 |
43,054 | 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 |
43,055 | 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 |
43,056 | 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 |
43,057 | 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 |
43,058 | 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 |
43,059 | 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 |
43,060 | 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 |
43,061 | 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 |
43,062 | 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 |
43,063 | woolfson-group/isambard | isambard/ampal/specifications/assembly_specs/nucleic_acid_duplex.py | DNADuplex.from_sequence | def from_sequence(cls, sequence, phos_3_prime=False):
"""Creates a DNA duplex from a nucleotide sequence.
Parameters
----------
sequence: str
Nucleotide sequence.
phos_3_prime: bool, optional
If false the 5' and the 3' phosphor will be omitted.
""... | python | def from_sequence(cls, sequence, phos_3_prime=False):
"""Creates a DNA duplex from a nucleotide sequence.
Parameters
----------
sequence: str
Nucleotide sequence.
phos_3_prime: bool, optional
If false the 5' and the 3' phosphor will be omitted.
""... | [
"def",
"from_sequence",
"(",
"cls",
",",
"sequence",
",",
"phos_3_prime",
"=",
"False",
")",
":",
"strand1",
"=",
"NucleicAcidStrand",
"(",
"sequence",
",",
"phos_3_prime",
"=",
"phos_3_prime",
")",
"duplex",
"=",
"cls",
"(",
"strand1",
")",
"return",
"duple... | Creates a DNA duplex from a nucleotide sequence.
Parameters
----------
sequence: str
Nucleotide sequence.
phos_3_prime: bool, optional
If false the 5' and the 3' phosphor will be omitted. | [
"Creates",
"a",
"DNA",
"duplex",
"from",
"a",
"nucleotide",
"sequence",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/specifications/assembly_specs/nucleic_acid_duplex.py#L34-L46 |
43,064 | woolfson-group/isambard | isambard/ampal/specifications/assembly_specs/nucleic_acid_duplex.py | DNADuplex.from_start_and_end | def from_start_and_end(cls, start, end, sequence, phos_3_prime=False):
"""Creates a DNA duplex from a start and end point.
Parameters
----------
start: [float, float, float]
Start of the build axis.
end: [float, float, float]
End o... | python | def from_start_and_end(cls, start, end, sequence, phos_3_prime=False):
"""Creates a DNA duplex from a start and end point.
Parameters
----------
start: [float, float, float]
Start of the build axis.
end: [float, float, float]
End o... | [
"def",
"from_start_and_end",
"(",
"cls",
",",
"start",
",",
"end",
",",
"sequence",
",",
"phos_3_prime",
"=",
"False",
")",
":",
"strand1",
"=",
"NucleicAcidStrand",
".",
"from_start_and_end",
"(",
"start",
",",
"end",
",",
"sequence",
",",
"phos_3_prime",
"... | Creates a DNA duplex from a start and end point.
Parameters
----------
start: [float, float, float]
Start of the build axis.
end: [float, float, float]
End of build axis.
sequence: str
Nucleotide sequence.
... | [
"Creates",
"a",
"DNA",
"duplex",
"from",
"a",
"start",
"and",
"end",
"point",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/specifications/assembly_specs/nucleic_acid_duplex.py#L49-L65 |
43,065 | woolfson-group/isambard | isambard/ampal/specifications/assembly_specs/nucleic_acid_duplex.py | DNADuplex.generate_complementary_strand | def generate_complementary_strand(strand1):
"""Takes a SingleStrandHelix and creates the antisense strand."""
rise_adjust = (
strand1.rise_per_nucleotide * strand1.axis.unit_tangent) * 2
strand2 = NucleicAcidStrand.from_start_and_end(
strand1.helix_end - rise_adjust, stra... | python | def generate_complementary_strand(strand1):
"""Takes a SingleStrandHelix and creates the antisense strand."""
rise_adjust = (
strand1.rise_per_nucleotide * strand1.axis.unit_tangent) * 2
strand2 = NucleicAcidStrand.from_start_and_end(
strand1.helix_end - rise_adjust, stra... | [
"def",
"generate_complementary_strand",
"(",
"strand1",
")",
":",
"rise_adjust",
"=",
"(",
"strand1",
".",
"rise_per_nucleotide",
"*",
"strand1",
".",
"axis",
".",
"unit_tangent",
")",
"*",
"2",
"strand2",
"=",
"NucleicAcidStrand",
".",
"from_start_and_end",
"(",
... | Takes a SingleStrandHelix and creates the antisense strand. | [
"Takes",
"a",
"SingleStrandHelix",
"and",
"creates",
"the",
"antisense",
"strand",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/specifications/assembly_specs/nucleic_acid_duplex.py#L68-L82 |
43,066 | woolfson-group/isambard | isambard/external_programs/naccess.py | total_accessibility | def total_accessibility(in_rsa, path=True):
"""Parses rsa file for the total surface accessibility data.
Parameters
----------
in_rsa : str
Path to naccess rsa file.
path : bool
Indicates if in_rsa is a path or a string.
Returns
-------
dssp_residues : 5-tuple(float)
... | python | def total_accessibility(in_rsa, path=True):
"""Parses rsa file for the total surface accessibility data.
Parameters
----------
in_rsa : str
Path to naccess rsa file.
path : bool
Indicates if in_rsa is a path or a string.
Returns
-------
dssp_residues : 5-tuple(float)
... | [
"def",
"total_accessibility",
"(",
"in_rsa",
",",
"path",
"=",
"True",
")",
":",
"if",
"path",
":",
"with",
"open",
"(",
"in_rsa",
",",
"'r'",
")",
"as",
"inf",
":",
"rsa",
"=",
"inf",
".",
"read",
"(",
")",
"else",
":",
"rsa",
"=",
"in_rsa",
"["... | Parses rsa file for the total surface accessibility data.
Parameters
----------
in_rsa : str
Path to naccess rsa file.
path : bool
Indicates if in_rsa is a path or a string.
Returns
-------
dssp_residues : 5-tuple(float)
Total accessibility values for:
[0] a... | [
"Parses",
"rsa",
"file",
"for",
"the",
"total",
"surface",
"accessibility",
"data",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/external_programs/naccess.py#L77-L105 |
43,067 | woolfson-group/isambard | isambard/tools/amino_acids.py | get_aa_code | def get_aa_code(aa_letter):
""" Get three-letter aa code if possible. If not, return None.
If three-letter code is None, will have to find this later from the filesystem.
Parameters
----------
aa_letter : str
One-letter amino acid code.
Returns
-------
aa_code : str, or None
... | python | def get_aa_code(aa_letter):
""" Get three-letter aa code if possible. If not, return None.
If three-letter code is None, will have to find this later from the filesystem.
Parameters
----------
aa_letter : str
One-letter amino acid code.
Returns
-------
aa_code : str, or None
... | [
"def",
"get_aa_code",
"(",
"aa_letter",
")",
":",
"aa_code",
"=",
"None",
"if",
"aa_letter",
"!=",
"'X'",
":",
"for",
"key",
",",
"val",
"in",
"standard_amino_acids",
".",
"items",
"(",
")",
":",
"if",
"key",
"==",
"aa_letter",
":",
"aa_code",
"=",
"va... | Get three-letter aa code if possible. If not, return None.
If three-letter code is None, will have to find this later from the filesystem.
Parameters
----------
aa_letter : str
One-letter amino acid code.
Returns
-------
aa_code : str, or None
Three-letter aa code. | [
"Get",
"three",
"-",
"letter",
"aa",
"code",
"if",
"possible",
".",
"If",
"not",
"return",
"None",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/tools/amino_acids.py#L308-L328 |
43,068 | woolfson-group/isambard | isambard/tools/amino_acids.py | get_aa_letter | def get_aa_letter(aa_code):
""" Get one-letter version of aa_code if possible. If not, return 'X'.
Parameters
----------
aa_code : str
Three-letter amino acid code.
Returns
-------
aa_letter : str
One-letter aa code.
Default value is 'X'.
"""
aa_letter = 'X'... | python | def get_aa_letter(aa_code):
""" Get one-letter version of aa_code if possible. If not, return 'X'.
Parameters
----------
aa_code : str
Three-letter amino acid code.
Returns
-------
aa_letter : str
One-letter aa code.
Default value is 'X'.
"""
aa_letter = 'X'... | [
"def",
"get_aa_letter",
"(",
"aa_code",
")",
":",
"aa_letter",
"=",
"'X'",
"for",
"key",
",",
"val",
"in",
"standard_amino_acids",
".",
"items",
"(",
")",
":",
"if",
"val",
"==",
"aa_code",
":",
"aa_letter",
"=",
"key",
"return",
"aa_letter"
] | Get one-letter version of aa_code if possible. If not, return 'X'.
Parameters
----------
aa_code : str
Three-letter amino acid code.
Returns
-------
aa_letter : str
One-letter aa code.
Default value is 'X'. | [
"Get",
"one",
"-",
"letter",
"version",
"of",
"aa_code",
"if",
"possible",
".",
"If",
"not",
"return",
"X",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/tools/amino_acids.py#L331-L350 |
43,069 | woolfson-group/isambard | isambard/tools/amino_acids.py | get_aa_info | def get_aa_info(code):
"""Get dictionary of information relating to a new amino acid code not currently in the database.
Notes
-----
Use this function to get a dictionary that is then to be sent to the function add_amino_acid_to_json().
use to fill in rows of amino_acid table for new amino acid cod... | python | def get_aa_info(code):
"""Get dictionary of information relating to a new amino acid code not currently in the database.
Notes
-----
Use this function to get a dictionary that is then to be sent to the function add_amino_acid_to_json().
use to fill in rows of amino_acid table for new amino acid cod... | [
"def",
"get_aa_info",
"(",
"code",
")",
":",
"letter",
"=",
"'X'",
"# Try to get content from PDBE.",
"url_string",
"=",
"'http://www.ebi.ac.uk/pdbe-srv/pdbechem/chemicalCompound/show/{0}'",
".",
"format",
"(",
"code",
")",
"r",
"=",
"requests",
".",
"get",
"(",
"url_... | Get dictionary of information relating to a new amino acid code not currently in the database.
Notes
-----
Use this function to get a dictionary that is then to be sent to the function add_amino_acid_to_json().
use to fill in rows of amino_acid table for new amino acid code.
Parameters
-------... | [
"Get",
"dictionary",
"of",
"information",
"relating",
"to",
"a",
"new",
"amino",
"acid",
"code",
"not",
"currently",
"in",
"the",
"database",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/tools/amino_acids.py#L353-L394 |
43,070 | woolfson-group/isambard | isambard/tools/amino_acids.py | add_amino_acid_to_json | def add_amino_acid_to_json(code, description, letter='X', modified=None, force_add=False):
""" Add an amino acid to the amino_acids.json file used to populate the amino_acid table.
Parameters
----------
code : str
New code to be added to amino acid table.
description : str
Descripti... | python | def add_amino_acid_to_json(code, description, letter='X', modified=None, force_add=False):
""" Add an amino acid to the amino_acids.json file used to populate the amino_acid table.
Parameters
----------
code : str
New code to be added to amino acid table.
description : str
Descripti... | [
"def",
"add_amino_acid_to_json",
"(",
"code",
",",
"description",
",",
"letter",
"=",
"'X'",
",",
"modified",
"=",
"None",
",",
"force_add",
"=",
"False",
")",
":",
"# If code is already in the dictionary, raise an error",
"if",
"(",
"not",
"force_add",
")",
"and"... | Add an amino acid to the amino_acids.json file used to populate the amino_acid table.
Parameters
----------
code : str
New code to be added to amino acid table.
description : str
Description of the amino acid, e.g. 'amidated terminal carboxy group'.
letter : str, optional
On... | [
"Add",
"an",
"amino",
"acid",
"to",
"the",
"amino_acids",
".",
"json",
"file",
"used",
"to",
"populate",
"the",
"amino_acid",
"table",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/tools/amino_acids.py#L397-L442 |
43,071 | woolfson-group/isambard | isambard/ampal/specifications/assembly_specs/coiledcoil.py | CoiledCoil.from_polymers | def from_polymers(cls, polymers):
"""Creates a `CoiledCoil` from a list of `HelicalHelices`.
Parameters
----------
polymers : [HelicalHelix]
List of `HelicalHelices`.
"""
n = len(polymers)
instance = cls(n=n, auto_build=False)
instance.major_r... | python | def from_polymers(cls, polymers):
"""Creates a `CoiledCoil` from a list of `HelicalHelices`.
Parameters
----------
polymers : [HelicalHelix]
List of `HelicalHelices`.
"""
n = len(polymers)
instance = cls(n=n, auto_build=False)
instance.major_r... | [
"def",
"from_polymers",
"(",
"cls",
",",
"polymers",
")",
":",
"n",
"=",
"len",
"(",
"polymers",
")",
"instance",
"=",
"cls",
"(",
"n",
"=",
"n",
",",
"auto_build",
"=",
"False",
")",
"instance",
".",
"major_radii",
"=",
"[",
"x",
".",
"major_radius"... | Creates a `CoiledCoil` from a list of `HelicalHelices`.
Parameters
----------
polymers : [HelicalHelix]
List of `HelicalHelices`. | [
"Creates",
"a",
"CoiledCoil",
"from",
"a",
"list",
"of",
"HelicalHelices",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/specifications/assembly_specs/coiledcoil.py#L109-L128 |
43,072 | woolfson-group/isambard | isambard/ampal/specifications/assembly_specs/coiledcoil.py | CoiledCoil.from_parameters | def from_parameters(cls, n, aa=28, major_radius=None, major_pitch=None,
phi_c_alpha=26.42, minor_helix_type='alpha',
auto_build=True):
"""Creates a `CoiledCoil` from defined super-helical parameters.
Parameters
----------
n : int
... | python | def from_parameters(cls, n, aa=28, major_radius=None, major_pitch=None,
phi_c_alpha=26.42, minor_helix_type='alpha',
auto_build=True):
"""Creates a `CoiledCoil` from defined super-helical parameters.
Parameters
----------
n : int
... | [
"def",
"from_parameters",
"(",
"cls",
",",
"n",
",",
"aa",
"=",
"28",
",",
"major_radius",
"=",
"None",
",",
"major_pitch",
"=",
"None",
",",
"phi_c_alpha",
"=",
"26.42",
",",
"minor_helix_type",
"=",
"'alpha'",
",",
"auto_build",
"=",
"True",
")",
":",
... | Creates a `CoiledCoil` from defined super-helical parameters.
Parameters
----------
n : int
Oligomeric state
aa : int, optional
Number of amino acids per minor helix.
major_radius : float, optional
Radius of super helix.
major_pitch : ... | [
"Creates",
"a",
"CoiledCoil",
"from",
"defined",
"super",
"-",
"helical",
"parameters",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/specifications/assembly_specs/coiledcoil.py#L131-L165 |
43,073 | woolfson-group/isambard | isambard/ampal/specifications/assembly_specs/coiledcoil.py | CoiledCoil.tropocollagen | def tropocollagen(
cls, aa=28, major_radius=5.0, major_pitch=85.0, auto_build=True):
"""Creates a model of a collagen triple helix.
Parameters
----------
aa : int, optional
Number of amino acids per minor helix.
major_radius : float, optional
... | python | def tropocollagen(
cls, aa=28, major_radius=5.0, major_pitch=85.0, auto_build=True):
"""Creates a model of a collagen triple helix.
Parameters
----------
aa : int, optional
Number of amino acids per minor helix.
major_radius : float, optional
... | [
"def",
"tropocollagen",
"(",
"cls",
",",
"aa",
"=",
"28",
",",
"major_radius",
"=",
"5.0",
",",
"major_pitch",
"=",
"85.0",
",",
"auto_build",
"=",
"True",
")",
":",
"instance",
"=",
"cls",
".",
"from_parameters",
"(",
"n",
"=",
"3",
",",
"aa",
"=",
... | Creates a model of a collagen triple helix.
Parameters
----------
aa : int, optional
Number of amino acids per minor helix.
major_radius : float, optional
Radius of super helix.
major_pitch : float, optional
Pitch of super helix.
auto_... | [
"Creates",
"a",
"model",
"of",
"a",
"collagen",
"triple",
"helix",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/specifications/assembly_specs/coiledcoil.py#L168-L193 |
43,074 | woolfson-group/isambard | isambard/ampal/specifications/assembly_specs/coiledcoil.py | CoiledCoil.build | def build(self):
"""Builds a model of a coiled coil protein using input parameters."""
monomers = [HelicalHelix(major_pitch=self.major_pitches[i],
major_radius=self.major_radii[i],
major_handedness=self.major_handedness[i],
... | python | def build(self):
"""Builds a model of a coiled coil protein using input parameters."""
monomers = [HelicalHelix(major_pitch=self.major_pitches[i],
major_radius=self.major_radii[i],
major_handedness=self.major_handedness[i],
... | [
"def",
"build",
"(",
"self",
")",
":",
"monomers",
"=",
"[",
"HelicalHelix",
"(",
"major_pitch",
"=",
"self",
".",
"major_pitches",
"[",
"i",
"]",
",",
"major_radius",
"=",
"self",
".",
"major_radii",
"[",
"i",
"]",
",",
"major_handedness",
"=",
"self",
... | Builds a model of a coiled coil protein using input parameters. | [
"Builds",
"a",
"model",
"of",
"a",
"coiled",
"coil",
"protein",
"using",
"input",
"parameters",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/specifications/assembly_specs/coiledcoil.py#L195-L215 |
43,075 | woolfson-group/isambard | isambard/buff/force_field.py | BuffForceField.find_max_rad_npnp | def find_max_rad_npnp(self):
"""Finds the maximum radius and npnp in the force field.
Returns
-------
(max_rad, max_npnp): (float, float)
Maximum radius and npnp distance in the loaded force field.
"""
max_rad = 0
max_npnp = 0
for res, atoms i... | python | def find_max_rad_npnp(self):
"""Finds the maximum radius and npnp in the force field.
Returns
-------
(max_rad, max_npnp): (float, float)
Maximum radius and npnp distance in the loaded force field.
"""
max_rad = 0
max_npnp = 0
for res, atoms i... | [
"def",
"find_max_rad_npnp",
"(",
"self",
")",
":",
"max_rad",
"=",
"0",
"max_npnp",
"=",
"0",
"for",
"res",
",",
"atoms",
"in",
"self",
".",
"items",
"(",
")",
":",
"if",
"res",
"!=",
"'KEY'",
":",
"for",
"atom",
",",
"ff_params",
"in",
"self",
"["... | Finds the maximum radius and npnp in the force field.
Returns
-------
(max_rad, max_npnp): (float, float)
Maximum radius and npnp distance in the loaded force field. | [
"Finds",
"the",
"maximum",
"radius",
"and",
"npnp",
"in",
"the",
"force",
"field",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/buff/force_field.py#L70-L87 |
43,076 | woolfson-group/isambard | isambard/buff/force_field.py | BuffForceField.parameter_struct_dict | def parameter_struct_dict(self):
"""Dictionary containing PyAtomData structs for the force field."""
if self._parameter_struct_dict is None:
self._parameter_struct_dict = self._make_ff_params_dict()
elif self.auto_update_f_params:
new_hash = hash(
tuple([t... | python | def parameter_struct_dict(self):
"""Dictionary containing PyAtomData structs for the force field."""
if self._parameter_struct_dict is None:
self._parameter_struct_dict = self._make_ff_params_dict()
elif self.auto_update_f_params:
new_hash = hash(
tuple([t... | [
"def",
"parameter_struct_dict",
"(",
"self",
")",
":",
"if",
"self",
".",
"_parameter_struct_dict",
"is",
"None",
":",
"self",
".",
"_parameter_struct_dict",
"=",
"self",
".",
"_make_ff_params_dict",
"(",
")",
"elif",
"self",
".",
"auto_update_f_params",
":",
"n... | Dictionary containing PyAtomData structs for the force field. | [
"Dictionary",
"containing",
"PyAtomData",
"structs",
"for",
"the",
"force",
"field",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/buff/force_field.py#L90-L102 |
43,077 | woolfson-group/isambard | isambard/external_programs/reduce.py | run_reduce | def run_reduce(input_file, path=True):
""" Runs reduce on a pdb or mmol file at the specified path.
Notes
-----
Runs Reduce programme to add missing protons to a PDB file.
Parameters
----------
input_file : str
Path to file to add protons to or structure in mmol/pdb format.
pat... | python | def run_reduce(input_file, path=True):
""" Runs reduce on a pdb or mmol file at the specified path.
Notes
-----
Runs Reduce programme to add missing protons to a PDB file.
Parameters
----------
input_file : str
Path to file to add protons to or structure in mmol/pdb format.
pat... | [
"def",
"run_reduce",
"(",
"input_file",
",",
"path",
"=",
"True",
")",
":",
"if",
"path",
":",
"input_path",
"=",
"Path",
"(",
"input_file",
")",
"if",
"not",
"input_path",
".",
"exists",
"(",
")",
":",
"print",
"(",
"'No file found at'",
",",
"path",
... | Runs reduce on a pdb or mmol file at the specified path.
Notes
-----
Runs Reduce programme to add missing protons to a PDB file.
Parameters
----------
input_file : str
Path to file to add protons to or structure in mmol/pdb format.
path : bool, optional
True if input_file i... | [
"Runs",
"reduce",
"on",
"a",
"pdb",
"or",
"mmol",
"file",
"at",
"the",
"specified",
"path",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/external_programs/reduce.py#L23-L86 |
43,078 | woolfson-group/isambard | isambard/external_programs/reduce.py | reduce_output_path | def reduce_output_path(path=None, pdb_name=None):
"""Defines location of Reduce output files relative to input files."""
if not path:
if not pdb_name:
raise NameError(
"Cannot save an output for a temporary file without a PDB"
"code specified")
pdb_nam... | python | def reduce_output_path(path=None, pdb_name=None):
"""Defines location of Reduce output files relative to input files."""
if not path:
if not pdb_name:
raise NameError(
"Cannot save an output for a temporary file without a PDB"
"code specified")
pdb_nam... | [
"def",
"reduce_output_path",
"(",
"path",
"=",
"None",
",",
"pdb_name",
"=",
"None",
")",
":",
"if",
"not",
"path",
":",
"if",
"not",
"pdb_name",
":",
"raise",
"NameError",
"(",
"\"Cannot save an output for a temporary file without a PDB\"",
"\"code specified\"",
")... | Defines location of Reduce output files relative to input files. | [
"Defines",
"location",
"of",
"Reduce",
"output",
"files",
"relative",
"to",
"input",
"files",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/external_programs/reduce.py#L89-L108 |
43,079 | woolfson-group/isambard | isambard/external_programs/reduce.py | output_reduce | def output_reduce(input_file, path=True, pdb_name=None, force=False):
"""Runs Reduce on a pdb or mmol file and creates a new file with the output.
Parameters
----------
input_file : str or pathlib.Path
Path to file to run Reduce on.
path : bool
True if input_file is a path.
pdb_n... | python | def output_reduce(input_file, path=True, pdb_name=None, force=False):
"""Runs Reduce on a pdb or mmol file and creates a new file with the output.
Parameters
----------
input_file : str or pathlib.Path
Path to file to run Reduce on.
path : bool
True if input_file is a path.
pdb_n... | [
"def",
"output_reduce",
"(",
"input_file",
",",
"path",
"=",
"True",
",",
"pdb_name",
"=",
"None",
",",
"force",
"=",
"False",
")",
":",
"if",
"path",
":",
"output_path",
"=",
"reduce_output_path",
"(",
"path",
"=",
"input_file",
")",
"else",
":",
"outpu... | Runs Reduce on a pdb or mmol file and creates a new file with the output.
Parameters
----------
input_file : str or pathlib.Path
Path to file to run Reduce on.
path : bool
True if input_file is a path.
pdb_name : str
PDB ID of protein. Required if providing string not path.
... | [
"Runs",
"Reduce",
"on",
"a",
"pdb",
"or",
"mmol",
"file",
"and",
"creates",
"a",
"new",
"file",
"with",
"the",
"output",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/external_programs/reduce.py#L111-L141 |
43,080 | woolfson-group/isambard | isambard/external_programs/reduce.py | output_reduce_list | def output_reduce_list(path_list, force=False):
"""Generates structure file with protons from a list of structure files."""
output_paths = []
for path in path_list:
output_path = output_reduce(path, force=force)
if output_path:
output_paths.append(output_path)
return output_p... | python | def output_reduce_list(path_list, force=False):
"""Generates structure file with protons from a list of structure files."""
output_paths = []
for path in path_list:
output_path = output_reduce(path, force=force)
if output_path:
output_paths.append(output_path)
return output_p... | [
"def",
"output_reduce_list",
"(",
"path_list",
",",
"force",
"=",
"False",
")",
":",
"output_paths",
"=",
"[",
"]",
"for",
"path",
"in",
"path_list",
":",
"output_path",
"=",
"output_reduce",
"(",
"path",
",",
"force",
"=",
"force",
")",
"if",
"output_path... | Generates structure file with protons from a list of structure files. | [
"Generates",
"structure",
"file",
"with",
"protons",
"from",
"a",
"list",
"of",
"structure",
"files",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/external_programs/reduce.py#L144-L151 |
43,081 | woolfson-group/isambard | isambard/external_programs/reduce.py | assembly_plus_protons | def assembly_plus_protons(input_file, path=True, pdb_name=None,
save_output=False, force_save=False):
"""Returns an Assembly with protons added by Reduce.
Notes
-----
Looks for a pre-existing Reduce output in the standard location before
running Reduce. If the protein cont... | python | def assembly_plus_protons(input_file, path=True, pdb_name=None,
save_output=False, force_save=False):
"""Returns an Assembly with protons added by Reduce.
Notes
-----
Looks for a pre-existing Reduce output in the standard location before
running Reduce. If the protein cont... | [
"def",
"assembly_plus_protons",
"(",
"input_file",
",",
"path",
"=",
"True",
",",
"pdb_name",
"=",
"None",
",",
"save_output",
"=",
"False",
",",
"force_save",
"=",
"False",
")",
":",
"from",
"ampal",
".",
"pdb_parser",
"import",
"convert_pdb_to_ampal",
"if",
... | Returns an Assembly with protons added by Reduce.
Notes
-----
Looks for a pre-existing Reduce output in the standard location before
running Reduce. If the protein contains oligosaccharides or glycans,
use reduce_correct_carbohydrates.
Parameters
----------
input_file : str or pathlib.... | [
"Returns",
"an",
"Assembly",
"with",
"protons",
"added",
"by",
"Reduce",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/external_programs/reduce.py#L154-L203 |
43,082 | woolfson-group/isambard | isambard/ampal/specifications/polymer_specs/helix.py | Helix.from_start_and_end | def from_start_and_end(cls, start, end, aa=None, helix_type='alpha'):
"""Creates a `Helix` between `start` and `end`.
Parameters
----------
start : 3D Vector (tuple or list or numpy.array)
The coordinate of the start of the helix primitive.
end : 3D Vector (tuple or ... | python | def from_start_and_end(cls, start, end, aa=None, helix_type='alpha'):
"""Creates a `Helix` between `start` and `end`.
Parameters
----------
start : 3D Vector (tuple or list or numpy.array)
The coordinate of the start of the helix primitive.
end : 3D Vector (tuple or ... | [
"def",
"from_start_and_end",
"(",
"cls",
",",
"start",
",",
"end",
",",
"aa",
"=",
"None",
",",
"helix_type",
"=",
"'alpha'",
")",
":",
"start",
"=",
"numpy",
".",
"array",
"(",
"start",
")",
"end",
"=",
"numpy",
".",
"array",
"(",
"end",
")",
"if"... | Creates a `Helix` between `start` and `end`.
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 of the helix primitive... | [
"Creates",
"a",
"Helix",
"between",
"start",
"and",
"end",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/specifications/polymer_specs/helix.py#L123-L146 |
43,083 | woolfson-group/isambard | isambard/ampal/specifications/polymer_specs/helix.py | Helix.build | def build(self):
"""Build straight helix along z-axis, starting with CA1 on x-axis"""
ang_per_res = (2 * numpy.pi) / self.residues_per_turn
atom_offsets = _atom_offsets[self.helix_type]
if self.handedness == 'l':
handedness = -1
else:
handedness = 1
... | python | def build(self):
"""Build straight helix along z-axis, starting with CA1 on x-axis"""
ang_per_res = (2 * numpy.pi) / self.residues_per_turn
atom_offsets = _atom_offsets[self.helix_type]
if self.handedness == 'l':
handedness = -1
else:
handedness = 1
... | [
"def",
"build",
"(",
"self",
")",
":",
"ang_per_res",
"=",
"(",
"2",
"*",
"numpy",
".",
"pi",
")",
"/",
"self",
".",
"residues_per_turn",
"atom_offsets",
"=",
"_atom_offsets",
"[",
"self",
".",
"helix_type",
"]",
"if",
"self",
".",
"handedness",
"==",
... | Build straight helix along z-axis, starting with CA1 on x-axis | [
"Build",
"straight",
"helix",
"along",
"z",
"-",
"axis",
"starting",
"with",
"CA1",
"on",
"x",
"-",
"axis"
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/specifications/polymer_specs/helix.py#L189-L223 |
43,084 | woolfson-group/isambard | isambard/ampal/specifications/polymer_specs/helix.py | HelicalHelix.from_start_and_end | def from_start_and_end(cls, start, end, aa=None, major_pitch=225.8,
major_radius=5.07, major_handedness='l',
minor_helix_type='alpha', orientation=1,
phi_c_alpha=0.0, minor_repeat=None):
"""Creates a `HelicalHelix` between a `start... | python | def from_start_and_end(cls, start, end, aa=None, major_pitch=225.8,
major_radius=5.07, major_handedness='l',
minor_helix_type='alpha', orientation=1,
phi_c_alpha=0.0, minor_repeat=None):
"""Creates a `HelicalHelix` between a `start... | [
"def",
"from_start_and_end",
"(",
"cls",
",",
"start",
",",
"end",
",",
"aa",
"=",
"None",
",",
"major_pitch",
"=",
"225.8",
",",
"major_radius",
"=",
"5.07",
",",
"major_handedness",
"=",
"'l'",
",",
"minor_helix_type",
"=",
"'alpha'",
",",
"orientation",
... | Creates a `HelicalHelix` between a `start` and `end` point. | [
"Creates",
"a",
"HelicalHelix",
"between",
"a",
"start",
"and",
"end",
"point",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/specifications/polymer_specs/helix.py#L340-L357 |
43,085 | woolfson-group/isambard | isambard/ampal/specifications/polymer_specs/helix.py | HelicalHelix.curve | def curve(self):
"""Curve of the super helix."""
return HelicalCurve.pitch_and_radius(
self.major_pitch, self.major_radius,
handedness=self.major_handedness) | python | def curve(self):
"""Curve of the super helix."""
return HelicalCurve.pitch_and_radius(
self.major_pitch, self.major_radius,
handedness=self.major_handedness) | [
"def",
"curve",
"(",
"self",
")",
":",
"return",
"HelicalCurve",
".",
"pitch_and_radius",
"(",
"self",
".",
"major_pitch",
",",
"self",
".",
"major_radius",
",",
"handedness",
"=",
"self",
".",
"major_handedness",
")"
] | Curve of the super helix. | [
"Curve",
"of",
"the",
"super",
"helix",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/specifications/polymer_specs/helix.py#L370-L374 |
43,086 | woolfson-group/isambard | isambard/ampal/specifications/polymer_specs/helix.py | HelicalHelix.curve_primitive | def curve_primitive(self):
"""`Primitive` of the super-helical curve."""
curve = self.curve
curve.axis_start = self.helix_start
curve.axis_end = self.helix_end
coords = curve.get_coords(
n_points=(self.num_monomers + 1), spacing=self.minor_rise_per_residue)
if... | python | def curve_primitive(self):
"""`Primitive` of the super-helical curve."""
curve = self.curve
curve.axis_start = self.helix_start
curve.axis_end = self.helix_end
coords = curve.get_coords(
n_points=(self.num_monomers + 1), spacing=self.minor_rise_per_residue)
if... | [
"def",
"curve_primitive",
"(",
"self",
")",
":",
"curve",
"=",
"self",
".",
"curve",
"curve",
".",
"axis_start",
"=",
"self",
".",
"helix_start",
"curve",
".",
"axis_end",
"=",
"self",
".",
"helix_end",
"coords",
"=",
"curve",
".",
"get_coords",
"(",
"n_... | `Primitive` of the super-helical curve. | [
"Primitive",
"of",
"the",
"super",
"-",
"helical",
"curve",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/specifications/polymer_specs/helix.py#L377-L386 |
43,087 | woolfson-group/isambard | isambard/ampal/specifications/polymer_specs/helix.py | HelicalHelix.major_rise_per_monomer | def major_rise_per_monomer(self):
"""Rise along super-helical axis per monomer."""
return numpy.cos(numpy.deg2rad(self.curve.alpha)) * self.minor_rise_per_residue | python | def major_rise_per_monomer(self):
"""Rise along super-helical axis per monomer."""
return numpy.cos(numpy.deg2rad(self.curve.alpha)) * self.minor_rise_per_residue | [
"def",
"major_rise_per_monomer",
"(",
"self",
")",
":",
"return",
"numpy",
".",
"cos",
"(",
"numpy",
".",
"deg2rad",
"(",
"self",
".",
"curve",
".",
"alpha",
")",
")",
"*",
"self",
".",
"minor_rise_per_residue"
] | Rise along super-helical axis per monomer. | [
"Rise",
"along",
"super",
"-",
"helical",
"axis",
"per",
"monomer",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/specifications/polymer_specs/helix.py#L389-L391 |
43,088 | woolfson-group/isambard | isambard/ampal/specifications/polymer_specs/helix.py | HelicalHelix.minor_residues_per_turn | def minor_residues_per_turn(self, minor_repeat=None):
"""Calculates the number of residues per turn of the minor helix.
Parameters
----------
minor_repeat : float, optional
Hydrophobic repeat of the minor helix.
Returns
-------
minor_rpt : float
... | python | def minor_residues_per_turn(self, minor_repeat=None):
"""Calculates the number of residues per turn of the minor helix.
Parameters
----------
minor_repeat : float, optional
Hydrophobic repeat of the minor helix.
Returns
-------
minor_rpt : float
... | [
"def",
"minor_residues_per_turn",
"(",
"self",
",",
"minor_repeat",
"=",
"None",
")",
":",
"if",
"minor_repeat",
"is",
"None",
":",
"minor_rpt",
"=",
"_helix_parameters",
"[",
"self",
".",
"minor_helix_type",
"]",
"[",
"0",
"]",
"else",
":",
"# precession angl... | Calculates the number of residues per turn of the minor helix.
Parameters
----------
minor_repeat : float, optional
Hydrophobic repeat of the minor helix.
Returns
-------
minor_rpt : float
Residues per turn of the minor helix. | [
"Calculates",
"the",
"number",
"of",
"residues",
"per",
"turn",
"of",
"the",
"minor",
"helix",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/specifications/polymer_specs/helix.py#L393-L418 |
43,089 | woolfson-group/isambard | isambard/ampal/specifications/polymer_specs/helix.py | HelicalHelix.build | def build(self):
"""Builds the `HelicalHelix`."""
helical_helix = Polypeptide()
primitive_coords = self.curve_primitive.coordinates
helices = [Helix.from_start_and_end(start=primitive_coords[i],
end=primitive_coords[i + 1],
... | python | def build(self):
"""Builds the `HelicalHelix`."""
helical_helix = Polypeptide()
primitive_coords = self.curve_primitive.coordinates
helices = [Helix.from_start_and_end(start=primitive_coords[i],
end=primitive_coords[i + 1],
... | [
"def",
"build",
"(",
"self",
")",
":",
"helical_helix",
"=",
"Polypeptide",
"(",
")",
"primitive_coords",
"=",
"self",
".",
"curve_primitive",
".",
"coordinates",
"helices",
"=",
"[",
"Helix",
".",
"from_start_and_end",
"(",
"start",
"=",
"primitive_coords",
"... | Builds the `HelicalHelix`. | [
"Builds",
"the",
"HelicalHelix",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/specifications/polymer_specs/helix.py#L420-L459 |
43,090 | woolfson-group/isambard | isambard/ampal/specifications/polymer_specs/helix.py | HelicalHelix.rotate_monomers | def rotate_monomers(self, angle, radians=False):
""" Rotates each Residue in the Polypeptide.
Notes
-----
Each monomer is rotated about the axis formed between its
corresponding primitive `PseudoAtom` and that of the
subsequent `Monomer`.
Parameters
---... | python | def rotate_monomers(self, angle, radians=False):
""" Rotates each Residue in the Polypeptide.
Notes
-----
Each monomer is rotated about the axis formed between its
corresponding primitive `PseudoAtom` and that of the
subsequent `Monomer`.
Parameters
---... | [
"def",
"rotate_monomers",
"(",
"self",
",",
"angle",
",",
"radians",
"=",
"False",
")",
":",
"if",
"radians",
":",
"angle",
"=",
"numpy",
".",
"rad2deg",
"(",
"angle",
")",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"self",
".",
"primitive",
")",
... | Rotates each Residue in the Polypeptide.
Notes
-----
Each monomer is rotated about the axis formed between its
corresponding primitive `PseudoAtom` and that of the
subsequent `Monomer`.
Parameters
----------
angle : float
Angle by which to r... | [
"Rotates",
"each",
"Residue",
"in",
"the",
"Polypeptide",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/ampal/specifications/polymer_specs/helix.py#L538-L560 |
43,091 | woolfson-group/isambard | isambard/add_ons/knobs_into_holes.py | side_chain_centres | def side_chain_centres(assembly, masses=False):
""" PseudoGroup containing side_chain centres of each Residue in each Polypeptide in Assembly.
Notes
-----
Each PseudoAtom is a side-chain centre.
There is one PseudoMonomer per chain in ampal (each containing len(chain) PseudoAtoms).
The PseudoGr... | python | def side_chain_centres(assembly, masses=False):
""" PseudoGroup containing side_chain centres of each Residue in each Polypeptide in Assembly.
Notes
-----
Each PseudoAtom is a side-chain centre.
There is one PseudoMonomer per chain in ampal (each containing len(chain) PseudoAtoms).
The PseudoGr... | [
"def",
"side_chain_centres",
"(",
"assembly",
",",
"masses",
"=",
"False",
")",
":",
"if",
"masses",
":",
"elts",
"=",
"set",
"(",
"[",
"x",
".",
"element",
"for",
"x",
"in",
"assembly",
".",
"get_atoms",
"(",
")",
"]",
")",
"masses_dict",
"=",
"{",
... | PseudoGroup containing side_chain centres of each Residue in each Polypeptide in Assembly.
Notes
-----
Each PseudoAtom is a side-chain centre.
There is one PseudoMonomer per chain in ampal (each containing len(chain) PseudoAtoms).
The PseudoGroup has len(ampal) PseudoMonomers.
Parameters
-... | [
"PseudoGroup",
"containing",
"side_chain",
"centres",
"of",
"each",
"Residue",
"in",
"each",
"Polypeptide",
"in",
"Assembly",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/add_ons/knobs_into_holes.py#L30-L71 |
43,092 | woolfson-group/isambard | isambard/add_ons/knobs_into_holes.py | cluster_helices | def cluster_helices(helices, cluster_distance=12.0):
""" Clusters helices according to the minimum distance between the line segments representing their backbone.
Notes
-----
Each helix is represented as a line segement joining the CA of its first Residue to the CA if its final Residue.
The minimal... | python | def cluster_helices(helices, cluster_distance=12.0):
""" Clusters helices according to the minimum distance between the line segments representing their backbone.
Notes
-----
Each helix is represented as a line segement joining the CA of its first Residue to the CA if its final Residue.
The minimal... | [
"def",
"cluster_helices",
"(",
"helices",
",",
"cluster_distance",
"=",
"12.0",
")",
":",
"condensed_distance_matrix",
"=",
"[",
"]",
"for",
"h1",
",",
"h2",
"in",
"itertools",
".",
"combinations",
"(",
"helices",
",",
"2",
")",
":",
"md",
"=",
"minimal_di... | Clusters helices according to the minimum distance between the line segments representing their backbone.
Notes
-----
Each helix is represented as a line segement joining the CA of its first Residue to the CA if its final Residue.
The minimal distance between pairwise line segments is calculated and st... | [
"Clusters",
"helices",
"according",
"to",
"the",
"minimum",
"distance",
"between",
"the",
"line",
"segments",
"representing",
"their",
"backbone",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/add_ons/knobs_into_holes.py#L74-L111 |
43,093 | woolfson-group/isambard | isambard/add_ons/knobs_into_holes.py | find_kihs | def find_kihs(assembly, hole_size=4, cutoff=7.0):
""" KnobIntoHoles between residues of different chains in assembly.
Notes
-----
A KnobIntoHole is a found when the side-chain centre of a Residue a chain is close than (cutoff) Angstroms from at
least (hole_size) side-chain centres of Residues of a ... | python | def find_kihs(assembly, hole_size=4, cutoff=7.0):
""" KnobIntoHoles between residues of different chains in assembly.
Notes
-----
A KnobIntoHole is a found when the side-chain centre of a Residue a chain is close than (cutoff) Angstroms from at
least (hole_size) side-chain centres of Residues of a ... | [
"def",
"find_kihs",
"(",
"assembly",
",",
"hole_size",
"=",
"4",
",",
"cutoff",
"=",
"7.0",
")",
":",
"pseudo_group",
"=",
"side_chain_centres",
"(",
"assembly",
"=",
"assembly",
",",
"masses",
"=",
"False",
")",
"pairs",
"=",
"itertools",
".",
"permutatio... | KnobIntoHoles between residues of different chains in assembly.
Notes
-----
A KnobIntoHole is a found when the side-chain centre of a Residue a chain is close than (cutoff) Angstroms from at
least (hole_size) side-chain centres of Residues of a different chain.
Parameters
----------
assemb... | [
"KnobIntoHoles",
"between",
"residues",
"of",
"different",
"chains",
"in",
"assembly",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/add_ons/knobs_into_holes.py#L114-L151 |
43,094 | woolfson-group/isambard | isambard/add_ons/knobs_into_holes.py | find_contiguous_packing_segments | def find_contiguous_packing_segments(polypeptide, residues, max_dist=10.0):
""" Assembly containing segments of polypeptide, divided according to separation of contiguous residues.
Parameters
----------
polypeptide : Polypeptide
residues : iterable containing Residues
max_dist : float
S... | python | def find_contiguous_packing_segments(polypeptide, residues, max_dist=10.0):
""" Assembly containing segments of polypeptide, divided according to separation of contiguous residues.
Parameters
----------
polypeptide : Polypeptide
residues : iterable containing Residues
max_dist : float
S... | [
"def",
"find_contiguous_packing_segments",
"(",
"polypeptide",
",",
"residues",
",",
"max_dist",
"=",
"10.0",
")",
":",
"segments",
"=",
"Assembly",
"(",
"assembly_id",
"=",
"polypeptide",
".",
"ampal_parent",
".",
"id",
")",
"residues_in_polypeptide",
"=",
"list"... | Assembly containing segments of polypeptide, divided according to separation of contiguous residues.
Parameters
----------
polypeptide : Polypeptide
residues : iterable containing Residues
max_dist : float
Separation beyond which splitting of Polymer occurs.
Returns
-------
seg... | [
"Assembly",
"containing",
"segments",
"of",
"polypeptide",
"divided",
"according",
"to",
"separation",
"of",
"contiguous",
"residues",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/add_ons/knobs_into_holes.py#L154-L190 |
43,095 | woolfson-group/isambard | isambard/add_ons/knobs_into_holes.py | gen_reference_primitive | def gen_reference_primitive(polypeptide, start, end):
""" Generates a reference Primitive for a Polypeptide given start and end coordinates.
Notes
-----
Uses the rise_per_residue of the Polypeptide primitive to define the separation of points on the line joining
start and end.
Parameters
-... | python | def gen_reference_primitive(polypeptide, start, end):
""" Generates a reference Primitive for a Polypeptide given start and end coordinates.
Notes
-----
Uses the rise_per_residue of the Polypeptide primitive to define the separation of points on the line joining
start and end.
Parameters
-... | [
"def",
"gen_reference_primitive",
"(",
"polypeptide",
",",
"start",
",",
"end",
")",
":",
"prim",
"=",
"polypeptide",
".",
"primitive",
"q",
"=",
"find_foot",
"(",
"a",
"=",
"start",
",",
"b",
"=",
"end",
",",
"p",
"=",
"prim",
".",
"coordinates",
"[",... | Generates a reference Primitive for a Polypeptide given start and end coordinates.
Notes
-----
Uses the rise_per_residue of the Polypeptide primitive to define the separation of points on the line joining
start and end.
Parameters
----------
polypeptide : Polypeptide
start : numpy.arra... | [
"Generates",
"a",
"reference",
"Primitive",
"for",
"a",
"Polypeptide",
"given",
"start",
"and",
"end",
"coordinates",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/add_ons/knobs_into_holes.py#L618-L652 |
43,096 | woolfson-group/isambard | isambard/add_ons/knobs_into_holes.py | KnobGroup.from_helices | def from_helices(cls, assembly, cutoff=7.0, min_helix_length=8):
""" Generate KnobGroup from the helices in the assembly - classic socket functionality.
Notes
-----
Socket identifies knobs-into-holes (KIHs) packing motifs in protein structures.
The following resources can provid... | python | def from_helices(cls, assembly, cutoff=7.0, min_helix_length=8):
""" Generate KnobGroup from the helices in the assembly - classic socket functionality.
Notes
-----
Socket identifies knobs-into-holes (KIHs) packing motifs in protein structures.
The following resources can provid... | [
"def",
"from_helices",
"(",
"cls",
",",
"assembly",
",",
"cutoff",
"=",
"7.0",
",",
"min_helix_length",
"=",
"8",
")",
":",
"cutoff",
"=",
"float",
"(",
"cutoff",
")",
"helices",
"=",
"Assembly",
"(",
"[",
"x",
"for",
"x",
"in",
"assembly",
".",
"hel... | Generate KnobGroup from the helices in the assembly - classic socket functionality.
Notes
-----
Socket identifies knobs-into-holes (KIHs) packing motifs in protein structures.
The following resources can provide more information:
The socket webserver: http://coiledcoils.chm.bris... | [
"Generate",
"KnobGroup",
"from",
"the",
"helices",
"in",
"the",
"assembly",
"-",
"classic",
"socket",
"functionality",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/add_ons/knobs_into_holes.py#L206-L255 |
43,097 | woolfson-group/isambard | isambard/add_ons/knobs_into_holes.py | KnobGroup.knob_subgroup | def knob_subgroup(self, cutoff=7.0):
""" KnobGroup where all KnobsIntoHoles have max_kh_distance <= cutoff. """
if cutoff > self.cutoff:
raise ValueError("cutoff supplied ({0}) cannot be greater than self.cutoff ({1})".format(cutoff,
... | python | def knob_subgroup(self, cutoff=7.0):
""" KnobGroup where all KnobsIntoHoles have max_kh_distance <= cutoff. """
if cutoff > self.cutoff:
raise ValueError("cutoff supplied ({0}) cannot be greater than self.cutoff ({1})".format(cutoff,
... | [
"def",
"knob_subgroup",
"(",
"self",
",",
"cutoff",
"=",
"7.0",
")",
":",
"if",
"cutoff",
">",
"self",
".",
"cutoff",
":",
"raise",
"ValueError",
"(",
"\"cutoff supplied ({0}) cannot be greater than self.cutoff ({1})\"",
".",
"format",
"(",
"cutoff",
",",
"self",
... | KnobGroup where all KnobsIntoHoles have max_kh_distance <= cutoff. | [
"KnobGroup",
"where",
"all",
"KnobsIntoHoles",
"have",
"max_kh_distance",
"<",
"=",
"cutoff",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/add_ons/knobs_into_holes.py#L257-L263 |
43,098 | woolfson-group/isambard | isambard/add_ons/knobs_into_holes.py | KnobGroup.graph | def graph(self):
""" Returns MultiDiGraph from kihs. Nodes are helices and edges are kihs. """
g = networkx.MultiDiGraph()
edge_list = [(x.knob_helix, x.hole_helix, x.id, {'kih': x}) for x in self.get_monomers()]
g.add_edges_from(edge_list)
return g | python | def graph(self):
""" Returns MultiDiGraph from kihs. Nodes are helices and edges are kihs. """
g = networkx.MultiDiGraph()
edge_list = [(x.knob_helix, x.hole_helix, x.id, {'kih': x}) for x in self.get_monomers()]
g.add_edges_from(edge_list)
return g | [
"def",
"graph",
"(",
"self",
")",
":",
"g",
"=",
"networkx",
".",
"MultiDiGraph",
"(",
")",
"edge_list",
"=",
"[",
"(",
"x",
".",
"knob_helix",
",",
"x",
".",
"hole_helix",
",",
"x",
".",
"id",
",",
"{",
"'kih'",
":",
"x",
"}",
")",
"for",
"x",... | Returns MultiDiGraph from kihs. Nodes are helices and edges are kihs. | [
"Returns",
"MultiDiGraph",
"from",
"kihs",
".",
"Nodes",
"are",
"helices",
"and",
"edges",
"are",
"kihs",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/add_ons/knobs_into_holes.py#L270-L275 |
43,099 | woolfson-group/isambard | isambard/add_ons/knobs_into_holes.py | KnobGroup.filter_graph | def filter_graph(g, cutoff=7.0, min_kihs=2):
""" Get subgraph formed from edges that have max_kh_distance < cutoff.
Parameters
----------
g : MultiDiGraph representing KIHs
g is the output from graph_from_protein
cutoff : float
Socket cutoff in Angstroms.... | python | def filter_graph(g, cutoff=7.0, min_kihs=2):
""" Get subgraph formed from edges that have max_kh_distance < cutoff.
Parameters
----------
g : MultiDiGraph representing KIHs
g is the output from graph_from_protein
cutoff : float
Socket cutoff in Angstroms.... | [
"def",
"filter_graph",
"(",
"g",
",",
"cutoff",
"=",
"7.0",
",",
"min_kihs",
"=",
"2",
")",
":",
"edge_list",
"=",
"[",
"e",
"for",
"e",
"in",
"g",
".",
"edges",
"(",
"keys",
"=",
"True",
",",
"data",
"=",
"True",
")",
"if",
"e",
"[",
"3",
"]... | Get subgraph formed from edges that have max_kh_distance < cutoff.
Parameters
----------
g : MultiDiGraph representing KIHs
g is the output from graph_from_protein
cutoff : float
Socket cutoff in Angstroms.
Default is 7.0.
min_kihs : int
... | [
"Get",
"subgraph",
"formed",
"from",
"edges",
"that",
"have",
"max_kh_distance",
"<",
"cutoff",
"."
] | ebc33b48a28ad217e18f93b910dfba46e6e71e07 | https://github.com/woolfson-group/isambard/blob/ebc33b48a28ad217e18f93b910dfba46e6e71e07/isambard/add_ons/knobs_into_holes.py#L278-L302 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.