procope.methods.interologs
Class Sequences

java.lang.Object
  extended by procope.methods.interologs.Sequences

public class Sequences
extends Object

A set of sequences internally represented by a internal_id=>sequence mapping. Registered protein can only have one sequence.

Author:
Jan Krumsiek
See Also:
FASTAParser, ProteinManager

Constructor Summary
Sequences()
          Creates an empty sequences set.
Sequences(Map<Integer,String> sequences)
          Creates a sequence object from a given map.
 
Method Summary
 void add(int id, String sequence)
          Adds a single sequence to this set.
 void addAll(Sequences toAdd)
          Adds all sequences of another Sequences object to this set.
 Map<Integer,String> getAll()
          Returns the map which backs this object.
 String getSequence(int key)
          Returns the sequence for a given internal protein ID.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Sequences

public Sequences()
Creates an empty sequences set.


Sequences

public Sequences(Map<Integer,String> sequences)
Creates a sequence object from a given map. The keys must be internal protein IDs, the values are the sequences.

Parameters:
sequences - Map containing the sequences
Method Detail

getSequence

public String getSequence(int key)
Returns the sequence for a given internal protein ID.

Parameters:
key - internal ID of the protein
Returns:
Sequence as a String or null if no sequence is associated with this protein

addAll

public void addAll(Sequences toAdd)
Adds all sequences of another Sequences object to this set. Sequences of proteins which are already in the current set will be overridden

Parameters:
toAdd - Sequences to add

add

public void add(int id,
                String sequence)
Adds a single sequence to this set. If there already is a sequence for this proteins in the set it will be overridden.

Parameters:
id - internal ID of the protein
sequence - sequence to be added

getAll

public Map<Integer,String> getAll()
Returns the map which backs this object. Attention: A directed reference and no copy will be returned. Changes to this map object will also affect the Sequences object.

Returns:
Map object backing the sequences collection