|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.compomics.util.experiment.identification.SequenceFactory
public class SequenceFactory
factory retrieving the information of the loaded fasta file
Field Summary | |
---|---|
static java.lang.String[] |
decoyFlags
Recognized flags for a decoy protein |
Method Summary | |
---|---|
void |
appendDecoySequences(java.io.File destinationFile)
Appends decoy sequences to the desired file |
void |
appendDecoySequences(java.io.File destinationFile,
ProgressDialogX progressDialog)
Appends decoy sequences to the desired file while displaying progress |
void |
closeFile()
Closes the opened file |
boolean |
concatenatedTargetDecoy()
Indicates whether the database loaded contains decoy sequences |
static FastaIndex |
createFastaIndex(java.io.File fastaFile)
static method to create a fasta index for a fasta file |
static FastaIndex |
createFastaIndex(java.io.File fastaFile,
ProgressDialogX progressDialog)
static method to create a fasta index for a fasta file |
java.util.ArrayList<java.lang.String> |
getAccessions()
Returns the sequences present in the database |
FastaIndex |
getFastaIndex(java.io.File fastaFile)
Returns the file index of a fasta file |
FastaIndex |
getFastaIndex(java.io.File fastaFile,
ProgressDialogX progressDialog)
Returns the file index of a fasta file |
Header |
getHeader(java.lang.String accession)
returns the desired header for the protein in the fasta file |
FastaIndex |
getIndex(java.io.File fastaIndex)
Deserializes the index of the fasta file |
static SequenceFactory |
getInstance()
static method returning the instance of the factory |
static SequenceFactory |
getInstance(int nCache)
returns the instance of the factory with the specified cache size |
int |
getnCache()
Returns the size of the cache |
int |
getNTargetSequences()
Returns the number of target sequences in the database |
Protein |
getProtein(java.lang.String accession)
Returns the desired protein |
static boolean |
isDecoy(java.lang.String proteinAccession)
Returns a boolean indicating whether a protein is decoy or not based on the protein accession. |
void |
loadFastaFile(java.io.File fastaFile)
loads a new fasta file in the factory. |
void |
loadFastaFile(java.io.File fastaFile,
ProgressDialogX progressDialog)
loads a new fasta file in the factory. |
void |
setnCache(int nCache)
Sets the size of the cache |
void |
writeIndex(FastaIndex fastaIndex,
java.io.File directory)
serializes the fasta file index in a given directory |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String[] decoyFlags
Method Detail |
---|
public static SequenceFactory getInstance()
public static SequenceFactory getInstance(int nCache)
nCache
- the new cache size
public Protein getProtein(java.lang.String accession) throws java.io.IOException
accession
- accession of the desired protein
java.io.IOException
- exception thrown whenever an error is encountered while reading the fasta filepublic Header getHeader(java.lang.String accession) throws java.io.IOException
accession
- accession of the desired protein
java.io.IOException
- exception thrown whenever an error occurred while reading the fasta filepublic void loadFastaFile(java.io.File fastaFile) throws java.io.FileNotFoundException, java.io.IOException, java.lang.ClassNotFoundException
fastaFile
- the fasta file to load
java.io.FileNotFoundException
- exception thrown if the file was not found
java.io.IOException
- exception thrown if an error occurred while reading the fasta file
java.lang.ClassNotFoundException
- exception thrown whenever an error occurred while deserializing the file indexpublic void loadFastaFile(java.io.File fastaFile, ProgressDialogX progressDialog) throws java.io.FileNotFoundException, java.io.IOException, java.lang.ClassNotFoundException
fastaFile
- the fasta file to loadprogressDialog
- a progress dialog showing the progress
java.io.FileNotFoundException
- exception thrown if the file was not found
java.io.IOException
- exception thrown if an error occurred while reading the fasta file
java.lang.ClassNotFoundException
- exception thrown whenever an error occurred while deserializing the file indexpublic FastaIndex getFastaIndex(java.io.File fastaFile) throws java.io.FileNotFoundException, java.io.IOException, java.lang.ClassNotFoundException
fastaFile
- the fasta file
java.io.FileNotFoundException
- exception thrown if the file was not found
java.io.IOException
- exception thrown if an error occurred while reading the fasta file
java.lang.ClassNotFoundException
- exception thrown whenever an error occurred while deserializing the file indexpublic FastaIndex getFastaIndex(java.io.File fastaFile, ProgressDialogX progressDialog) throws java.io.FileNotFoundException, java.io.IOException, java.lang.ClassNotFoundException
fastaFile
- the fasta fileprogressDialog
- a progress dialog showing the progress
java.io.FileNotFoundException
- exception thrown if the file was not found
java.io.IOException
- exception thrown if an error occurred while reading the fasta file
java.lang.ClassNotFoundException
- exception thrown whenever an error occurred while deserializing the file indexpublic void writeIndex(FastaIndex fastaIndex, java.io.File directory) throws java.io.IOException
fastaIndex
- the index of the fasta filedirectory
- the directory where to write the file
java.io.IOException
- exception thrown whenever an error occurred while writing the filepublic FastaIndex getIndex(java.io.File fastaIndex) throws java.io.FileNotFoundException, java.io.IOException, java.lang.ClassNotFoundException
fastaIndex
- the fasta cui index file
java.io.FileNotFoundException
- exception thrown if the file was not found
java.io.IOException
- exception thrown if an error occurred while reading the fasta file
java.lang.ClassNotFoundException
- exception thrown whenever an error occurred while deserializing the file indexpublic void closeFile() throws java.io.IOException
java.io.IOException
- exception thrown whenever an error occurred while closing the filepublic static FastaIndex createFastaIndex(java.io.File fastaFile) throws java.io.FileNotFoundException, java.io.IOException
fastaFile
- the fasta file
java.io.FileNotFoundException
- exception thrown if the fasta file was not found
java.io.IOException
- exception thrown whenever an error occurred while reading the filepublic static FastaIndex createFastaIndex(java.io.File fastaFile, ProgressDialogX progressDialog) throws java.io.FileNotFoundException, java.io.IOException
fastaFile
- the fasta fileprogressDialog
- a progress dialog showing the progress
java.io.FileNotFoundException
- exception thrown if the fasta file was not found
java.io.IOException
- exception thrown whenever an error occurred while reading the filepublic static boolean isDecoy(java.lang.String proteinAccession)
proteinAccession
- The accession of the protein
public boolean concatenatedTargetDecoy()
public int getNTargetSequences()
public void appendDecoySequences(java.io.File destinationFile) throws java.io.IOException
destinationFile
- the destination file
java.io.IOException
- exception thrown whenever an error occurred while reading or writing a filepublic void appendDecoySequences(java.io.File destinationFile, ProgressDialogX progressDialog) throws java.io.IOException
destinationFile
- the destination fileprogressDialog
- the progress dialog
java.io.IOException
- exception thrown whenever an error occurred while reading or writing a filepublic java.util.ArrayList<java.lang.String> getAccessions()
public int getnCache()
public void setnCache(int nCache)
nCache
- the new size of the cache
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |