From: gmungoc Date: Tue, 15 Mar 2016 14:27:12 +0000 (+0000) Subject: JAL-1705 code tidy/comment only X-Git-Tag: Release_2_10_0~296^2~5 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=6fb341da6a316869ba5fc87c146c30d1279f06fa;p=jalview.git JAL-1705 code tidy/comment only --- diff --git a/src/jalview/ext/ensembl/EnsemblGene.java b/src/jalview/ext/ensembl/EnsemblGene.java index 3b32797..0cecc59 100644 --- a/src/jalview/ext/ensembl/EnsemblGene.java +++ b/src/jalview/ext/ensembl/EnsemblGene.java @@ -328,19 +328,19 @@ public class EnsemblGene extends EnsemblSeqProxy List mapTo = new ArrayList(); 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; } diff --git a/test/jalview/util/MapListTest.java b/test/jalview/util/MapListTest.java index c442b6f..e9bcf24 100644 --- a/test/jalview/util/MapListTest.java +++ b/test/jalview/util/MapListTest.java @@ -655,14 +655,17 @@ public class MapListTest @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());