public class ResidueRange
extends java.lang.Object
end - start
.ResidueNumber
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
RANGE_REGEX |
Constructor and Description |
---|
ResidueRange(char chain,
ResidueNumber start,
ResidueNumber end,
java.lang.Integer length) |
ResidueRange(java.lang.String chain,
ResidueNumber start,
ResidueNumber end,
java.lang.Integer length) |
Modifier and Type | Method and Description |
---|---|
static int |
calcLength(java.util.List<ResidueRange> rrs)
Calculates the combined number of residues of the ResidueRanges in
rrs ,
given that each ResidueRange has a length calculated. |
boolean |
contains(ResidueNumber residueNumber,
AtomPositionMap map) |
boolean |
equals(java.lang.Object obj) |
char |
getChain()
Deprecated.
Use
getChainId() instead, which does not require that chain Ids have a length of 1 |
java.lang.String |
getChainId() |
ResidueNumber |
getEnd() |
java.lang.Integer |
getLength() |
ResidueNumber |
getResidue(int positionInRange,
AtomPositionMap map)
Returns the ResidueNumber that is at position
positionInRange in this ResidueRange. |
ResidueNumber |
getStart() |
int |
hashCode() |
java.util.Iterator<ResidueNumber> |
iterator(AtomPositionMap map)
Returns a new Iterator over every
ResidueNumber in this ResidueRange. |
static boolean |
looksLikeRange(java.lang.String s)
Determines whether a String is of a recognizable range format
|
static java.util.regex.Matcher |
match(java.lang.String s)
Matches the string with a regex pattern that matches all recognizable range formats.
|
static java.util.Iterator<ResidueNumber> |
multiIterator(AtomPositionMap map,
java.util.List<ResidueRange> rrs)
Returns a new Iterator over every
ResidueNumber in the list of ResidueRanges. |
static java.util.Iterator<ResidueNumber> |
multiIterator(AtomPositionMap map,
ResidueRange... rrs)
Returns a new Iterator over every
ResidueNumber in the list of ResidueRanges. |
static ResidueRange |
parse(java.lang.String s) |
static ResidueRange |
parse(java.lang.String s,
AtomPositionMap map) |
static java.util.List<ResidueRange> |
parseMultiple(java.util.List<java.lang.String> ranges) |
static java.util.List<ResidueRange> |
parseMultiple(java.util.List<java.lang.String> ranges,
AtomPositionMap map) |
static java.util.List<ResidueRange> |
parseMultiple(java.lang.String s) |
static java.util.List<ResidueRange> |
parseMultiple(java.lang.String s,
AtomPositionMap map) |
java.lang.String |
toString() |
public static final java.lang.String RANGE_REGEX
public ResidueRange(char chain, ResidueNumber start, ResidueNumber end, java.lang.Integer length)
public ResidueRange(java.lang.String chain, ResidueNumber start, ResidueNumber end, java.lang.Integer length)
public static int calcLength(java.util.List<ResidueRange> rrs)
rrs
,
given that each ResidueRange has a length calculated. The value, if calculated,
will include any alignment gaps.rrs
- A list of ResidueRangesjava.lang.IllegalArgumentException
- If the length
of one or more ResidueRange is nullgetLength()
public static ResidueRange parse(java.lang.String s)
s
- A string of the form chain_start-end or chain.start-end. For example: A.5-100
or A_5-100
.s
public static ResidueRange parse(java.lang.String s, AtomPositionMap map)
s
- A string of the form chain_start-end. For example: A.5-100
.s
.public static java.util.List<ResidueRange> parseMultiple(java.lang.String s)
s
- A string of the form chain_start-end,chain_start-end, ... For example:
A.5-100,R_110-190,Z_200-250
.s
.public static java.util.List<ResidueRange> parseMultiple(java.lang.String s, AtomPositionMap map)
s
- A string of the form chain_start-end,chain_start-end, ... For example:
A.5-100,R_110-190,Z_200-250
.s
.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
@Deprecated public char getChain()
getChainId()
instead, which does not require that chain Ids have a length of 1java.lang.IllegalArgumentException
- If the chain Id contains more than 1 characterpublic java.lang.String getChainId()
public ResidueNumber getEnd()
public java.lang.Integer getLength()
public ResidueNumber getStart()
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public boolean contains(ResidueNumber residueNumber, AtomPositionMap map)
residueNumber
is within this ResidueRangepublic ResidueNumber getResidue(int positionInRange, AtomPositionMap map)
positionInRange
in this ResidueRange.public java.util.Iterator<ResidueNumber> iterator(AtomPositionMap map)
ResidueNumber
in this ResidueRange.
Stores the contents of map
until the iterator is finished, so calling code should set the iterator to null
if it did not finish.public static java.util.Iterator<ResidueNumber> multiIterator(AtomPositionMap map, ResidueRange... rrs)
ResidueNumber
in the list of ResidueRanges.
Stores the contents of map
until the iterator is finished, so calling code should set the iterator to null
if it did not finish.public static java.util.Iterator<ResidueNumber> multiIterator(AtomPositionMap map, java.util.List<ResidueRange> rrs)
ResidueNumber
in the list of ResidueRanges.
Stores the contents of map
until the iterator is finished, so calling code should set the iterator to null
if it did not finish.public static java.util.List<ResidueRange> parseMultiple(java.util.List<java.lang.String> ranges)
public static java.util.List<ResidueRange> parseMultiple(java.util.List<java.lang.String> ranges, AtomPositionMap map)
public static java.util.regex.Matcher match(java.lang.String s)
s
- A string to match againsts
; contains 1 or 3 groups: matcher.group(1)
is the chain Id, and optionally matcher.group(2)
and matcher.group(3)
are the start and end residues, respectively.public static boolean looksLikeRange(java.lang.String s)