From: Jim Procter Date: Sun, 7 Jun 2015 18:04:31 +0000 (+0100) Subject: JAL-653 test for GFF file recognition and alignment import X-Git-Tag: Release_2_10_0~296^2~147 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=98a1852d598a1863633f9b1c219a1a8e8df0e1f8;p=jalview.git JAL-653 test for GFF file recognition and alignment import --- diff --git a/test/jalview/io/Gff3tests.java b/test/jalview/io/Gff3tests.java index 8c4a40d..30cb451 100644 --- a/test/jalview/io/Gff3tests.java +++ b/test/jalview/io/Gff3tests.java @@ -41,7 +41,15 @@ public class Gff3tests } @Test - public void simpleGff3() throws IOException + public void simpleGff3FileIdentify() + { + Assert.assertEquals("Didn't recognise file correctly.", + IdentifyFile.GFF3File, + new IdentifyFile().Identify(simpleGff3file, FormatAdapter.FILE)); + } + + @Test + public void simpleGff3FileClass() throws IOException { AlignmentI dataset = new Alignment(new SequenceI[] {}); @@ -54,6 +62,17 @@ public class Gff3tests } @Test + public void simpleGff3FileLoader() throws IOException + { + AlignFrame af = new FileLoader(false).LoadFileWaitTillLoaded( + simpleGff3file, null); + Assert.assertTrue( + "Didn't read the alignment into an alignframe from Gff3 File", + af != null); + checkDatasetfromSimpleGff3(af.getViewport().getAlignment().getDataset()); + } + + @Test public void simpleGff3RelaxedIdMatching() throws IOException { AlignmentI dataset = new Alignment(new SequenceI[] @@ -67,6 +86,16 @@ public class Gff3tests checkDatasetfromSimpleGff3(dataset); } + @Test + public void readGff3File() throws IOException + { + Gff3File gff3reader = new Gff3File(simpleGff3file, FormatAdapter.FILE); + Alignment dataset = new Alignment(gff3reader.getSeqsAsArray()); + gff3reader.addProperties(dataset); + checkDatasetfromSimpleGff3(dataset); + + } + private void checkDatasetfromSimpleGff3(AlignmentI dataset) { Assert.assertEquals("no sequences extracted from GFF3 file", 2, @@ -97,6 +126,10 @@ public class Gff3tests Assert.assertEquals("Wrong number of features", 0, seq2 .getSequenceFeatures() == null ? 0 : seq2.getSequenceFeatures().length); + Assert.assertTrue( + "Expected at least one CDNA/Protein mapping for seq1", + dataset.getCodonFrame(seq1) != null + && dataset.getCodonFrame(seq1).size() > 0); } // @Test