public class StructureTools
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String[] |
backboneAtomNames
The names of the Atoms that form the backbone.
|
static java.lang.String |
caAtomName
The Atom name of C-alpha atoms.
|
static java.lang.String |
cbAtomName |
static java.util.logging.Logger |
logger |
static java.lang.String |
nAtomName |
static java.lang.String |
oAtomName |
static java.util.regex.Pattern |
pdbNumRangeRegex
Pattern to describe subranges.
|
static java.lang.Character |
UNKNOWN_GROUP_LABEL |
Constructor and Description |
---|
StructureTools() |
Modifier and Type | Method and Description |
---|---|
static Atom[] |
cloneCAArray(Atom[] ca)
Provides an equivalent copy of Atoms in a new array.
|
static Group[] |
cloneGroups(Atom[] ca)
Clone a set of CA Atoms, but returns the parent groups
|
static java.lang.Character |
convert_3code_1code(java.lang.String code3)
convert three character amino acid codes into single character
e.g.
|
static java.lang.String |
convertAtomsToSeq(Atom[] atoms) |
static Atom[] |
duplicateCA2(Atom[] ca2)
Utility method for working with circular permutations.
|
static java.util.List<Bond> |
findBonds(Group group,
java.util.List<Group> groups) |
static java.lang.Character |
get1LetterCode(java.lang.String groupCode3)
convert a three letter code into single character.
|
static Atom[] |
getAtomArray(Chain c,
java.lang.String[] atomNames)
Returns an array of the requested Atoms from the Structure object.
|
static Atom[] |
getAtomArray(Structure s,
java.lang.String[] atomNames)
Returns an array of the requested Atoms from the Structure object.
|
static Atom[] |
getAtomArrayAllModels(Structure s,
java.lang.String[] atomNames)
Returns an array of the requested Atoms from the Structure object.
|
static Atom[] |
getAtomCAArray(Chain c)
Returns an Atom array of the CA atoms.
|
static Atom[] |
getAtomCAArray(Structure s)
Returns an Atom array of the CA atoms.
|
static Atom[] |
getBackboneAtomArray(Structure s)
Returns an Atom array of the MainChain atoms.
|
static Group |
getGroupByPDBResidueNumber(Structure struc,
ResidueNumber pdbResNum)
Get a group represented by a ResidueNumber.
|
static java.util.List<Group> |
getGroupsWithinShell(Structure structure,
Group group,
double distance,
boolean includeWater) |
static int |
getNrAtoms(Structure s)
Count how many number of Atoms are contained within a Structure object.
|
static int |
getNrGroups(Structure s)
Count how many groups are contained within a structure object.
|
static ResidueNumber |
getPDBResidueNumber(Group g)
Deprecated.
replaced by Group.getResidueNumber()
|
static Structure |
getReducedStructure(Structure s,
int chainNr)
Reduce a structure to provide a smaller representation.
|
static Structure |
getReducedStructure(Structure s,
java.lang.String chainId)
Reduce a structure to provide a smaller representation .
|
static Structure |
getSubRanges(Structure s,
java.lang.String ranges)
In addition to the functionality provided by getReducedStructure also provides a way to specify sub-regions of a structure with the following
specification:
ranges can be surrounded by ( and ).
|
static boolean |
isNucleotide(java.lang.String groupCode3) |
public static final java.lang.String caAtomName
public static final java.lang.String nAtomName
public static final java.lang.String oAtomName
public static final java.lang.String cbAtomName
public static final java.lang.String[] backboneAtomNames
public static final java.lang.Character UNKNOWN_GROUP_LABEL
public static java.util.logging.Logger logger
public static final java.util.regex.Pattern pdbNumRangeRegex
getSubRanges(Structure, String)
public static final int getNrAtoms(Structure s)
s
- the structure objectpublic static final int getNrGroups(Structure s)
s
- the structure objectpublic static final Atom[] getAtomArray(Structure s, java.lang.String[] atomNames)
AminoAcid
or HetatomImpl
group.
For structures with more than one model, only model 0 will be used.s
- the structure to get the atoms fromatomNames
- contains the atom names to be used.public static final Atom[] getAtomArrayAllModels(Structure s, java.lang.String[] atomNames)
getAtomArray(Structure, String[])
this method iterates over all chains.
Iterates over all chains and groups
and checks if the requested atoms are in this group, no matter if this is a AminoAcid
or HetatomImpl
group.
For structures with more than one model, only model 0 will be used.s
- the structure to get the atoms fromatomNames
- contains the atom names to be used.public static final Atom[] getAtomArray(Chain c, java.lang.String[] atomNames)
c
- the Chain to get the atoms fromatomNames
- contains the atom names to be used.public static final Atom[] getAtomCAArray(Chain c)
c
- the structure objectpublic static final Atom[] cloneCAArray(Atom[] ca) throws StructureException
ca
- array of CA atomsStructureException
public static Group[] cloneGroups(Atom[] ca)
ca
- Atom arraypublic static Atom[] duplicateCA2(Atom[] ca2) throws StructureException
ca2
- atom arrayStructureException
public static Atom[] getAtomCAArray(Structure s)
s
- the structure objectpublic static Atom[] getBackboneAtomArray(Structure s)
s
- the structure objectpublic static final java.lang.Character convert_3code_1code(java.lang.String code3) throws UnknownPdbAminoAcidException
code3
- a three character amino acid representation StringIllegalSymbolException
UnknownPdbAminoAcidException
public static final java.lang.Character get1LetterCode(java.lang.String groupCode3)
groupCode3
- three letter representationpublic static final boolean isNucleotide(java.lang.String groupCode3)
public static final Structure getReducedStructure(Structure s, java.lang.String chainId) throws StructureException
s
- chainId
- StructureException
public static final Structure getReducedStructure(Structure s, int chainNr) throws StructureException
s
- chainNr
- can be -1 to request all chains of model 0, otherwise will only add chain at this positionStructureException
public static final Structure getSubRanges(Structure s, java.lang.String ranges) throws StructureException
s
- The full structureranges
- A comma-seperated list of ranges, optionally surrounded by parenthesesStructureException
public static final java.lang.String convertAtomsToSeq(Atom[] atoms)
public static final ResidueNumber getPDBResidueNumber(Group g)
g
- Group objectpublic static final Group getGroupByPDBResidueNumber(Structure struc, ResidueNumber pdbResNum) throws StructureException
struc
- a Structure
pdbResNum
- a ResidueNumber
StructureException
- if the group cannot be found.public static java.util.List<Group> getGroupsWithinShell(Structure structure, Group group, double distance, boolean includeWater)