|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.compomics.util.protein.Header
public class Header
This class represents the header for a Protein instance.
It is meant to work closely with FASTA format notation. The Header class knows how to
handle certain often-used headers such as SwissProt and NCBI formatted FASTA headers.
Note that the Header class is it's own factory, and should be used as such.
Nested Class Summary | |
---|---|
static class |
Header.DatabaseType
A list of the database types. |
Method Summary | |
---|---|
void |
addAddendum(java.lang.String aAddendum)
This method allows the addition of an addendum to the list. |
java.lang.Object |
clone()
This method provides a deep copy of the Header instance. |
java.lang.String |
getAbbreviatedFASTAHeader()
This method returns an abbreviated version of the Header, suitable for inclusion in FASTA formatted files. |
java.lang.String |
getAbbreviatedFASTAHeaderWithAddenda()
This method returns an abbreviated version of the Header, suitable for inclusion in FASTA formatted files. |
java.lang.String |
getAccession()
|
java.lang.String |
getAddenda()
This method allows the caller to retrieve all addenda for the current header, or 'null' if there aren't any. |
java.lang.String |
getCoreHeader()
This method reports on the core information for the header, which is comprised of the ID and the accession String: |
Header.DatabaseType |
getDatabaseType()
|
java.lang.String |
getDescription()
|
int |
getEndLocation()
This method reports on the end index of the header. |
java.lang.String |
getForeignAccession()
|
java.lang.String |
getForeignDescription()
|
java.lang.String |
getForeignID()
|
java.lang.String |
getFullHeaderWithAddenda()
This method reports on the full header, with the addenda (if present). |
java.lang.String |
getID()
|
java.lang.String |
getRest()
|
int |
getScore()
This method will attribute a score to the current header, based on the following scoring list: SwissProt : 4 IPI, SwissProt reference : 3 IPI, TrEMBL or REFSEQ_NP reference : 2 IPI, without SwissProt, TrEMBL or REFSEQ_NP reference : 1 NCBI, SwissProt reference : 2 NCBI, other reference : 1 Unknown header format : 0 |
int |
getStartLocation()
This method reports on the start index of the header. |
boolean |
hasAddenda()
This method reports on the presence of addenda for this header. |
static Header |
parseFromFASTA(java.lang.String aFASTAHeader)
Factory method that constructs a Header instance based on a FASTA header line. |
void |
setAccession(java.lang.String aAccession)
|
void |
setDatabaseType(Header.DatabaseType aDatabaseType)
|
void |
setDescription(java.lang.String aDescription)
|
void |
setForeignAccession(java.lang.String aForeignAccession)
|
void |
setForeignDescription(java.lang.String aForeignDescription)
|
void |
setForeignID(java.lang.String aForeignID)
|
void |
setID(java.lang.String aID)
|
void |
setLocation(int aStart,
int aEnd)
This method allows the caller to add information to the header about location of the sequence in a certain master sequence. |
void |
setRest(java.lang.String aRest)
|
java.lang.String |
toString()
This method reports on the entire header. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static Header parseFromFASTA(java.lang.String aFASTAHeader)
aFASTAHeader
- the String with the original FASTA header line.
public java.lang.String getID()
public void setID(java.lang.String aID)
public java.lang.String getForeignID()
public void setForeignID(java.lang.String aForeignID)
public java.lang.String getAccession()
public void setAccession(java.lang.String aAccession)
public Header.DatabaseType getDatabaseType()
public void setDatabaseType(Header.DatabaseType aDatabaseType)
public java.lang.String getForeignAccession()
public void setForeignAccession(java.lang.String aForeignAccession)
public java.lang.String getDescription()
public void setDescription(java.lang.String aDescription)
public java.lang.String getForeignDescription()
public void setForeignDescription(java.lang.String aForeignDescription)
public java.lang.String getRest()
public void setRest(java.lang.String aRest)
public java.lang.String getAbbreviatedFASTAHeader()
>[ID]|[accession_string]|([foreign_ID]|[foreign_accession_string]|[foreign_description] )[description]
public java.lang.String toString()
toString
in class java.lang.Object
public int getScore()
public java.lang.String getCoreHeader()
[ID]|[accession_string]This is mostly useful for appending this core as an addendum to another header.
public void addAddendum(java.lang.String aAddendum)
aAddendum
- String with the addendum, facultatively preceded by '^A'.public java.lang.String getAddenda()
public boolean hasAddenda()
public java.lang.String getFullHeaderWithAddenda()
public java.lang.String getAbbreviatedFASTAHeaderWithAddenda()
>[ID]|[accession_string]|([foreign_ID]|[foreign_accession_string]|[foreign_description] )[description]([addenda])Note that the output of this method is identical to that of the getAbbreviatedFASTAHeader() if no addenda are present.
public void setLocation(int aStart, int aEnd)
[id]|[accession_string] ([startindex]-[endindex])|...Please note the following:
aStart
- int with the startindex.aEnd
- int with the endindex.public int getStartLocation()
public int getEndLocation()
public java.lang.Object clone()
clone
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |