## org.biojava.bio.structure
Interface Chain

All Known Implementing Classes:
  ChainImpl

    public interface Chain

Defines the interface for a Chain.

Since:
  1.4
Version:
  %I% %G%
Author:
  Andreas Prlic

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 X.
`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 ArrayList 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()` return the amino acid sequqence of this chain ( all aminos even if they do not have 3D data ...).
`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 name)` 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.

Method Detail

### clone

    java.lang.Object clone()

  returns an identical copy of this Chain.

  Returns:
    an identical copy of this Chain

### addGroup

    void addGroup(Group group)

  add a group to this chain.

  Parameters:
    `group` - a Group object

### getGroup

    Group getGroup(int position)

  return the amino acid at position X.

  Parameters:
    `position` - an int
  Returns:
    a Group object

### getGroups

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

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

  Parameters:
    `type` - a String
  Returns:
    an ArrayList object

### getGroups

    java.util.List getGroups()

  return all groups of this chain.

  Returns:
    an ArrayList of all Group objects of this chain

### getGroupByPDB

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

  get a group by its PDB residue numbering. if the PDB residue number is not know, throws a StructureException.

  Parameters:
    `pdbresnum` - the PDB residue number of the group
  Returns:
    the matching group
  Throws:
    `StructureException`

### getGroupsByPDB

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

  get all groups that are located between two PDB residue numbers

  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

    int getLength()

  get total length of chain, including HETATMs..

  Returns:
    an int representing the length of the whole chain including HETATMs

### getLengthAminos

    int getLengthAminos()

  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.

  Returns:
    an int representing the length of the AminoAcids in chain, without HETATMs.

### setAnnotation

    void setAnnotation(Annotation anno)

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

  Parameters:
    `anno` - the Annotation to be provided.

### getAnnotation

    Annotation getAnnotation()

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

  Returns:
    the Annotation of this chain

### setName

    void setName(java.lang.String name)

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

  Parameters:
    `name` - a String specifying the name value
  See Also:
    `getName()`

### getName

    java.lang.String getName()

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

  Returns:
    a String representing the name value
  See Also:
    `setName(java.lang.String)`

### toString

    java.lang.String toString()

  string representation.

  Overrides:
    `toString` in class `java.lang.Object`

### getSequence

    java.lang.String getSequence()

  return the amino acid sequqence of this chain ( all aminos even if they do not have 3D data ...).

  Returns:
    the sequence as a string

### setSwissprotId

    void setSwissprotId(java.lang.String sp_id)

  set the Swissprot id of this chains .

  Parameters:
    `sp_id` - a String specifying the swissprot id value
  See Also:
    `getSwissprotId()`

### getSwissprotId

    java.lang.String getSwissprotId()

  get the Swissprot id of this chains .

  Returns:
    a String representing the swissprot id value
  See Also:
    `setSwissprotId(java.lang.String)`