// GFF (GenomeParserImpl) files use 1-based indices
int startIndex = location.getStart() - 1;
int stopIndex = location.getStop();
if (!location.getSequenceType()) {
parts.add(new NucleotideSequence(null, GeneSequence.INTRON, location.getStart(), location.getStop()));
continue;
}
if (code.length() < startIndex || code.length() < stopIndex) {
continue;
}
StringBuilder sequence = new StringBuilder(code.substring(startIndex, stopIndex));
String sequenceString;
if (gene.isForward()) {
sequenceString = sequence.toString();
} else {
sequenceString = StringUtils.replaceChars(sequence.reverse().toString(), "ACGT", "TGCA");
}
parts.add(new NucleotideSequence(sequenceString, GeneSequence.CODING_SEQUENCE, location.getStart(), location.getStop()));
}
if (GenomeConstant.REVERSE_FLAG.equals(gene.getDirectionStr())) {
Collections.reverse(parts);
}