### Question:
TranscriptProjectionDecorator { public TranscriptPosition cdsToTranscriptPos(CDSPosition pos) { final GenomePosition cdsBeginPos = transcript.getCDSRegion().getGenomeBeginPos(); int currPos = 0; for (GenomeInterval region : transcript.getExonRegions()) { if (region.getGenomeEndPos().isLeq(cdsBeginPos)) { currPos += region.length(); } else { currPos += cdsBeginPos.differenceTo(region.getGenomeBeginPos()); break; } } return new TranscriptPosition(transcript, currPos + pos.getPos()); } TranscriptProjectionDecorator(TranscriptModel transcript); TranscriptModel getTranscript(); String getCDSTranscript(); String getTranscriptStartingAtCDS(); TranscriptPosition genomeToTranscriptPos(GenomePosition pos); CDSPosition genomeToCDSPos(GenomePosition pos); TranscriptPosition cdsToTranscriptPos(CDSPosition pos); GenomePosition cdsToGenomePos(CDSPosition pos); GenomePosition transcriptToGenomePos(TranscriptPosition pos); int exonIDInReferenceOrder(int exonID); int locateIntron(GenomePosition pos); int locateExon(GenomePosition pos); int locateExon(TranscriptPosition pos); CDSPosition projectGenomeToCDSPosition(GenomePosition pos); CDSInterval projectGenomeToCDSInterval(GenomeInterval interval); TranscriptPosition projectGenomeToTXPosition(GenomePosition pos); TranscriptInterval projectGenomeToTXInterval(GenomeInterval interval); static final int INVALID_EXON_ID; static final int INVALID_INTRON_ID; }### Answer:
@Test public void testCDSPosToTranscriptPosForward() { TranscriptProjectionDecorator projector = new TranscriptProjectionDecorator(infoForward); Assert.assertEquals(new TranscriptPosition(infoForward, 203), projector.cdsToTranscriptPos(new CDSPosition(infoForward, 0))); Assert.assertEquals(new TranscriptPosition(infoForward, 233), projector.cdsToTranscriptPos(new CDSPosition(infoForward, 30))); Assert.assertEquals(new TranscriptPosition(infoForward, 403), projector.cdsToTranscriptPos(new CDSPosition(infoForward, 200))); Assert.assertEquals(new TranscriptPosition(infoForward, 503), projector.cdsToTranscriptPos(new CDSPosition(infoForward, 300))); }
@Test public void testCDSPosToTranscriptPosReverse() { TranscriptProjectionDecorator projector = new TranscriptProjectionDecorator(infoReverse); Assert.assertEquals(new TranscriptPosition(infoReverse, 559), projector.cdsToTranscriptPos(new CDSPosition(infoReverse, 0))); Assert.assertEquals(new TranscriptPosition(infoReverse, 589), projector.cdsToTranscriptPos(new CDSPosition(infoReverse, 30))); Assert.assertEquals(new TranscriptPosition(infoReverse, 759), projector.cdsToTranscriptPos(new CDSPosition(infoReverse, 200))); Assert.assertEquals(new TranscriptPosition(infoReverse, 859), projector.cdsToTranscriptPos(new CDSPosition(infoReverse, 300))); }