edu.mssm.crover.ims.tasks.engines
Class SequenceTaskData

java.lang.Object
  |
  +--edu.mssm.crover.ims.tasks.engines.SequenceTaskData
All Implemented Interfaces:
java.io.Serializable, TaskData

public class SequenceTaskData
extends java.lang.Object
implements TaskData, java.io.Serializable

Stores FASTA format sequences.

See Also:
Serialized Form

Field Summary
 AnnotatedBioSequence[] data
           
 java.io.File file
           
 
Constructor Summary
SequenceTaskData()
          Empty constructor.
SequenceTaskData(AnnotatedBioSequence[] sequence)
          Reads the AnnotatedBioSequence array passed as a parameter into the AnnotatedBioSequence array associated with this instance of SequenceTaskData.
SequenceTaskData(java.io.File file)
          Reads a file which contains FASTA sequence data.
SequenceTaskData(java.lang.String filename)
          Reads a file which contains FASTA sequence data.
 
Method Summary
 boolean canMerge()
          Does this instance support the merge operation?
 boolean canSplit()
          Does this instance support the split operation?
 SequenceTaskData convertFromFile()
          Converts a FASTA sequence file to a SequenceTaskData with no file associated with it.
 SequenceTaskData convertFromFile(java.io.File seq_file)
          Converts a FASTA sequence file to a SequenceTaskData with no file associated with it.
 AnnotatedBioSequence[] getData()
          Returns the AnnotatedBioSequence array associated with this instance of SequenceTaskData.
 java.io.File getFile()
          Returns the File which is associated with this instance of SequenceTaskData.
 java.io.File makeFile()
          Writes the AnnotatedBioSequence array to a file.
 void makeFile(java.io.File file)
          Writes the AnnotatedBioSequence data to a file.
 java.io.File makeFile(java.lang.String filename)
          Writes the AnnotatedBioSequence data to a file.
 TaskData merge(java.util.Collection task_data)
          Returns the merging of independent task_data in one instance.
 void setFile(java.io.File file)
          Allows you to set a File for this instance of SequenceTaskData.
 void setFile(java.lang.String filename)
          Allows you to set a filename for this instance of SequenceTaskData.
 long size()
          Returns the number of AnnotatedBioSequences in this SequenceTaskData instance.
 java.util.Collection split(int numpieces)
          Splits the data contained in this instance into several pieces.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

public AnnotatedBioSequence[] data

file

public java.io.File file
Constructor Detail

SequenceTaskData

public SequenceTaskData(java.io.File file)
                 throws java.io.FileNotFoundException
Reads a file which contains FASTA sequence data. Reads the sequences into the AnnotatedBioSequence array.


SequenceTaskData

public SequenceTaskData(java.lang.String filename)
                 throws java.io.FileNotFoundException
Reads a file which contains FASTA sequence data. Reads the sequences into the AnnotatedBioSequence array.


SequenceTaskData

public SequenceTaskData(AnnotatedBioSequence[] sequence)
Reads the AnnotatedBioSequence array passed as a parameter into the AnnotatedBioSequence array associated with this instance of SequenceTaskData.


SequenceTaskData

public SequenceTaskData()
Empty constructor.

Method Detail

canSplit

public boolean canSplit()
Description copied from interface: TaskData
Does this instance support the split operation?

Specified by:
canSplit in interface TaskData

size

public long size()
Returns the number of AnnotatedBioSequences in this SequenceTaskData instance.

Specified by:
size in interface TaskData

split

public java.util.Collection split(int numpieces)
Description copied from interface: TaskData
Splits the data contained in this instance into several pieces.

Specified by:
split in interface TaskData

canMerge

public boolean canMerge()
Description copied from interface: TaskData
Does this instance support the merge operation?

Specified by:
canMerge in interface TaskData

merge

public TaskData merge(java.util.Collection task_data)
Description copied from interface: TaskData
Returns the merging of independent task_data in one instance.

Specified by:
merge in interface TaskData

makeFile

public java.io.File makeFile()
                      throws java.io.IOException
Writes the AnnotatedBioSequence array to a file. The file is named "stof.fasta" (sequence_to_file) when called by this method.

java.io.IOException

makeFile

public java.io.File makeFile(java.lang.String filename)
                      throws java.io.IOException
Writes the AnnotatedBioSequence data to a file.

Parameters:
filename - the name of the file to write to.
java.io.IOException

makeFile

public void makeFile(java.io.File file)
              throws java.io.IOException
Writes the AnnotatedBioSequence data to a file.

java.io.IOException

convertFromFile

public SequenceTaskData convertFromFile(java.io.File seq_file)
                                 throws java.io.FileNotFoundException
Converts a FASTA sequence file to a SequenceTaskData with no file associated with it.

Parameters:
seq_file - The name of the file containing the FASTA sequence(s).
java.io.FileNotFoundException

convertFromFile

public SequenceTaskData convertFromFile()
                                 throws java.io.FileNotFoundException
Converts a FASTA sequence file to a SequenceTaskData with no file associated with it. The file to be read must already have been defined.

java.io.FileNotFoundException

setFile

public void setFile(java.io.File file)
Allows you to set a File for this instance of SequenceTaskData.


setFile

public void setFile(java.lang.String filename)
Allows you to set a filename for this instance of SequenceTaskData.


getFile

public java.io.File getFile()
Returns the File which is associated with this instance of SequenceTaskData.


getData

public AnnotatedBioSequence[] getData()
Returns the AnnotatedBioSequence array associated with this instance of SequenceTaskData.



Copyright @ 2003 Mount Sinai School of Medicine. All Rights Reserved.