crops.core.ops module¶
Core operations (renumber, crop, split) are defined here.
-
crop_pdb(instr, inseq, original_id=True)[source]¶ Return modified
gemmi.Structurewithout specified elements.Parameters: - instr (
gemmi.Structure) – Gemmi structure. - inseq (
crops.elements.sequences.oligoseq) – Input previously-cropped-sequence. - original_id (bool, optional) – If True, it will keep residue ids alligned to original sequence, defaults to True.
Returns: Cropped structure.
Return type: gemmi.Structure- instr (
-
crop_seq(inseq, segments, cut_type, terms=False)[source]¶ Return modified
crops.elements.sequences.sequencewithout specified elements.Parameters: - inseq (
crops.elements.sequences.sequence) – Input sequence. - segments (
crops.elements.intervals.intinterval) – Input preservation interval. - cut_type (str) – Additional header information.
- terms (bool, optional) – If True, only terminal ends are removed, defaults to False.
Raises: ValueError – If intervals given lie out of the sequence.
Returns: Cropped sequence.
Return type: - inseq (
-
get_sequence_alignment(sequence_1, sequence_2, mode='global', open_gap_score=-11, extend_gap_score=-2)[source]¶ Perform a sequence alignment using Needleman-Wunsch algorithm.
Parameters: Return alignment_dict: Dictionary with the residue mapping between both input sequences.
Rtype alignment_dict: dict [int, int]
-
renumber_pdb(inseq, instr, seqback=False, remove_ligands=False)[source]¶ Return modified
gemmi.Structurewith new residue numbers.Parameters: - inseq (
crops.elements.sequences.oligoseq) – Input sequence. - instr (
gemmi.Structure) – Gemmi structure. - seqback (bool, optional) – If True, it additionally returns the
crops.elements.sequences.oligoseqwith the gaps found in the structure, defaults to False. - remove_ligands (bool, optional) – If True, use
gemmi.Structure.remove_ligands_and_waters()andgemmi.Structure.remove_empty_chains()prior to operation, defaults to False.
Return instr: Renumbered structure.
Rtype instr: gemmi.StructureReturn inseq: Sequence with extra information about gaps, only if seqback is True.
Rtype inseq: - inseq (
-
renumber_pdb_needleman(inseq, instr, seqback=False, remove_ligands=False)[source]¶ Return modified
gemmi.Structurewith new residue numbers. It uses Needleman-Wunsch algorithm to perform the sequence alignment.Parameters: - inseq (
crops.elements.sequences.oligoseq) – Input sequence. - instr (
gemmi.Structure) – Gemmi structure. - seqback (bool, optional) – If True, it additionally returns the
crops.elements.sequences.oligoseqwith the gaps found in the structure, defaults to False. - remove_ligands (bool, optional) – If True, use
gemmi.Structure.remove_ligands_and_waters()andgemmi.Structure.remove_empty_chains()prior to operation, defaults to False.
Return instr: Renumbered structure.
Rtype instr: gemmi.StructureReturn inseq: Sequence with extra information about gaps, only if seqback is True.
Rtype inseq: - inseq (