Package org.biojava.nbio.structure
Class ResidueRange
java.lang.Object
org.biojava.nbio.structure.ResidueRange
- Direct Known Subclasses:
 ResidueRangeAndLength
A chainName, a start residue, and an end residue. The chainName is matched
 to 
Chain.getName(), so for mmCIF files it indicates the authorId
 rather than the asymId.
 Chain may be null when referencing a single-chainName structure; for multi-chainName
 structures omitting the chainName is an error. Start and/or end may also be null,
 which is interpreted as the first and last residues in the chainName, respectively.- Author:
 - dmyerstu
 - See Also:
 
- 
Field Summary
Fields - 
Constructor Summary
ConstructorsConstructorDescriptionResidueRange(String chainName, String start, String end) ResidueRange(String chainName, ResidueNumber start, ResidueNumber end)  - 
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(ResidueNumber residueNumber, AtomPositionMap map) booleangetEnd()getResidue(int positionInRange, AtomPositionMap map) Returns the ResidueNumber that is at positionpositionInRangein this ResidueRange.getStart()inthashCode()iterator(AtomPositionMap map) Returns a new Iterator over everyResidueNumberin this ResidueRange.static Iterator<ResidueNumber> multiIterator(AtomPositionMap map, List<? extends ResidueRange> rrs) Returns a new Iterator over everyResidueNumberin the list of ResidueRanges.static Iterator<ResidueNumber> multiIterator(AtomPositionMap map, ResidueRange... rrs) Returns a new Iterator over everyResidueNumberin the list of ResidueRanges.static ResidueRangeParse the residue range from a string.static List<ResidueRange> static List<ResidueRange> parseMultiple(List<String> ranges) toString()static StringtoString(List<? extends ResidueRange> ranges) toStrings(List<? extends ResidueRange> ranges)  
- 
Field Details
- 
RANGE_REGEX
 - 
CHAIN_REGEX
 
 - 
 - 
Constructor Details
- 
ResidueRange
 - 
ResidueRange
 
 - 
 - 
Method Details
- 
parse
Parse the residue range from a string. Several formats are accepted:- chainName.start-end
 - chainName.residue
 - chain_start-end (for better filename compatibility)
 
Residues can be positive or negative and may include insertion codes. See
ResidueNumber.fromString(String).Examples:
A:5-100A_5-100A_-5A:-12I-+12IA:^-$
- Parameters:
 s- residue string to parse- Returns:
 - The unique ResidueRange corresponding to 
s 
 - 
parseMultiple
- 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. - See Also:
 
 - 
equals
 - 
getChainName
 - 
getEnd
 - 
getStart
 - 
hashCode
 - 
toString
 - 
getResidue
Returns the ResidueNumber that is at positionpositionInRangein this ResidueRange.- Returns:
 - The ResidueNumber, or false if it does not exist or is not within this ResidueRange
 
 - 
contains
- Returns:
 - True if and only if 
residueNumberis within this ResidueRange 
 - 
iterator
Returns a new Iterator over everyResidueNumberin this ResidueRange. Stores the contents ofmapuntil the iterator is finished, so calling code should set the iterator tonullif it did not finish. - 
multiIterator
Returns a new Iterator over everyResidueNumberin the list of ResidueRanges. Stores the contents ofmapuntil the iterator is finished, so calling code should set the iterator tonullif it did not finish. - 
multiIterator
public static Iterator<ResidueNumber> multiIterator(AtomPositionMap map, List<? extends ResidueRange> rrs) Returns a new Iterator over everyResidueNumberin the list of ResidueRanges. Stores the contents ofmapuntil the iterator is finished, so calling code should set the iterator tonullif it did not finish. - 
parseMultiple
 - 
toStrings
 - 
toString
 
 -