meld.parse

Functions to read in sequences, secondary structures, and RDCs.

Functions

get_rdc_restraints(system, patcher, scaler, …)

Reads restraints from file and returns as RdcRestraint object.

get_secondary_structure_restraints(system, …)

Get a list of secondary structure restraints.

get_sequence_from_AA1(filename, content, …)

Get the sequence from a list of 1-letter amino acid codes.

get_sequence_from_AA3(filename, content, …)

Get the sequence from a list of 3-letter amino acid codes.

Classes

SecondaryRun(start, end)

class meld.parse.SecondaryRun(start, end)
count(value) → integer -- return number of occurrences of value
end

Alias for field number 1

index(value[, start[, stop]]) → integer -- return first index of value.

Raises ValueError if the value is not present.

start

Alias for field number 0

meld.parse.get_rdc_restraints(system: meld.system.system.System, patcher: meld.system.patchers.RdcAlignmentPatcher, scaler: meld.system.restraints.RestraintScaler, ramp: Optional[meld.system.restraints.TimeRamp] = None, quadratic_cut: float = 99999.0, scale_factor: float = 10000.0, filename: Optional[str] = None, content: Optional[str] = None, file: Optional[TextIO] = None) → List[meld.system.restraints.RdcRestraint][source]

Reads restraints from file and returns as RdcRestraint object.

Parameters
  • system (meld.system.System) – The system object for the restraints to be added to.

  • patcher (meld.system.patchers.RdcAlignmentPatcher) – The patcher that was used to add alignment tensor dummy atoms

  • scaler (meld.system.restraints.RestraintScaler) – Object to scale the force constant.

  • ramp (meld.system.restraints.TimeRamp) – Ramp, default is ConstantRamp()

  • quadratic_cut (float) – Restraints become linear beyond this deviation s^-1

  • scale_factor (float) – Scale factor for kappa and alignment tensor

  • filename (string) – Filename to open

  • content (string) – Contents to process

  • file (a file_like object) – Object to read from

Returns

restraints – Restraints from file

Return type

RdcREstraint object

Notes

The value of kappa will be scaled down by scale_factor. This will result in the alignment tensor being scaled up by scale_factor. Ideally, the largest values of the scaled alignment tensor should be approximately 1. As typical values of the alignment are on the order of 1e-4, the default value of 1e4 is a reasonable guess. The value of scale_factor must be the same for all experiments that share the same alignment.

meld.parse.get_secondary_structure_restraints(system: meld.system.system.System, scaler: meld.system.restraints.RestraintScaler, ramp: Optional[meld.system.restraints.TimeRamp] = None, torsion_force_constant: float = 2.48, distance_force_constant: float = 2.48, quadratic_cut: float = 2.0, first_residue: int = 1, min_secondary_match: int = 4, filename: Optional[str] = None, content: Optional[str] = None, file: Optional[TextIO] = None) → List[meld.system.restraints.RestraintGroup][source]

Get a list of secondary structure restraints.

Parameters
  • system (a System object) – The system

  • scaler (a force scaler) – The force

  • ramp – The ramp, default is ConstantRamp

  • torsion_force_constant (float) – Force constant for torsions, in kJ/mol/(10 degree)^2

  • distance_force_constant (float) – Force constant for distances, in kJ/mol/Angstrom^2

  • quadratic_cut (float) – Switch from quadratic to linear beyond this distance, Angstrom

  • min_secondary_match (int) – Minimum number of elements to match in secondary structure,

  • first_residue (int) – Residue at which to delineate peptide vs. protein,

  • filename (string) – Filename to open

  • content (string) – Contents to process

  • file (file-like object) – Object to read from

Returns

groups – A list of RestraintGroups

Return type

list

Notes

Specify exactly one of filename, contents, file.

meld.parse.get_sequence_from_AA1(filename: Optional[str] = None, content: Optional[str] = None, file: Optional[TextIO] = None, capped: bool = False, nter: Optional[str] = None, cter: Optional[str] = None) → NewType.<locals>.new_type[source]

Get the sequence from a list of 1-letter amino acid codes.

Parameters
  • filename (string) – Filename to open

  • content (string) – Contents

  • file (file-like) – Object to read from

  • capped – Will know that there are caps. Specify which in nter and cter

  • nter

    Specify capping residue at the N terminus if not specified

    in sequence

  • cter

    Specify capping residue at the C terminus if not specified

    in sequence

Returns

Used to initialize a system

Return type

string

Raises

RuntimeError – Error raised on bad input

Notes

Specify exactly one of filename, contents, file

Will have to set options in setup script to skip cmap assignment

meld.parse.get_sequence_from_AA3(filename: Optional[str] = None, content: Optional[str] = None, file: Optional[TextIO] = None, capped: bool = False, nter: Optional[str] = None, cter: Optional[str] = None) → NewType.<locals>.new_type[source]

Get the sequence from a list of 3-letter amino acid codes.

Parameters
  • filename (string) – Filename to open

  • content (string) – Contains contents

  • file (file-like object) – Object to read from

  • capped – Will know that there are caps. Specify which in nter and cter

  • nter

    Specify capping residue at the N terminus if not specified

    in sequence

  • cter

    Specify capping residue at the C terminus if not specified

    in sequence

Returns

Used to initialize a system

Return type

string

Raises

RuntimeError – Error on based input

Notes

Specify exactly one of filename, contents, file