+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
package jalview.ext.ensembl;
import static org.testng.AssertJUnit.assertEquals;
public class EnsemblCdnaTest
{
- @BeforeClass
+ @BeforeClass(alwaysRun = true)
public void setUp()
{
SequenceOntologyFactory.setInstance(new SequenceOntologyLite());
}
- @AfterClass
+ @AfterClass(alwaysRun = true)
public void tearDown()
{
SequenceOntologyFactory.setInstance(null);
}
+
/**
* Test that the cdna part of genomic sequence is correctly identified by
* 'exon' features (or subtypes) - reverse strand case.
genomic.setStart(10000);
genomic.setEnd(50000);
String transcriptId = "ABC123";
-
+
// exon at (start+10000) length 501
SequenceFeature sf = new SequenceFeature("exon", "", 20000, 20500, 0f,
null);
sf.setValue("Parent", "transcript:" + transcriptId);
sf.setStrand("+");
genomic.addSequenceFeature(sf);
-
+
// exon (sub-type) at (start + exon_variant) length 101
sf = new SequenceFeature("coding_exon", "", 10500, 10600, 0f, null);
sf.setValue("Parent", "transcript:" + transcriptId);
sf.setStrand("+");
genomic.addSequenceFeature(sf);
-
+
// exon belonging to a different transcript doesn't count
sf = new SequenceFeature("exon", "", 11500, 12600, 0f, null);
sf.setValue("Parent", "transcript:anotherOne");
genomic.addSequenceFeature(sf);
-
+
// transcript feature doesn't count
sf = new SequenceFeature("transcript", "", 10000, 50000, 0f, null);
sf.setStrand("-"); // weird but ignored
genomic.addSequenceFeature(sf);
-
+
MapList ranges = testee.getGenomicRangesFromFeatures(genomic,
transcriptId, 23);
List<int[]> fromRanges = ranges.getFromRanges();
genomic.setStart(10000);
genomic.setEnd(50000);
String transcriptId = "ABC123";
-
+
SequenceFeature sf = new SequenceFeature("exon", "", 20000, 20500, 0f,
null);
sf.setValue("Parent", "transcript:" + transcriptId);
sf.setStrand("-");
genomic.addSequenceFeature(sf);
-
+
sf = new SequenceFeature("coding_exon", "", 10500, 10600, 0f, null);
sf.setValue("Parent", "transcript:" + transcriptId);
sf.setStrand("+");
genomic.addSequenceFeature(sf);
-
+
MapList ranges = testee.getGenomicRangesFromFeatures(genomic,
transcriptId, 23);
assertNull(ranges);