Clarification on SequenceAnnotation.getIntervals() order
Hi,
I am seeing behavior for `SequenceAnnotation.getIntervals()` that does not match my understanding of the documentation, and would like to ask for clarification.
The API docs say: "For a CDS annotation the order of the intervals indicates the order in which the translation proceeds."
I am building a `SequenceAnnotation` as follows. When I call `cdsMinusStrand.getIntervals()`, the returned list is in left-to-right order, leftmost block first.
Can you please clarify? Am I failing to adequately specify the translation direction of this annotation?
private static SequenceAnnotation buildAnnotation(
Direction dirBlock1, Direction dirBlock2, String type, String ncbiCodonStart) {
SequenceAnnotationannot = new SequenceAnnotation(
"name",
type,
new SequenceAnnotationInterval(11, 20, dirBlock1),
new SequenceAnnotationInterval(31, 40, dirBlock2)
);
annot.addQualifier(SequenceAnnotationQualifier.NCBI_CODON_START, ncbiCodonStart);
return annot;
}
@BeforeAll
private static void setUp() {
cdsMinusStrand = buildAnnotation(
Direction.rightToLeft, Direction.rightToLeft, SequenceAnnotation.TYPE_CDS, "3");
}
-
Official comment
Hi Pam,
The order in which you add the intervals within the annotation is the order in which they will be 'processed' by our translation system. In your example you have intervals like this:
new SequenceAnnotationInterval(11, 20, Direction.rightToLeft),
new SequenceAnnotationInterval(31, 40, Direction.rightToLeft)The way this will be translated is that the interval #1 will be looked at first and because it's direction is right-to-left, the translation will start at point 20 and move backwards to point 11. Then the translation will continue into interval #2, and again, because it's direction is right-to-left, it will start from point 40 and translate to point 31.
Something to be aware of is that right-to-left intervals are considered to be on the reverse strand (so they will use the reverse-complement nucleotides).
Hope that answers your question,
Tom -
It does answer my question, thank you!
0
Please sign in to leave a comment.
Comments
2 comments