|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.compomics.util.protein.Protein
public class Protein
This class implements the behaviour for a Protein instance. A lot of functionality is borrowed from the AASequenceImpl class. The internal representation corresponds most closely to a FASTA entry.
AASequenceImpl
Field Summary | |
---|---|
static int |
CTERMTRUNC
The code for an C-terminal truncation. |
static int |
NTERMTRUNC
The code for an N-terminal truncation. |
Constructor Summary | |
---|---|
Protein(Header aHeader,
AASequenceImpl aSequence)
This constructor allows the passing of a Header, as well as an AASequenceImpl for this Protein. |
|
Protein(Header aHeader,
AASequenceImpl aSequence,
boolean aTruncated,
int aTruncationPosition)
This constructor allows the passing of a Header, as well as an AASequenceImpl for this Protein. |
|
Protein(String aFASTAString)
This constructor allows for the construction of a Protein instance by passing a FASTA entry. |
|
Protein(String aFASTAString,
boolean aTruncated,
int aTruncationPosition)
This constructor allows for the construction of a Protein instance by passing a FASTA entry and boolean flag for truncation. |
|
Protein(String aHeader,
String aSequence)
This constructor allows for the construction of a Protein instance through the passing of a Header String and a Sequence String. |
|
Protein(String aHeader,
String aSequence,
boolean aTruncated,
int aTruncationPosition)
This constructor allows for the construction of a Protein instance through the passing of a Header String and a Sequence String. |
|
Protein(AASequenceImpl aSequence)
This constructor requires an AASequenceImpl as argument. |
Method Summary | |
---|---|
boolean |
equals(Object o)
This method will check equality between this object and another Protein instance. |
Protein |
getCTermTruncatedProtein(int aSize)
This method truncates the sequence for this protein on the C-terminus to the requested size. |
Header |
getHeader()
This method reports on the header for the current protein. |
long |
getLength()
This method reports on the length of the sequence for the current protein. |
double |
getMass()
This method returns the protein weight in Da. |
Protein |
getNTermTruncatedProtein(int aSize)
This method truncates the sequence for this protein on the N-terminus to the requested size. |
AASequenceImpl |
getSequence()
This method reports on the sequence for the current protein. |
int |
getTruncationPosition()
This method reports on the position of the truncation. |
boolean |
isTruncated()
This method reports on the 'truncatedness' of the protein. |
void |
setHeader(Header aHeader)
Simple setter for the header. |
void |
setSequence(AASequenceImpl aSequence)
Simple setter for the sequence. |
void |
writeToFASTAFile(PrintWriter aOut)
This method can be used to append this protein to the FASTA DB flatfile the PrintWriter points to. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int NTERMTRUNC
public static final int CTERMTRUNC
Constructor Detail |
---|
public Protein(AASequenceImpl aSequence)
aSequence
- AASequenceImpl around which this protein will be built.public Protein(Header aHeader, AASequenceImpl aSequence)
aHeader
- Header with the header information for this Protein.aSequence
- AASequenceImpl with the sequence for this Protein.public Protein(Header aHeader, AASequenceImpl aSequence, boolean aTruncated, int aTruncationPosition)
aHeader
- Header with the header information for this Protein.aSequence
- AASequenceImpl with the sequence for this Protein.aTruncated
- boolean that indicates whether this Protein has been truncated.aTruncationPosition
- int with the coded position for the truncation (N-Term or C-Term).public Protein(String aFASTAString)
aFASTAString
- String with the FASTA representation of the Protein.public Protein(String aFASTAString, boolean aTruncated, int aTruncationPosition)
aFASTAString
- String with the FASTA representation of the Protein.aTruncated
- boolean that indicates whether this Protein has been truncated.aTruncationPosition
- int with the coded position for the truncation (N-Term or C-Term).public Protein(String aHeader, String aSequence)
aHeader
- String with the header (can be 'null').aSequence
- String with the sequence.public Protein(String aHeader, String aSequence, boolean aTruncated, int aTruncationPosition)
aHeader
- String with the header (can be 'null').aSequence
- String with the sequence.aTruncated
- boolean that indicates whether this Protein has been truncated.aTruncationPosition
- int with the coded position for the truncation (N-Term or C-Term).Method Detail |
---|
public Header getHeader()
public AASequenceImpl getSequence()
public Protein getNTermTruncatedProtein(int aSize)
aSize
- int with the size of the resulting N-terminal sequence
public Protein getCTermTruncatedProtein(int aSize)
aSize
- int with the size of the resulting C-terminal sequence
public long getLength()
public double getMass()
public void setHeader(Header aHeader)
aHeader
- the Header to set for this protein.public void setSequence(AASequenceImpl aSequence)
aSequence
- the AASequenceImpl with the
sequence to set for this protein.public void writeToFASTAFile(PrintWriter aOut) throws IOException
aOut
- PrintWriter to write the file to.
IOException
- when the writing failed.public boolean isTruncated()
public int getTruncationPosition()
public boolean equals(Object o)
equals
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |