Class ResidueRangeAndLength

  • Direct Known Subclasses:
    AugmentedResidueRange

    public class ResidueRangeAndLength
    extends ResidueRange
    A chain, a start residue, and an end residue. Also stores a length. Because of insertion codes, this length is not necessarily end − start.
    • Method Detail

      • calcLength

        public static int calcLength​(List<ResidueRangeAndLength> rrs)
        Calculates the combined number of residues of the ResidueRanges in rrs. Assumes no overlap. If two or more ranges cover the same residues, will over-count the union of the residues.
        Parameters:
        rrs - A list of ResidueRanges
        Returns:
        The combined length
        Throws:
        IllegalArgumentException - If the length of one or more ResidueRange is null
        See Also:
        getLength()
      • parse

        public static ResidueRangeAndLength parse​(String s,
                                                  AtomPositionMap map)
        Parses a residue range. The AtomPositionMap is used to calculate the length and fill in missing information, such as for whole chains ('A:'). Supports the special chain name '_' for single-chain structures. If residues are specified outside of the range given in the map, attempts to decrease the input range to valid values. In extreme cases where this process fails fails to find any valid indices, returns null. For a function which more conservatively represents the input range, without chain inference and error fixes, use ResidueRange.parse(String).
        Parameters:
        s - A string of the form chain_start-end. For example: A.5-100.
        Returns:
        The unique ResidueRange corresponding to s.
      • parseMultiple

        public static List<ResidueRangeAndLength> parseMultiple​(String s,
                                                                AtomPositionMap map)
        Parameters:
        s - A string of the form chain_start-end,chain_start-end, ... For example: A.5-100,R_110-190,Z_200-250.
        Returns:
        The unique ResidueRange corresponding to s.
      • getLength

        public int getLength()
        Returns:
        The number of residues in this ResidueRange