## org.biojava.bio.structure
Class ChainImpl

    java.lang.Object
      org.biojava.bio.structure.ChainImpl

All Implemented Interfaces:
  Chain

    public class ChainImpl

extends java.lang.Object
implements Chain

A Chain in a PDB file. It contains several groups which can be of type "amino", "hetatm", "nucleotide".

Since:
  1.4
Author:
  Andreas Prlic

Field Summary
`static java.lang.String` `DEFAULT_CHAIN_ID`

Constructor Summary
`ChainImpl()` Constructs a ChainImpl object.

Method Summary
`void` `addGroup(Group group)` add a group to this chain.
`java.lang.Object` `clone()` returns an identical copy of this Chain .
`Annotation` `getAnnotation()` get/set the Annotation of a Chain.
`Group` `getGroup(int position)` return the amino acid at position .
`Group` `getGroupByPDB(java.lang.String pdbresnum)` get a group by its PDB residue numbering.
`java.util.List` `getGroups()` return all groups of this chain .
`java.util.List` `getGroups(java.lang.String type)` return an array of all groups of a special type (e.g.
`Group[]` `getGroupsByPDB(java.lang.String pdbresnumStart, java.lang.String pdbresnumEnd)` get all groups that are located between two PDB residue numbers
`int` `getLength()` get total length of chain, including HETATMs..
`int` `getLengthAminos()` returns the length of the AminoAcids in chain, without HETATMs.
`java.lang.String` `getName()` get and set the name of this chain (Chain id in PDB file ).
`java.lang.String` `getSequence()` get amino acid sequence.
`java.lang.String` `getSwissprotId()` get the Swissprot id of this chains .
`void` `setAnnotation(Annotation anno)` get/set the Annotation of a Chain.
`void` `setName(java.lang.String nam)` get and set the name of this chain (Chain id in PDB file ).
`void` `setSwissprotId(java.lang.String sp_id)` set the Swissprot id of this chains .
`java.lang.String` `toString()` string representation.

Methods inherited from class java.lang.Object
`equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### DEFAULT_CHAIN_ID

    public static java.lang.String DEFAULT_CHAIN_ID

Constructor Detail

### ChainImpl

    public ChainImpl()

  Constructs a ChainImpl object.

Method Detail

### clone

    public java.lang.Object clone()

  returns an identical copy of this Chain .

  Specified by:
    `clone` in interface `Chain`
  Overrides:
    `clone` in class `java.lang.Object`
  Returns:
    an identical copy of this Chain

### setAnnotation

    public void setAnnotation(Annotation anno)

  Description copied from interface: `Chain`
  get/set the Annotation of a Chain. allows to annotate a protein chain, e.g. molecule description "AZURIN" for pdb 1a4a.A

  Specified by:
    `setAnnotation` in interface `Chain`
  Parameters:
    `anno` - the Annotation to be provided.

### getAnnotation

    public Annotation getAnnotation()

  Description copied from interface: `Chain`
  get/set the Annotation of a Chain. allows to annotate a protein chain, e.g. molecule description "AZURIN" for pdb 1a4a.A

  Specified by:
    `getAnnotation` in interface `Chain`
  Returns:
    the Annotation of this chain

### setSwissprotId

    public void setSwissprotId(java.lang.String sp_id)

  set the Swissprot id of this chains .

  Specified by:
    `setSwissprotId` in interface `Chain`
  Parameters:
    `sp_id` - a String specifying the swissprot id value
  See Also:
    `getSwissprotId()`

### getSwissprotId

    public java.lang.String getSwissprotId()

  get the Swissprot id of this chains .

  Specified by:
    `getSwissprotId` in interface `Chain`
  Returns:
    a String representing the swissprot id value
  See Also:
    `setSwissprotId(java.lang.String)`

### addGroup

    public void addGroup(Group group)

  Description copied from interface: `Chain`
  add a group to this chain.

  Specified by:
    `addGroup` in interface `Chain`
  Parameters:
    `group` - a Group object

### getGroup

    public Group getGroup(int position)

  return the amino acid at position .

  Specified by:
    `getGroup` in interface `Chain`
  Parameters:
    `position` - an int
  Returns:
    a Group object

### getGroups

    public java.util.List getGroups(java.lang.String type)

  return an array of all groups of a special type (e.g. amino, hetatm, nucleotide).

  Specified by:
    `getGroups` in interface `Chain`
  Parameters:
    `type` - a String
  Returns:
    an List object containing the groups of type...

### getGroups

    public java.util.List getGroups()

  return all groups of this chain .

  Specified by:
    `getGroups` in interface `Chain`
  Returns:
    an ArrayList object representing the Groups of this Chain.

### getGroupByPDB

    public Group getGroupByPDB(java.lang.String pdbresnum)
                        throws StructureException

  Description copied from interface: `Chain`
  get a group by its PDB residue numbering. if the PDB residue number is not know, throws a StructureException.

  Specified by:
    `getGroupByPDB` in interface `Chain`
  Parameters:
    `pdbresnum` - the PDB residue number of the group
  Returns:
    the matching group
  Throws:
    `StructureException`

### getGroupsByPDB

    public Group[] getGroupsByPDB(java.lang.String pdbresnumStart,
                                  java.lang.String pdbresnumEnd)
                           throws StructureException

  Description copied from interface: `Chain`
  get all groups that are located between two PDB residue numbers

  Specified by:
    `getGroupsByPDB` in interface `Chain`
  Parameters:
    `pdbresnumStart` - PDB residue number of start
    `pdbresnumEnd` - PDB residue number of end
  Returns:
    Groups in between. or throws a StructureException if either start or end can not be found,
  Throws:
    `StructureException`

### getLength

    public int getLength()

  Description copied from interface: `Chain`
  get total length of chain, including HETATMs..

  Specified by:
    `getLength` in interface `Chain`
  Returns:
    an int representing the length of the whole chain including HETATMs

### getLengthAminos

    public int getLengthAminos()

  Description copied from interface: `Chain`
  returns the length of the AminoAcids in chain, without HETATMs. note: not all amino acids need to have 3D coords, in fact in could be that none has! so length always corresponds to Sequence ( = uniprot,swissprot) length.

  Specified by:
    `getLengthAminos` in interface `Chain`
  Returns:
    an int representing the length of the AminoAcids in chain, without HETATMs.

### setName

    public void setName(java.lang.String nam)

  get and set the name of this chain (Chain id in PDB file ).

  Specified by:
    `setName` in interface `Chain`
  Parameters:
    `nam` - a String specifying the name value
  See Also:
    `getName()`

### getName

    public java.lang.String getName()

  get and set the name of this chain (Chain id in PDB file ).

  Specified by:
    `getName` in interface `Chain`
  Returns:
    a String representing the name value
  See Also:
    `setName(java.lang.String)`

### toString

    public java.lang.String toString()

  string representation.

  Specified by:
    `toString` in interface `Chain`
  Overrides:
    `toString` in class `java.lang.Object`

### getSequence

    public java.lang.String getSequence()

  get amino acid sequence.

  Specified by:
    `getSequence` in interface `Chain`
  Returns:
    a String representing the sequence.