/* only call on an exon position */ private char getPeptide(int bp, SeqFeatureI sf) { char base = '\0'; SequenceI peptides = null; FeatureSetI parent = sf.getParent(); int pepPos = -1; if (parent != null && parent.hasPeptideSequence()) { peptides = parent.getPeptideSequence(); if (parent instanceof FeatureSet) { FeatureSet fs = (FeatureSet) parent; pepPos = fs.getPeptidePosForGenomicPos(bp); } if (pepPos >= 0 && pepPos < peptides.getLength()) { base = peptides.getBaseAt(pepPos); } } return base; }
private boolean isShiftPosition(int bp, SeqFeatureI feature, SequenceType type) { boolean result = false; // Can shifts only happen on exons? if (feature != null) { FeatureSet fs = (FeatureSet) feature.getRefFeature(); result = fs.plus1FrameShiftPosition() == bp || fs.minus1FrameShiftPosition() == bp; if (type == SequenceType.AA) { bp += feature.getStrand(); result = result || fs.plus1FrameShiftPosition() == bp || fs.minus1FrameShiftPosition() == bp; } if (type == SequenceType.AA) { bp += feature.getStrand(); result = result || fs.plus1FrameShiftPosition() == bp || fs.minus1FrameShiftPosition() == bp; } } return result; }