public class Protein extends Object implements Serializable
java -ms256m -mx256m org.mathIT.genes.Protein
Constructor and Description |
---|
Protein(String name,
ArrayList<Character> sequence)
Constructor of a protein with the specified name and the specified sequence
of amino acids, i.e., the letters A, C, G, T (or U for an RNA protein).
|
Protein(String name,
char[] sequence)
Constructor of a protein with the specified name and the specified sequence
of amino acids, i.e., the letters A, C, G, T (or U for an RNA protein).
|
Protein(String name,
CharSequence sequence)
Constructor of a protein with the specified name and the specified sequence
of amino acids, i.e., the letters A, C, G, T (or U for an RNA protein).
|
Modifier and Type | Method and Description |
---|---|
String |
asHTMLString()
Returns a string representing this protein, with line breaks encoded by
"<br>" instead of '\n'.
|
double |
entropy()
Returns the entropy of the frequency distribution of the amino acids of this protein.
|
protected static String |
getAsCSVTable(Map<String,Integer> map)
Returns the specified map as a CSV data table string.
|
TreeMap<String,Integer> |
getExtremalTripletFrequencies(int highest,
int lowest)
Returns the absolute frequency distribution of the amino acids triplets
with the highest nhigh frequencies and the
lowest nlow frequencies, specified by the to parameters
highest and lowest . |
TreeMap<Character,Integer> |
getFrequencies()
Returns the absolute frequency distribution of the amino acids.
|
protected String |
getFrequenciesAsCSVTable()
Returns the frequency distribution of this protein as a CSV data table string.
|
String |
getFrequenciesAsHTMLGraph()
Returns the frequency distribution of the amino acids as HTML graph.
|
static String |
getFrequenciesAsHTMLGraph(TreeMap<String,Integer> frequencies)
Returns the frequency distribution of amino acid triplets as HTML graph.
|
String |
getFrequenciesAsHTMLGraph2()
Returns the frequency distribution of the amino acids as HTML graph in
landscape format.
|
String |
getFrequenciesAsHTMLTable()
Returns the frequency distribution of the amino acids as HTML table.
|
String |
getName()
Returns the name of this protein.
|
TreeMap<String,Integer> |
getPairFrequencies()
Returns the absolute frequency distribution of the amino acid pairs.
|
String |
getPairFrequenciesAsHTMLGraph()
Returns the frequency distribution of amino acid pairs as HTML graph.
|
StringBuilder |
getSequence()
Returns the amino acid sequence of this protein.
|
ArrayList<Character> |
getSequenceAsArrayList()
Returns the amino acid sequence of this protein.
|
TreeMap<String,Integer> |
getTripletFrequencies()
Returns the absolute frequency distribution of the amino acids.
|
static Protein |
loadFASTA()
Returns a protein after opening a file in
FASTA format,
determined by a file chooser dialog.
|
static Protein |
loadProtein()
Returns a protein after opening a file in GNOM format, found by a file chooser dialog.
|
double |
p(char b)
Returns the probability to obtain the specified amino acid of this protein sequence.
|
void |
save()
Saves this protein in PROT format.
|
void |
saveAsCSV()
Saves this protein as CSV file.
|
String |
toString()
Returns a string representing this protein.
|
public Protein(String name, ArrayList<Character> sequence)
name
- the name of the proteinsequence
- the sequence of amino acidspublic Protein(String name, char[] sequence)
name
- the name of the proteinsequence
- the sequence of amino acidspublic Protein(String name, CharSequence sequence)
name
- the name of the proteinsequence
- sequence of amino acidspublic String getName()
public StringBuilder getSequence()
public ArrayList<Character> getSequenceAsArrayList()
public TreeMap<Character,Integer> getFrequencies()
public TreeMap<String,Integer> getPairFrequencies()
public TreeMap<String,Integer> getTripletFrequencies()
public TreeMap<String,Integer> getExtremalTripletFrequencies(int highest, int lowest)
highest
and lowest
.highest
- the limit of most frequent triplets to be returnedlowest
- the limit of least frequent triplets to be returnedpublic String getFrequenciesAsHTMLTable()
protected String getFrequenciesAsCSVTable()
protected static String getAsCSVTable(Map<String,Integer> map)
map
- data mappublic String getFrequenciesAsHTMLGraph()
public String getFrequenciesAsHTMLGraph2()
public String getPairFrequenciesAsHTMLGraph()
public static String getFrequenciesAsHTMLGraph(TreeMap<String,Integer> frequencies)
frequencies
- frequency distributionpublic double p(char b)
b
- the specified amino acidpublic double entropy()
public String asHTMLString()
public String toString()
public static Protein loadFASTA()
public void save()
public void saveAsCSV()
public static Protein loadProtein()