List<int[]> mapTo = new ArrayList<int[]>();
mapTo.add(new int[] { 1, transcriptLength });
MapList mapping = new MapList(mappedFrom, mapTo, 1, 1);
- new EnsemblCdna(getDomain()).transferFeatures(
- gene.getSequenceFeatures(), transcript.getDatasetSequence(),
- mapping, parentId);
+ EnsemblCdna cdna = new EnsemblCdna(getDomain());
+ cdna.transferFeatures(gene.getSequenceFeatures(),
+ transcript.getDatasetSequence(), mapping, parentId);
/*
* fetch and save cross-references
*/
- new EnsemblCdna(getDomain()).getCrossReferences(transcript);
+ cdna.getCrossReferences(transcript);
/*
* and finally fetch the protein product and save as a cross-reference
*/
- new EnsemblCdna(getDomain()).addProteinProduct(transcript);
+ cdna.addProteinProduct(transcript);
return transcript;
}
@Test(groups = { "Functional" })
public void testIsFromForwardStrand()
{
+ // [3-9] declares forward strand
MapList ml = new MapList(new int[] { 2, 2, 3, 9, 12, 11 },
new int[] { 20, 11 }, 1, 1);
assertTrue(ml.isFromForwardStrand());
+ // [11-5] declares reverse strand ([13-14] is ignored)
ml = new MapList(new int[] { 2, 2, 11, 5, 13, 14 },
new int[] { 20, 11 }, 1, 1);
assertFalse(ml.isFromForwardStrand());
+ // all single position ranges - defaults to forward strand
ml = new MapList(new int[] { 2, 2, 4, 4, 6, 6 }, new int[] { 3, 1 }, 1,
1);
assertTrue(ml.isFromForwardStrand());