X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fdatamodel%2FMappedFeaturesTest.java;h=f549ff4d2d467f259b2a38a8e5e9c296b52e672b;hb=refs%2Fheads%2Fbug%2FJAL-4313-make-visible-annot-fix;hp=e4caac31860a11b8c592861d10f0f9adeb20053b;hpb=e51f922b88b1f316e27cf4c19eef437ff592d74d;p=jalview.git diff --git a/test/jalview/datamodel/MappedFeaturesTest.java b/test/jalview/datamodel/MappedFeaturesTest.java index e4caac3..f549ff4 100644 --- a/test/jalview/datamodel/MappedFeaturesTest.java +++ b/test/jalview/datamodel/MappedFeaturesTest.java @@ -1,3 +1,23 @@ +/* + * 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 . + * The Jalview Authors are detailed in the 'AUTHORS' file. + */ package jalview.datamodel; import static org.testng.Assert.assertEquals; @@ -13,7 +33,7 @@ import org.testng.annotations.Test; public class MappedFeaturesTest { - @Test + @Test(groups = "Functional") public void testFindProteinVariants() { /* @@ -21,7 +41,7 @@ public class MappedFeaturesTest * dna/10-20 aCGTaGctGAa (codons CGT=R, GGA = G) * mapping: 3:1 from [11-13,15,18-19] to peptide/1-2 RG */ - SequenceI from = new Sequence("dna/10-20", "ACGTAGCTGAA"); + SequenceI from = new Sequence("dna/10-20", "acgTAGCTGAA"); SequenceI to = new Sequence("peptide", "RG"); MapList map = new MapList(new int[] { 11, 13, 15, 15, 18, 19 }, new int[] @@ -34,8 +54,8 @@ public class MappedFeaturesTest * T>C at dna13, consequence CGT>CGC synonymous */ List features = new ArrayList<>(); - SequenceFeature sf1 = new SequenceFeature("sequence_variant", "C,T", - 11, 11, null); + SequenceFeature sf1 = new SequenceFeature("sequence_variant", "C,T", 11, + 11, null); sf1.setValue("alleles", "C,T"); features.add(sf1); SequenceFeature sf2 = new SequenceFeature("sequence_variant", "T,C", 13, @@ -46,8 +66,7 @@ public class MappedFeaturesTest /* * missense variant in first codon */ - MappedFeatures mf = new MappedFeatures(mapping, from, 1, 'R', - features); + MappedFeatures mf = new MappedFeatures(mapping, from, 1, 'R', features); String variant = mf.findProteinVariants(sf1); assertEquals(variant, "p.Arg1Cys"); @@ -68,13 +87,20 @@ public class MappedFeaturesTest assertEquals(variant, "c.13T>C(p.=)"); /* - * CSQ:HGVSp value is used if present + * CSQ:HGVSp value is used if present + * _and_ it contains "p." following a colon */ Map csq = new HashMap<>(); csq.put("HGVSp", "hello:world"); sf2.setValue("CSQ", csq); variant = mf.findProteinVariants(sf2); - assertEquals(variant, "world"); + assertEquals(variant, "c.13T>C(p.=)"); + csq.put("HGVSp", "p.HelloWorld"); + variant = mf.findProteinVariants(sf2); + assertEquals(variant, "c.13T>C(p.=)"); + csq.put("HGVSp", "try this:hellop.world"); + variant = mf.findProteinVariants(sf2); + assertEquals(variant, "hellop.world"); /* * missense and indel variants in second codon