|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.sanger.psu.gfmerge.util.PredAccuracy
public class PredAccuracy
class PredAccuracy wraps the calculation of the average conditional probability for a genepredicter program.
Field Summary | |
---|---|
private double |
acp
Average Conditional Probability (ACP) is suggested as an appropriate measure of global prediction accuracy (Burset and Guigo, 1996). |
private int |
fn
attribute records the number of false negative bases (bases which are predicted to be non-coding but are coding in the annotation). |
private int |
fp
attribute records the number of false positive bases (bases which are predicted to be coding but are non-coding in the annotation). |
private int |
tn
attribute records the number of true negative bases (bases which are predicted to be non-coding and are non-coding in the annotation). |
private int |
tp
attribute records the number of true positive bases (bases which are predicted to be coding and are coding in the annotation). |
Constructor Summary | |
---|---|
PredAccuracy(org.biojava.bio.seq.Sequence seq_org,
org.biojava.bio.seq.Sequence seq_comp)
constructor which creates PredAccuracy object. |
Method Summary | |
---|---|
private double |
calcACP(org.biojava.bio.seq.Sequence seq_org,
org.biojava.bio.seq.Sequence seq_comp)
method which calculates ACP (average conditional probability). |
private void |
compSeq(int seqLength_org,
java.util.ArrayList arrList_org_fw,
java.util.ArrayList arrList_org_rev,
java.util.ArrayList arrList_comp_fw,
java.util.ArrayList arrList_comp_rev)
method which compares two sequences for matches and overlaps. |
private static java.util.HashMap |
countNucleotides(java.util.HashMap thisCountMap,
int seqLength,
java.lang.StringBuffer seq_org,
java.lang.StringBuffer seq_comp)
method which counts TP,TN,FP,FN bases. |
double |
getACP()
accessor method which returns average conditional probability value. |
private static java.util.ArrayList |
getAListOfLocs(org.biojava.bio.seq.FeatureHolder fh)
method which returns ArrayList of locations when sequence is given. |
private static org.biojava.bio.seq.FeatureHolder |
getFeaturesFromStrand(boolean pos_strand,
org.biojava.bio.seq.FeatureHolder fh)
method which returns featureholder of all features on either forward or reverse strand |
int |
getFN()
accessor method which returns number of false negative bases. |
int |
getFP()
accessor method which gets number of false positive bases. |
int |
getTN()
accessor method which returns number of true negative bases. |
int |
getTP()
accessor method which returns number of true positive bases. |
private static java.lang.StringBuffer |
markCoding(java.util.ArrayList arrListLoc,
java.lang.StringBuffer seq)
method which marks coding exons as 'C' on a sequence. |
private void |
setACP(double _acp)
accessor method which sets average conditional probability value. |
private void |
setAttributes(java.util.HashMap _countMap)
method which saves HashMap containing the tp, tn, fp, fn values to their appropriate attributes. |
private void |
setFN(int _fn)
accessor method which sets number of false negative bases. |
private void |
setFP(int _fp)
accessor method which sets number of false positive bases. |
private void |
setTN(int _tn)
accessor method which sets number of true negative bases. |
private void |
setTP(int _tp)
accessor method which setsnumber of true positive bases. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private int tp
private int tn
private int fp
private int fn
private double acp
It is calculated by comparing the prediction to the annotation on the base level. Formula used: ACP = [TP/(TP+FN)+TP/(TP+FP)+TN/(TN+FP)+TN/(TN+FN)]/4
Constructor Detail |
---|
public PredAccuracy(org.biojava.bio.seq.Sequence seq_org, org.biojava.bio.seq.Sequence seq_comp)
seq_org
- BioJava sequence object containing the annotationseq_comp
- BioJava sequence object containing the predictionMethod Detail |
---|
public int getTP()
private void setTP(int _tp)
_tp
- number of true positive basespublic int getTN()
private void setTN(int _tn)
_tn
- number of true negative basespublic int getFP()
private void setFP(int _fp)
_fp
- number of false positive basespublic int getFN()
private void setFN(int _fn)
_fn
- accessor method which returns number of false negative bases.public double getACP()
private void setACP(double _acp)
_acp
- average conditional probabilityprivate double calcACP(org.biojava.bio.seq.Sequence seq_org, org.biojava.bio.seq.Sequence seq_comp)
seq_org
- annotation sequenceseq_comp
- annotation sequence
private static java.util.ArrayList getAListOfLocs(org.biojava.bio.seq.FeatureHolder fh)
fh
- BioJava FeatureHolder
private void compSeq(int seqLength_org, java.util.ArrayList arrList_org_fw, java.util.ArrayList arrList_org_rev, java.util.ArrayList arrList_comp_fw, java.util.ArrayList arrList_comp_rev)
seqLength_org
- length of the sequencearrList_org_fw
- ArrayList of bases (either c for coding or n
for non-coding) of annotaion, forward strandarrList_org_rev
- ArrayList of bases (either c for coding or n
for non-coding) of annotaion, reverse strandarrList_comp_fw
- ArrayList of bases (either c for coding or n
for non-coding) of prediction, forward strandarrList_comp_rev
- ArrayList of bases (either c for coding or n
for non-coding) of prediction, reverse strandprivate static java.lang.StringBuffer markCoding(java.util.ArrayList arrListLoc, java.lang.StringBuffer seq)
arrListLoc
- ArrayList of coding Locationsseq
- String which contains binary variable for each position,
at the beginning all postions are non-coding, during processing
coding bases will be marked "C"
private static java.util.HashMap countNucleotides(java.util.HashMap thisCountMap, int seqLength, java.lang.StringBuffer seq_org, java.lang.StringBuffer seq_comp)
thisCountMap
- HashMap containing tp, tn, fp, fn as keys pointing to
their value, number of bases of the other strand will be addedseqLength
- length of sequenceseq_org
- annotationseq_comp
- prediction
private static org.biojava.bio.seq.FeatureHolder getFeaturesFromStrand(boolean pos_strand, org.biojava.bio.seq.FeatureHolder fh)
pos_strand
- switch for strandfh
- BioJava FeatuerHolder
private void setAttributes(java.util.HashMap _countMap)
_countMap
- HashMap containing the tp, tn, fp, fn values
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |