uk.ac.sanger.psu.gfmerge.analysis.simfeature_analysis.tools
Class CDnaSpliceSiteAnalysisTools

java.lang.Object
  |
  +--uk.ac.sanger.psu.gfmerge.analysis.simfeature_analysis.tools.BasicFeatureAnalysisTools
        |
        +--uk.ac.sanger.psu.gfmerge.analysis.simfeature_analysis.tools.CDnaSpliceSiteAnalysisTools

public class CDnaSpliceSiteAnalysisTools
extends BasicFeatureAnalysisTools

class which contains computing tools for CDnaSpliceSiteAnalysis.

Version:
1.0
Author:
Sebastian R. Spiegler

Constructor Summary
CDnaSpliceSiteAnalysisTools()
           
 
Method Summary
private static double calcCDnaSpliceSiteGmScore(MyTreeMap minPosTree, MyTreeMap maxPosTree, java.util.ArrayList featureArr)
          method which calculates the score of a gm.
private static RecordGmCDna checkFeatPosInTree(int featPos, int maxDistance, MyTreeMap posTree)
          method which checks whether position is in tree or not.
private static boolean doesBoundaryOverlapCDnaIntron(int gmBound, java.util.ArrayList featureArr)
          method which checks if genemodel boundary is overlapping a cDNA intron.
private static boolean doesPosOverlapSimFeatures(int pos, int fuzzyCDnaBoundaries, java.util.ArrayList featureArr)
          method which returns true if given position overlaps a object in SimFeature ArrayList.
private static double getCDnaScoredSpliceSiteForGm(int debug, int fuzzyCDnaBoundaries, GeneModel gm, java.util.ArrayList featureArr)
          methode which calculates the score for one gm (either intron boundaries or splice sites).
private static java.util.HashMap getCDnaScoredSpliceSiteHash(int debug, int fuzzyCDnaBoundaries, java.util.HashMap hashCDnaOverlappedGms)
          method which gets scored splice sites of genemodels using cDNA evidence.
static java.util.HashMap getCDnaSpliceSiteScoredGmHash(int debug, int fuzzyCDnaBoundaries, boolean considerStrand, java.util.ArrayList _arrListOfGMRegions, java.util.ArrayList _arrListOfCDnaRegions)
          method which returns HashMap of genemodels pointing to their score using a cDNA splice site scoring system.
private static MyTreeMap getGmSpliceSiteTree(int debug, int fuzzyCDnaBoundaries, boolean isMinPosTree, GeneModel gm, java.util.ArrayList featureArr)
          method which creates a tree of either max or min splice sites of the genemodel and overlapping features.
private static int getPositionForPosTree(boolean isMinPosTree, FeatureComponentAble exon)
          method which returns position of exon boundary for position tree.
private static double getTreeScore(MyTreeMap tree, java.util.ArrayList featureArr)
          method which calculates the score of a tree.
private static MyTreeMap putFeatPosInGmTree(MyTreeMap positionTree, int fuzzyCDnaBoundaries, boolean isMinPosTree, java.util.ArrayList featureCompArr)
          method which adds SimFeature boundaries to gm boundary tree.
private static MyTreeMap putGmInPosTree(boolean isMinPosTree, int fuzzyCDnaBoundaries, java.util.ArrayList gmFeatCompArr, java.util.ArrayList featureArr)
          method which returns a tree of featureComponent positions (Intron, Exon).
 
Methods inherited from class uk.ac.sanger.psu.gfmerge.analysis.simfeature_analysis.tools.BasicFeatureAnalysisTools
getGmHashOfOverlappedFeat, isFeatureOverlappingGm
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CDnaSpliceSiteAnalysisTools

public CDnaSpliceSiteAnalysisTools()
Method Detail

getCDnaSpliceSiteScoredGmHash

public static java.util.HashMap getCDnaSpliceSiteScoredGmHash(int debug,
                                                              int fuzzyCDnaBoundaries,
                                                              boolean considerStrand,
                                                              java.util.ArrayList _arrListOfGMRegions,
                                                              java.util.ArrayList _arrListOfCDnaRegions)
method which returns HashMap of genemodels pointing to their score using a cDNA splice site scoring system.

Parameters:
debug - debugging mode
fuzzyCDnaBoundaries - contains allowed difference of cDNA and genemodel splice site
considerStrand - switch for strand consideration
_arrListOfGMRegions - ArrayList of genemodel regions
_arrListOfCDnaRegions - ArrayList of cDNA regions
Returns:
HashMap of genemodels pointing to their cDNA splice site score

getCDnaScoredSpliceSiteHash

private static java.util.HashMap getCDnaScoredSpliceSiteHash(int debug,
                                                             int fuzzyCDnaBoundaries,
                                                             java.util.HashMap hashCDnaOverlappedGms)
method which gets scored splice sites of genemodels using cDNA evidence.

Parameters:
debug - debugging mode
fuzzyCDnaBoundaries - contains allowed difference of cDNA and genemodel splice site
hashCDnaOverlappedGms - HashMap of genemodels pointing to ArrayList of overlapping cDNAs
Returns:
HashMap of genemodels pointing their splice site score

getCDnaScoredSpliceSiteForGm

private static double getCDnaScoredSpliceSiteForGm(int debug,
                                                   int fuzzyCDnaBoundaries,
                                                   GeneModel gm,
                                                   java.util.ArrayList featureArr)
methode which calculates the score for one gm (either intron boundaries or splice sites).

Parameters:
debug - debugging mode
fuzzyCDnaBoundaries - contains allowed difference of cDNA and genemodel splice site
gm - genemodel
featureArr - ArrayList of overlapping SimFeature objects
Returns:
score

getGmSpliceSiteTree

private static MyTreeMap getGmSpliceSiteTree(int debug,
                                             int fuzzyCDnaBoundaries,
                                             boolean isMinPosTree,
                                             GeneModel gm,
                                             java.util.ArrayList featureArr)
method which creates a tree of either max or min splice sites of the genemodel and overlapping features. The tree contains RecordGmCDna objects which are used for finding overlapping splice sites of genemodels and cDNA features

Parameters:
debug - debugging mode
fuzzyCDnaBoundaries - contains allowed difference of cDNA and genemodel splice site
isMinPosTree - switch for consideration of either start or end position of the feature
gm - genemodel
featureArr - ArrayList of overlapping SimFeature objects
Returns:
tree of RecordGmCDna objects

putGmInPosTree

private static MyTreeMap putGmInPosTree(boolean isMinPosTree,
                                        int fuzzyCDnaBoundaries,
                                        java.util.ArrayList gmFeatCompArr,
                                        java.util.ArrayList featureArr)
method which returns a tree of featureComponent positions (Intron, Exon).

Parameters:
isMinPosTree - switch for consideration of either start or end position of the feature
fuzzyCDnaBoundaries - contains allowed difference of cDNA and genemodel splice site
gmFeatCompArr - ArrayList of genemodel components (genemodel component positions)
featureArr - ArrayList of overlapping features
Returns:
tree of RecordGmCDna objects (featureComponent positions)

doesPosOverlapSimFeatures

private static boolean doesPosOverlapSimFeatures(int pos,
                                                 int fuzzyCDnaBoundaries,
                                                 java.util.ArrayList featureArr)
method which returns true if given position overlaps a object in SimFeature ArrayList.

Parameters:
pos - position of a genemodel (either start or end position)
fuzzyCDnaBoundaries - contains allowed difference of cDNA and genemodel splice site
featureArr - ArrayList of overlapping SimFeature objects
Returns:
true for overlapping / false for not overlapping

getPositionForPosTree

private static int getPositionForPosTree(boolean isMinPosTree,
                                         FeatureComponentAble exon)
method which returns position of exon boundary for position tree.

Parameters:
isMinPosTree - switch for consideration of either start or end position of the feature
exon - Exon object
Returns:
position of FeatureComponent boundary

putFeatPosInGmTree

private static MyTreeMap putFeatPosInGmTree(MyTreeMap positionTree,
                                            int fuzzyCDnaBoundaries,
                                            boolean isMinPosTree,
                                            java.util.ArrayList featureCompArr)
method which adds SimFeature boundaries to gm boundary tree. If same boundary => add to gm record, If diff boundary => create new record object

Parameters:
positionTree - tree containing RecordGmCDna objects
fuzzyCDnaBoundaries - contains allowed difference of cDNA and genemodel splice site
isMinPosTree - switch for consideration of either start or end position of the feature
featureCompArr - ArrayList of genemodel components
Returns:
tree of RecordGmCDna objects

checkFeatPosInTree

private static RecordGmCDna checkFeatPosInTree(int featPos,
                                               int maxDistance,
                                               MyTreeMap posTree)
method which checks whether position is in tree or not. If position is in tree, record object is returned, else null is returned

Parameters:
featPos - position of a genemodel (either start or end position)
maxDistance - contains allowed difference of cDNA and genemodel splice site
posTree - position tree containing all splice sites of genemodel and overlapping SimFeature objects (either start or end position)
Returns:
either RecordGmCDna object or null

calcCDnaSpliceSiteGmScore

private static double calcCDnaSpliceSiteGmScore(MyTreeMap minPosTree,
                                                MyTreeMap maxPosTree,
                                                java.util.ArrayList featureArr)
method which calculates the score of a gm.

Parameters:
minPosTree - tree containing RecordGmCDna objects (only start positions)
maxPosTree - tree containing RecordGmCDna objects (only end positions)
featureArr - ArrayList of genemodel overlapping features
Returns:
absolute score

getTreeScore

private static double getTreeScore(MyTreeMap tree,
                                   java.util.ArrayList featureArr)
method which calculates the score of a tree. Either start or end positions => partial score of genemodel

Parameters:
tree - tree containing RecordGmCDna objects
featureArr - ArrayList of genemodel overlapping features
Returns:
absolute score

doesBoundaryOverlapCDnaIntron

private static boolean doesBoundaryOverlapCDnaIntron(int gmBound,
                                                     java.util.ArrayList featureArr)
method which checks if genemodel boundary is overlapping a cDNA intron.

Parameters:
gmBound - boundary of a genemodel
featureArr - ArrayList of overlapping cDNA features
Returns:
true for overlap