meshi.molecularElements
Class Chain

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<Residue>
              extended by meshi.molecularElements.ResidueList
                  extended by meshi.molecularElements.Chain
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<Residue>, java.util.Collection<Residue>, java.util.List<Residue>, java.util.RandomAccess
Direct Known Subclasses:
ImageChain, Pdb2Fasta.MyChain

public class Chain
extends ResidueList

A list of residues of the same chain. Note that some of the residues may be dummy. Specifically, the first residue may be dummy in order to be compatible with the biologists convention that the first residue is 1 (they grew up on FORTRAN). Residue positions in the list are equal to their residue number. Holes are filed by DummyResidue objects

See Also:
Serialized Form

Nested Class Summary
(package private) static class Chain.IsResidue
           
 
Nested classes/interfaces inherited from class meshi.molecularElements.ResidueList
ResidueList.NonDummyFilter
 
Field Summary
static java.lang.String GENERIC_CHAIN_NAME
           
 java.lang.String name
          The first Non Dummy Residue (may but also may not be number 1).
 Protein protein
           
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
Chain(AtomList atomList, ResidueCreator creator, Protein protein)
          Constructs a Chain from a list of atoms.
Chain(AtomList atomList, ResidueCreator creator, java.lang.String chainName, Protein protein)
          Constructs a Chain from a list of atoms.
Chain(AtomList atomList, ResidueCreator creator, java.lang.String chainName, Protein protein, MolecularSystem current, MolecularSystem newms)
           
Chain(Sequence sequence, ResidueCreator creator, Protein protein)
          Constructs a Chain from a sequence (a string of one letter codes).
Chain(Sequence sequence, ResidueCreator creator, java.lang.String chainName, Protein protein)
          Constructs a Chain from a sequence (a string of one letter codes).
Chain(java.lang.String name, Protein protein)
          Empty list.
 
Method Summary
 void assertChain()
          Asserts that this chain is comprised of residues with the same chain string.
 AtomList atoms()
           
private  void createAndAddResidue(ResidueCreator creator, AtomList newAtomList, ResidueMode mode)
           
 ResidueList filter(Filter residueFilter)
          Extracts the residues accepted by the filter.
 Residue firstNonDummyResidue()
           
private static AtomList getCaAtomList(char c, Coordinates coordinates)
           
 ResidueList missingResidues()
           
 java.lang.String name()
           
 AtomList nowhereAtoms()
           
 int numberOfNonDummyResidues()
           
 Residue residue(ResidueIdentifier residueID)
          Fetches a residue by its residue identifier.
 Residue residueAt(int index)
          Fetch a residue by its position in the list.
 ResidueSequence sequence()
           
 java.lang.String toString()
           
 
Methods inherited from class meshi.molecularElements.ResidueList
print, sort
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Field Detail

name

public final java.lang.String name
The first Non Dummy Residue (may but also may not be number 1).


GENERIC_CHAIN_NAME

public static final java.lang.String GENERIC_CHAIN_NAME
See Also:
Constant Field Values

protein

public final Protein protein
Constructor Detail

Chain

public Chain(java.lang.String name,
             Protein protein)
Empty list.


Chain

public Chain(Sequence sequence,
             ResidueCreator creator,
             Protein protein)
Constructs a Chain from a sequence (a string of one letter codes). The residueCreator is responsible for the interpretation of the letters to actual residues and thus determines the molecular model.


Chain

public Chain(Sequence sequence,
             ResidueCreator creator,
             java.lang.String chainName,
             Protein protein)
Constructs a Chain from a sequence (a string of one letter codes). The residueCreator is responsible for the interpretation of the letters to actual residues and thus determines the molecular model.


Chain

public Chain(AtomList atomList,
             ResidueCreator creator,
             Protein protein)
Constructs a Chain from a list of atoms. The residueCreator allows the use of information that is not stored in the atoms themselves. Note that the chain is going to havewill get a genergic name.


Chain

public Chain(AtomList atomList,
             ResidueCreator creator,
             java.lang.String chainName,
             Protein protein)
Constructs a Chain from a list of atoms. The residueCreator allows the use of information that is not stored in the atoms themselves.


Chain

public Chain(AtomList atomList,
             ResidueCreator creator,
             java.lang.String chainName,
             Protein protein,
             MolecularSystem current,
             MolecularSystem newms)
Method Detail

name

public final java.lang.String name()

getCaAtomList

private static AtomList getCaAtomList(char c,
                                      Coordinates coordinates)

createAndAddResidue

private void createAndAddResidue(ResidueCreator creator,
                                 AtomList newAtomList,
                                 ResidueMode mode)

residueAt

public Residue residueAt(int index)
Fetch a residue by its position in the list.


residue

public Residue residue(ResidueIdentifier residueID)
Fetches a residue by its residue identifier.

Overrides:
residue in class ResidueList

filter

public ResidueList filter(Filter residueFilter)
Extracts the residues accepted by the filter.

Overrides:
filter in class ResidueList

numberOfNonDummyResidues

public int numberOfNonDummyResidues()

toString

public java.lang.String toString()
Overrides:
toString in class ResidueList

sequence

public ResidueSequence sequence()

atoms

public AtomList atoms()
Overrides:
atoms in class ResidueList

assertChain

public void assertChain()
Asserts that this chain is comprised of residues with the same chain string.

Throws:
MeshiException - if the assertion fails.

missingResidues

public ResidueList missingResidues()

nowhereAtoms

public AtomList nowhereAtoms()

firstNonDummyResidue

public Residue firstNonDummyResidue()