com.compomics.util.experiment.identification
Class FastaIndex

java.lang.Object
  extended by com.compomics.util.experiment.personalization.ExperimentObject
      extended by com.compomics.util.experiment.identification.FastaIndex
All Implemented Interfaces:
Serializable, Cloneable

public class FastaIndex
extends ExperimentObject

This class contains the index of a FASTA file.

Author:
Marc Vaudel
See Also:
Serialized Form

Constructor Summary
FastaIndex(HashMap<String,Long> indexes, String fileName, String name, boolean concatenatedTargetDecoy, boolean isDefaultReversed, int nTarget, long lastModified, Header.DatabaseType databaseType, String decoyTag, String version)
          Constructor.
 
Method Summary
 Header.DatabaseType getDatabaseType()
          Indicates the database type.
 String getDecoyTag()
          Returns the decoy tag.
static String getDefaultVersion(long lastModified)
          Returns the default version based on the time the file was last modified.
 String getFileName()
          Returns the file name of the inspected FASTA file.
 Long getIndex(String accession)
          Returns the index of the accession of interest.
 HashMap<String,Long> getIndexes()
          Returns a map of all indexes of the FASTA file (accession -> index).
 Long getLastModified()
          Returns when the file was last modified.
 String getName()
          Returns the name of the database.
 int getNSequences()
          Returns the number of sequences in the database.
 int getNTarget()
          Returns the number of target sequences in the database.
 String getVersion()
          Returns the database version.
 boolean isConcatenatedTargetDecoy()
          Indicates whether the database is a concatenated target/decoy database.
 boolean isDefaultReversed()
          Indicates whether the decoy sequences are reversed versions of the target and the decoy accessions built based on the sequence factory methods.
 void setConcatenatedTargetDecoy(boolean concatenatedTargetDecoy)
          Sets whether the database is a concatenated target/decoy database.
 void setDatabaseType(Header.DatabaseType databaseType)
          Sets the database type.
 void setDecoyTag(String decoyTag)
          Sets the decoy tag.
 void setName(String name)
          Sets a new name for the database.
 void setVersion(String version)
          Sets the database version.
 
Methods inherited from class com.compomics.util.experiment.personalization.ExperimentObject
addUrParam, getParameterKey, getUrParam
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FastaIndex

public FastaIndex(HashMap<String,Long> indexes,
                  String fileName,
                  String name,
                  boolean concatenatedTargetDecoy,
                  boolean isDefaultReversed,
                  int nTarget,
                  long lastModified,
                  Header.DatabaseType databaseType,
                  String decoyTag,
                  String version)
Constructor.

Parameters:
indexes - The indexes of the inspected FASTA file
fileName - The FASTA file name
name - the name of the database
concatenatedTargetDecoy - If the FASTA file is a concatenated target/decoy database
isDefaultReversed - is this a default reversed database
nTarget - Number of target sequences found in the database
lastModified - a long indicating the last time the indexed file was modified
databaseType - the database type
decoyTag - the decoy tag
version - the database version
Method Detail

getIndexes

public HashMap<String,Long> getIndexes()
Returns a map of all indexes of the FASTA file (accession -> index).

Returns:
a map of all indexes of the FASTA file (accession -> index)

getIndex

public Long getIndex(String accession)
Returns the index of the accession of interest.

Parameters:
accession - the accession of interest
Returns:
the index of the accession of interest

getFileName

public String getFileName()
Returns the file name of the inspected FASTA file.

Returns:
the file name of the inspected FASTA file

isDefaultReversed

public boolean isDefaultReversed()
Indicates whether the decoy sequences are reversed versions of the target and the decoy accessions built based on the sequence factory methods. See getDefaultDecoyAccession(String targetAccession) in SequenceFactory.

Returns:
true if the decoy sequences are reversed versions of the target and the decoy accessions built based on the sequence factory methods

getNTarget

public int getNTarget()
Returns the number of target sequences in the database.

Returns:
the number of target sequences in the database

getNSequences

public int getNSequences()
Returns the number of sequences in the database.

Returns:
the number of sequences in the databases.

getLastModified

public Long getLastModified()
Returns when the file was last modified. Null if not set or for utilities versions older than 3.11.30.

Returns:
a long indicating when the file was last modified

getDatabaseType

public Header.DatabaseType getDatabaseType()
Indicates the database type.

Returns:
the database type.

setDatabaseType

public void setDatabaseType(Header.DatabaseType databaseType)
Sets the database type.

Parameters:
databaseType - the database type

getVersion

public String getVersion()
Returns the database version.

Returns:
the database version

setVersion

public void setVersion(String version)
Sets the database version.

Parameters:
version - the database version

isConcatenatedTargetDecoy

public boolean isConcatenatedTargetDecoy()
Indicates whether the database is a concatenated target/decoy database.

Returns:
whether the database is a concatenated target/decoy database

setConcatenatedTargetDecoy

public void setConcatenatedTargetDecoy(boolean concatenatedTargetDecoy)
Sets whether the database is a concatenated target/decoy database.

Parameters:
concatenatedTargetDecoy - whether the database is a concatenated target/decoy database

getDecoyTag

public String getDecoyTag()
Returns the decoy tag.

Returns:
sets the decoy tag

setDecoyTag

public void setDecoyTag(String decoyTag)
Sets the decoy tag.

Parameters:
decoyTag - the decoy tag

getName

public String getName()
Returns the name of the database.

Returns:
the name for the database

setName

public void setName(String name)
Sets a new name for the database.

Parameters:
name - a new name for the database

getDefaultVersion

public static String getDefaultVersion(long lastModified)
Returns the default version based on the time the file was last modified. Default version is the date "DD.MM.YYYY".

Parameters:
lastModified - long indicating when the database was last modified
Returns:
the default version


Copyright © 2013. All Rights Reserved.