ca.pfv.spmf.input.sequence_database_list_strings
Class SequenceDatabase
- java.lang.Object
-
- ca.pfv.spmf.input.sequence_database_list_strings.SequenceDatabase
-
public class SequenceDatabase extends java.lang.ObjectImplementation of a sequence database as list of strings. Each sequence should have a unique id. See examples in /test/ directory for the format of input files.- See Also:
Sequence
-
-
Constructor Summary
Constructors Constructor and Description SequenceDatabase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddSequence(Sequence sequence)Add a sequence to this sequence database.java.util.Set<java.lang.Integer>getSequenceIDs()Get the list of sequence IDs for this database.java.util.List<Sequence>getSequences()Get the sequences from this sequence database.voidloadFile(java.lang.String path)Method to load a sequence database from a text file in SPMF format.voidprintDatabase()Print this sequence database to System.out.voidprintDatabaseStats()Print some statistics about this sequence database to System.out.intsize()Get the sequence count in this database.java.lang.StringtoString()Return a string representation of this sequence database.
-
-
-
Method Detail
-
loadFile
public void loadFile(java.lang.String path) throws java.io.IOExceptionMethod to load a sequence database from a text file in SPMF format.- Parameters:
path- the input file path.- Throws:
java.io.IOException- exception if error while reading the file.
-
addSequence
public void addSequence(Sequence sequence)
Add a sequence to this sequence database.- Parameters:
sequence- A sequence.
-
printDatabase
public void printDatabase()
Print this sequence database to System.out.
-
printDatabaseStats
public void printDatabaseStats()
Print some statistics about this sequence database to System.out.
-
toString
public java.lang.String toString()
Return a string representation of this sequence database.- Overrides:
toStringin classjava.lang.Object
-
size
public int size()
Get the sequence count in this database.- Returns:
- the sequence count.
-
getSequences
public java.util.List<Sequence> getSequences()
Get the sequences from this sequence database.- Returns:
- A list of sequences (Sequence).
-
getSequenceIDs
public java.util.Set<java.lang.Integer> getSequenceIDs()
Get the list of sequence IDs for this database.- Returns:
- A set containing the sequence IDs of sequence in this database.
-
-
DMelt 3.0 © DataMelt by jWork.ORG