belka.mol
Class Assembly

java.lang.Object
  extended by belka.mol.Assembly
All Implemented Interfaces:
Serializable

public abstract class Assembly
extends Object
implements Serializable

Abstract class describing behavior of an assembly. Assembly is the group of atoms, for example residue or nucleotide.

Author:
Alexej Abyzov
See Also:
Serialized Form

Constructor Summary
Assembly()
           
 
Method Summary
abstract  boolean addAtom(Atom atom)
          Adds atom to the end of atom list of the current assembly.
abstract  boolean addBond(Bond bond)
          Adds peptide/phosphodiester bond.
abstract  Atom atomList()
          Returns list of atoms.
abstract  Bond[] bondArray()
          Returns array of peptide/phosphodiester bonds.
abstract  Chain chain()
          Returns a chain the assembly belongs to.
abstract  int countAtoms()
          Returns number of atoms in the assembly.
abstract  int countBonds()
          Returns number of peptide/phosphodiester bonds for the assembly.
static Assembly create(Compound comp)
          Static method to create a new assembly.
static Assembly createGap()
          Static method to create a new assembly representing gap.
abstract  void disassemble()
          Disassembles assembly into null pointers to help garbage collector to free memory.
abstract  Assembly extractAfter()
          Extracts the assembly following the current one from the list.
abstract  Assembly extractBefore()
          Extracts the assembly preceeding the current one from the list.
static int getAlignedAttribute()
          Returns flag attribute of aligned assemblies.
abstract  Atom getCAAtom()
          Returns C-alpha atom or null if it is not found.
abstract  Compound getCompound()
          Returns assembly's compound.
static int getGroupAttribute(int group_id)
          Returns flag attribute for assemblies in particular group.
abstract  int getGroupId()
          Returns group id or 0 if assembly is not assigned to any group.
static int getHelix3Attribute()
          Returns flag attribute for residues in 3,10-helices.
static int getHelix4Attribute()
          Returns flag attribute for residues in 4-helices.
static int getHelix5Attribute()
          Returns flag attribute for residues in 5-helices.
static int getHelixAttribute()
          Returns flag attribute for residues in helices.
abstract  char getICode()
          Returns assembly's icode.
abstract  char getLetterName()
          Returns assembly's one letter name.
abstract  Atom getMainAtom()
          Returns the main atom (CA for proteins and sugar P for nucleotides) in assembly or null if such atom can't be found.
abstract  String getName()
          Returns assembly's name.
static int getRegularAttribute()
          Returns flag attribute for residues in any secondary structure elements.
abstract  int getSerialNum()
          Returns assembly's serial number.
static int getSheetAttribute()
          Returns flag attribute for residues in sheets.
static int getTurnAttribute()
          Returns flag attribute for residues in turn.
abstract  boolean hasAttribute(int att)
          Returns true if the provide attribute matches to the attributes of the assembly.
abstract  boolean insertAfter(Assembly newAssembly)
          Inserts an assembly after the current one.
abstract  boolean insertBefore(Assembly newAssembly)
          Inserts an assembly before the current one.
abstract  boolean isAligned()
          Returns true if assemblies is aligned, false otherwise.
abstract  boolean isConnectedTo(Assembly s)
          Returns true if assemblies are connected by peptide/phosphodiester bonds, false otherwise.
abstract  boolean isGap()
          Returns true if the assembly represents gap.
abstract  Assembly next()
          Returns next assembly in list.
abstract  Assembly prev()
          Returns previous assembly in list.
abstract  void selectAllAtoms(boolean val)
          Select or deselect all atoms in a assembly.
abstract  void setAligned(boolean val)
          Sets assembly's alignment attribute.
abstract  boolean setChain(Chain chain)
          Sets a chain the assembly belongs to.
abstract  boolean setGroupId(int groupId)
          Sets group id for the assembly.
abstract  void setICode(char icode)
          Sets assembly's icode.
abstract  void setSerialNum(int serial)
          Sets assembly's serial number.
abstract  String toString()
          Returns string representation of the assembly.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Assembly

public Assembly()
Method Detail

create

public static Assembly create(Compound comp)
Static method to create a new assembly.

Parameters:
comp - assembly's chemical compound.
Returns:
new created assembly.

createGap

public static Assembly createGap()
Static method to create a new assembly representing gap.

Returns:
new created assembly repesenting gap.

disassemble

public abstract void disassemble()
Disassembles assembly into null pointers to help garbage collector to free memory.


isGap

public abstract boolean isGap()
Returns true if the assembly represents gap. Return false if the assembly represent real residue/nucleotide.

Returns:
returns true if the assembly represents gap.

next

public abstract Assembly next()
Returns next assembly in list.

Returns:
next assembly in list.

prev

public abstract Assembly prev()
Returns previous assembly in list.

Returns:
previous assembly in list.

insertAfter

public abstract boolean insertAfter(Assembly newAssembly)
Inserts an assembly after the current one. The function inserts the assembly only if it is not linked to any other assembly.

Parameters:
newAssembly - assembly to insert.
Returns:
true if newAssemlly has been inserted, false otherwise.

insertBefore

public abstract boolean insertBefore(Assembly newAssembly)
Inserts an assembly before the current one. The function inserts the assembly only if it is not linked to any other assembly.

Parameters:
newAssembly - assembly to insert.
Returns:
true if newAssembly has been inserted, false otherwise.

extractAfter

public abstract Assembly extractAfter()
Extracts the assembly following the current one from the list. Extracted assembly is not linked to any other assembly.

Returns:
next assembly in the list.

extractBefore

public abstract Assembly extractBefore()
Extracts the assembly preceeding the current one from the list. Extracted assembly is not linked to any other assembly.

Returns:
previous assembly in the list.

atomList

public abstract Atom atomList()
Returns list of atoms.

Returns:
list of atoms.

addAtom

public abstract boolean addAtom(Atom atom)
Adds atom to the end of atom list of the current assembly. The atom must be not linked to other atom. The function sets reference to the current assembly for added atom.

Parameters:
atom - atom to add.
Returns:
true if atom has been added, false otherwise.

addBond

public abstract boolean addBond(Bond bond)
Adds peptide/phosphodiester bond.

Parameters:
bond - bond to add.
Returns:
true if bond has been added, false otherwise.

countBonds

public abstract int countBonds()
Returns number of peptide/phosphodiester bonds for the assembly.

Returns:
number of peptide/phosphodiester bonds for the assembly.

bondArray

public abstract Bond[] bondArray()
Returns array of peptide/phosphodiester bonds. There can be more than two bonds since neighboring assemblies can have more than one conformation.

Returns:
array of peptide/phosphodiester bonds.

isConnectedTo

public abstract boolean isConnectedTo(Assembly s)
Returns true if assemblies are connected by peptide/phosphodiester bonds, false otherwise.

Returns:
true if assemblies are connected by peptide/phosphodiester bonds, false otherwise.

chain

public abstract Chain chain()
Returns a chain the assembly belongs to.

Returns:
a chain the assembly belongs to.

setChain

public abstract boolean setChain(Chain chain)
Sets a chain the assembly belongs to. The chain is set only if the assembly does not belong to other chain.

Parameters:
chain - chain to set.
Returns:
true if chain has been set, false otherwise.

getCompound

public abstract Compound getCompound()
Returns assembly's compound.

Returns:
assembly's compound.

getName

public abstract String getName()
Returns assembly's name.

Returns:
assembly's name.

getLetterName

public abstract char getLetterName()
Returns assembly's one letter name.

Returns:
assembly's one letter name.

getSerialNum

public abstract int getSerialNum()
Returns assembly's serial number.

Returns:
assembly's serial number.

setSerialNum

public abstract void setSerialNum(int serial)
Sets assembly's serial number.

Parameters:
serial - assembly's serial number.

getICode

public abstract char getICode()
Returns assembly's icode.

Returns:
assembly's icode.

setICode

public abstract void setICode(char icode)
Sets assembly's icode.

Parameters:
icode - assembly's icode.

getCAAtom

public abstract Atom getCAAtom()
Returns C-alpha atom or null if it is not found.

Returns:
C-alpha atom or null if it is not found.

getMainAtom

public abstract Atom getMainAtom()
Returns the main atom (CA for proteins and sugar P for nucleotides) in assembly or null if such atom can't be found.

Returns:
the main atom in assembly.

countAtoms

public abstract int countAtoms()
Returns number of atoms in the assembly.

Returns:
number of atoms in the assembly.

selectAllAtoms

public abstract void selectAllAtoms(boolean val)
Select or deselect all atoms in a assembly.

Parameters:
val - if true -- select all atoms, if false -- deselect.

getAlignedAttribute

public static int getAlignedAttribute()
Returns flag attribute of aligned assemblies.

Returns:
flag attribute of aligned assemblies.

getHelixAttribute

public static int getHelixAttribute()
Returns flag attribute for residues in helices. Attribute is for all type of helices (i,i+3), (i,i+4), (i,i+5).

Returns:
flag attribute for residues in helices.

getHelix3Attribute

public static int getHelix3Attribute()
Returns flag attribute for residues in 3,10-helices.

Returns:
flag attribute for residues in 3,10-helices.

getHelix4Attribute

public static int getHelix4Attribute()
Returns flag attribute for residues in 4-helices.

Returns:
flag attribute for residues in 4-helices.

getHelix5Attribute

public static int getHelix5Attribute()
Returns flag attribute for residues in 5-helices.

Returns:
flag attribute for residues in 5-helices.

getSheetAttribute

public static int getSheetAttribute()
Returns flag attribute for residues in sheets.

Returns:
flag attribute for residues in sheets.

getTurnAttribute

public static int getTurnAttribute()
Returns flag attribute for residues in turn.

Returns:
flag attribute for residues in turn.

getRegularAttribute

public static int getRegularAttribute()
Returns flag attribute for residues in any secondary structure elements.

Returns:
flag attribute for residues in any secondary structure elements.

getGroupAttribute

public static int getGroupAttribute(int group_id)
Returns flag attribute for assemblies in particular group.

Returns:
flag attribute for assemblies in particular group.

isAligned

public abstract boolean isAligned()
Returns true if assemblies is aligned, false otherwise.

Returns:
true if assemblies is aligned, false otherwise.

setAligned

public abstract void setAligned(boolean val)
Sets assembly's alignment attribute.

Parameters:
val - assembly's alignment attribute.

getGroupId

public abstract int getGroupId()
Returns group id or 0 if assembly is not assigned to any group.

Returns:
group id or 0 if assembly is not assigned to any group.

setGroupId

public abstract boolean setGroupId(int groupId)
Sets group id for the assembly. Currently 3 bytes are allocated to store the value.

Returns:
true is succesfull, false if the value is too large.

hasAttribute

public abstract boolean hasAttribute(int att)
Returns true if the provide attribute matches to the attributes of the assembly.

Returns:
true if the provide attribute matches to the attributes of the assembly.

toString

public abstract String toString()
Returns string representation of the assembly.

Overrides:
toString in class Object
Returns:
string representation of the assembly.