    001    package calhoun.analysis.crf.features.interval29;
    002
    003    import calhoun.analysis.crf.CacheStrategySpec;
    004    import calhoun.analysis.crf.FeatureManagerNodeBoundaries;
    005    import calhoun.analysis.crf.CacheStrategySpec.CacheStrategy;
    006
    007
    008    public class ReferenceBasePredictorInterval29 extends ReferenceBasePredictorInterval29Base implements FeatureManagerNodeBoundaries<Character> {
    009
    010            private static final long serialVersionUID = -8460452348450096338L;
    011
    012            public ReferenceBasePredictorInterval29() {
    013            }
    014
    015            public CacheStrategySpec getCacheStrategy() {
    016
    017                    CacheStrategySpec css = new CacheStrategySpec(CacheStrategy.DENSE_NODE_BOUNDARY);
    018                    CacheStrategySpec.DenseBoundaryCachingDetails details = new CacheStrategySpec.DenseBoundaryCachingDetails(25); // we will use 9 tables...nix. 25 for interval29
    019
    020
    021                    // If you want to predict for real and mesh with a PWM, then set pads, for example, as below:
    022                    //      donor[j]    = new PWMLookup(3,6,pseudoCounts);   // donor signal           xxx|GTxxxx
    023                    //      acceptor[j] = new PWMLookup(9,6,pseudoCounts);   // acceptor signal  xxxxxxxAG|xxxxxx
    024                    //  start = new PWMLookup(9,6,pseudoCounts);             // start signal xxxxxxxxx|ATGxxx
    025                    //  stop  = new PWMLookup(3,9,pseudoCounts);             // stop signal        xxx|TAGxxxxxx
    026
    027                    // IDEALLY HAVE SOME ASSERTIONS TYING THESE PADS TO THE PWM SIZES
    028                    details.add(0,0,startIx + (multipleFeatures ? 0 : 0),Interval29Model.getPadIntergenic(),Interval29Model.getPadIntergenic());  // minlength 18
    029                    details.add(1,1,startIx + (multipleFeatures ? 1 : 0),Interval29Model.getPadExon3prime(),Interval29Model.getPadExon5prime());  // minlength 9
    030                    details.add(2,2,startIx + (multipleFeatures ? 1 : 0),Interval29Model.getPadExon3prime(),Interval29Model.getPadExon5prime());
    031                    details.add(3,3,startIx + (multipleFeatures ? 1 : 0),Interval29Model.getPadExon3prime(),Interval29Model.getPadExon5prime());
    032                    details.add(4,4,startIx + (multipleFeatures ? 2 : 0),Interval29Model.getPadIntron3prime(),Interval29Model.getPadIntron5prime());  // minlength 15
    033                    details.add(5,4,startIx + (multipleFeatures ? 2 : 0),Interval29Model.getPadIntron3prime(),Interval29Model.getPadIntron5prime());
    034                    details.add(6,4,startIx + (multipleFeatures ? 2 : 0),Interval29Model.getPadIntron3prime(),Interval29Model.getPadIntron5prime());
    035                    details.add(7,5,startIx + (multipleFeatures ? 3 : 0),Interval29Model.getPadExon5prime(),Interval29Model.getPadExon3prime());  // minlength 9
    036                    details.add(8,6,startIx + (multipleFeatures ? 3 : 0),Interval29Model.getPadExon5prime(),Interval29Model.getPadExon3prime());
    037                    details.add(9,7,startIx + (multipleFeatures ? 3 : 0),Interval29Model.getPadExon5prime(),Interval29Model.getPadExon3prime());
    038                    details.add(10,8,startIx + (multipleFeatures ? 4 : 0),Interval29Model.getPadIntron5prime(),Interval29Model.getPadIntron3prime());  // minlength 15
    039                    details.add(11,8,startIx + (multipleFeatures ? 4 : 0),Interval29Model.getPadIntron5prime(),Interval29Model.getPadIntron3prime());
    040                    details.add(12,8,startIx + (multipleFeatures ? 4 : 0),Interval29Model.getPadIntron5prime(),Interval29Model.getPadIntron3prime());
    041                    details.add(13,0,startIx + (multipleFeatures ? 0 : 0),0,0);
    042                    details.add(14,0,startIx + (multipleFeatures ? 0 : 0),0,0);
    043                    details.add(15,4,startIx + (multipleFeatures ? 2 : 0),0,0);
    044                    details.add(16,4,startIx + (multipleFeatures ? 2 : 0),0,0);
    045                    details.add(17,4,startIx + (multipleFeatures ? 2 : 0),0,0);
    046                    details.add(18,4,startIx + (multipleFeatures ? 2 : 0),0,0);
    047                    details.add(19,4,startIx + (multipleFeatures ? 2 : 0),0,0);
    048                    details.add(20,4,startIx + (multipleFeatures ? 2 : 0),0,0);
    049                    details.add(21,0,startIx + (multipleFeatures ? 0 : 0),0,0);
    050                    details.add(22,0,startIx + (multipleFeatures ? 0 : 0),0,0);
    051                    details.add(23,8,startIx + (multipleFeatures ? 4 : 0),0,0);
    052                    details.add(24,8,startIx + (multipleFeatures ? 4 : 0),0,0);
    053                    details.add(25,8,startIx + (multipleFeatures ? 4 : 0),0,0);
    054                    details.add(26,8,startIx + (multipleFeatures ? 4 : 0),0,0);
    055                    details.add(27,8,startIx + (multipleFeatures ? 4 : 0),0,0);
    056                    details.add(28,8,startIx + (multipleFeatures ? 4 : 0),0,0);
    057                    // NOTE: The minimum lengths of the Semi-Markov training and inference for each state must be AT least as big as the sum of the two pads at either end.
    058
    059                    details.check();
    060
    061                    css.details = details;
    062
    063                    return css;
    064            }
    065    }