public class AtomPositionMap
extends java.lang.Object
ResidueNumbers to ATOM record positions in a PDB file.
To use:
AtomPositionMap map = new AtomPositionMap(new AtomCache().getAtoms("1w0p"));
ResidueNumber start = new ResidueNumber("A", 100, null);
ResidueNumber end = map.getEnd("A");
int pos = map.getPosition(start);
int length = map.calcLength(start, end);
| Modifier and Type | Class and Description |
|---|---|
static interface |
AtomPositionMap.GroupMatcher |
| Modifier and Type | Field and Description |
|---|---|
static AtomPositionMap.GroupMatcher |
AMINO_ACID_MATCHER |
static java.util.Set<java.lang.String> |
AMINO_ACID_NAMES |
static AtomPositionMap.GroupMatcher |
ANYTHING_MATCHER |
| Constructor and Description |
|---|
AtomPositionMap(Atom[] atoms)
Creates a new AtomPositionMap containing only amino acids C-alpha atoms.
|
AtomPositionMap(Atom[] atoms,
AtomPositionMap.GroupMatcher matcher)
Creates a new AtomPositionMap containing only atoms matched by
matcher. |
| Modifier and Type | Method and Description |
|---|---|
int |
calcLength(int positionA,
int positionB,
char startingChain)
This is not the same as subtracting
getPosition(ResidueNumber) for positionB from getPosition(ResidueNumber) for positionA. |
int |
calcLength(int positionA,
int positionB,
java.lang.String startingChain)
This is not the same as subtracting
getPosition(ResidueNumber) for positionB from getPosition(ResidueNumber) for positionA. |
int |
calcLength(ResidueNumber positionA,
ResidueNumber positionB)
Convenience method for
calcLength(int, int, String). |
int |
calcLengthDirectional(int positionStart,
int positionEnd,
char startingChain)
Calculates the distance between
positionStart and positionEnd. |
int |
calcLengthDirectional(int positionStart,
int positionEnd,
java.lang.String startingChain)
Calculates the distance between
positionStart and positionEnd. |
int |
calcLengthDirectional(ResidueNumber start,
ResidueNumber end)
Calculates the distance between
positionStart and positionEnd. |
ResidueNumber |
getFirst() |
ResidueNumber |
getFirst(java.lang.String chainId) |
ResidueNumber |
getLast() |
ResidueNumber |
getLast(java.lang.String chainId) |
java.util.NavigableMap<ResidueNumber,java.lang.Integer> |
getNavMap() |
java.lang.Integer |
getPosition(ResidueNumber residueNumber) |
public static final java.util.Set<java.lang.String> AMINO_ACID_NAMES
public static final AtomPositionMap.GroupMatcher AMINO_ACID_MATCHER
public static final AtomPositionMap.GroupMatcher ANYTHING_MATCHER
public AtomPositionMap(Atom[] atoms)
atoms - public AtomPositionMap(Atom[] atoms, AtomPositionMap.GroupMatcher matcher)
matcher.atoms - public int calcLength(int positionA,
int positionB,
char startingChain)
getPosition(ResidueNumber) for positionB from getPosition(ResidueNumber) for positionA.
The latter considers only positions of ATOM entries in the PDB file and ignores chains. This method only includes ATOMs from the same chain.positionA - positionB - startingChain - public int calcLength(int positionA,
int positionB,
java.lang.String startingChain)
getPosition(ResidueNumber) for positionB from getPosition(ResidueNumber) for positionA.
The latter considers only positions of ATOM entries in the PDB file and ignores chains. This method only includes ATOMs from the same chain.positionA - positionB - startingChain - public int calcLengthDirectional(ResidueNumber start, ResidueNumber end)
positionStart and positionEnd. Will return a negative value if the start is past the end.start - end - public int calcLengthDirectional(int positionStart,
int positionEnd,
char startingChain)
positionStart and positionEnd. Will return a negative value if the start is past the end.positionStart - positionEnd - startingChain - public int calcLengthDirectional(int positionStart,
int positionEnd,
java.lang.String startingChain)
positionStart and positionEnd. Will return a negative value if the start is past the end.positionStart - positionEnd - startingChain - public int calcLength(ResidueNumber positionA, ResidueNumber positionB)
calcLength(int, int, String).positionA - positionB - calcLength(int, int, char)public java.util.NavigableMap<ResidueNumber,java.lang.Integer> getNavMap()
public java.lang.Integer getPosition(ResidueNumber residueNumber)
residueNumber - residueNumberpublic ResidueNumber getFirst(java.lang.String chainId)
chainId - ResidueNumber of the specified chain (the one highest down in the PDB file)public ResidueNumber getLast(java.lang.String chainId)
chainId - ResidueNumber of the specified chain (the one farthest down in the PDB file)public ResidueNumber getFirst()
chainId - ResidueNumber of any chain (the one farthest down in the PDB file)public ResidueNumber getLast()
chainId - ResidueNumber of any chain (the one farthest down in the PDB file)