X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fio%2Fvcf%2FVCFLoaderTest.java;h=5607b4ba1afc60474edf9ac9598af9d2635ece8a;hb=9bde0814fff97f50e3ac6165a9fb83787c37d39a;hp=13c6f95d54a8a66305154fa13dde746995ab89f3;hpb=43bee46f18100411bfa20508f7740e60dd525f4a;p=jalview.git diff --git a/test/jalview/io/vcf/VCFLoaderTest.java b/test/jalview/io/vcf/VCFLoaderTest.java index 13c6f95..5607b4b 100644 --- a/test/jalview/io/vcf/VCFLoaderTest.java +++ b/test/jalview/io/vcf/VCFLoaderTest.java @@ -55,7 +55,7 @@ public class VCFLoaderTest private static final String[] VCF = { "##fileformat=VCFv4.2", "##INFO=", - "##reference=GRCh38", + "##reference=Homo_sapiens/GRCh38", "#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO", // A/T,C variants in position 2 of gene sequence (precedes transcript) // should create 2 variant features with respective scores @@ -191,7 +191,8 @@ public class VCFLoaderTest SequenceI gene1 = alignment.findName("gene1"); int[] to = new int[] { 45051610, 45051634 }; int[] from = new int[] { gene1.getStart(), gene1.getEnd() }; - gene1.setGeneLoci("human", "GRCh38", "17", new MapList(from, to, 1, 1)); + gene1.setGeneLoci("homo_sapiens", "GRCh38", "17", new MapList(from, to, + 1, 1)); /* * map 'transcript1' to chromosome via 'gene1' @@ -201,7 +202,8 @@ public class VCFLoaderTest to = new int[] { 45051612, 45051619, 45051624, 45051633 }; SequenceI transcript1 = alignment.findName("transcript1"); from = new int[] { transcript1.getStart(), transcript1.getEnd() }; - transcript1.setGeneLoci("human", "GRCh38", "17", new MapList(from, to, + transcript1.setGeneLoci("homo_sapiens", "GRCh38", "17", new MapList( + from, to, 1, 1)); /* @@ -210,7 +212,8 @@ public class VCFLoaderTest SequenceI gene2 = alignment.findName("gene2"); to = new int[] { 45051634, 45051610 }; from = new int[] { gene2.getStart(), gene2.getEnd() }; - gene2.setGeneLoci("human", "GRCh38", "17", new MapList(from, to, 1, 1)); + gene2.setGeneLoci("homo_sapiens", "GRCh38", "17", new MapList(from, to, + 1, 1)); /* * map 'transcript2' to chromosome via 'gene2' @@ -220,7 +223,8 @@ public class VCFLoaderTest to = new int[] { 45051633, 45051624, 45051619, 45051612 }; SequenceI transcript2 = alignment.findName("transcript2"); from = new int[] { transcript2.getStart(), transcript2.getEnd() }; - transcript2.setGeneLoci("human", "GRCh38", "17", new MapList(from, to, + transcript2.setGeneLoci("homo_sapiens", "GRCh38", "17", new MapList( + from, to, 1, 1)); /* @@ -248,7 +252,8 @@ public class VCFLoaderTest SequenceI gene3 = alignment.findName("gene3"); to = new int[] { 45051610, 45051634 }; from = new int[] { gene3.getStart(), gene3.getEnd() }; - gene3.setGeneLoci("human", "GRCh38", "5", new MapList(from, to, 1, 1)); + gene3.setGeneLoci("homo_sapiens", "GRCh38", "5", new MapList(from, to, + 1, 1)); /* * map 'transcript3' to chromosome @@ -256,7 +261,8 @@ public class VCFLoaderTest SequenceI transcript3 = alignment.findName("transcript3"); to = new int[] { 45051612, 45051619, 45051624, 45051633 }; from = new int[] { transcript3.getStart(), transcript3.getEnd() }; - transcript3.setGeneLoci("human", "GRCh38", "5", new MapList(from, to, + transcript3.setGeneLoci("homo_sapiens", "GRCh38", "5", new MapList( + from, to, 1, 1)); /* @@ -266,7 +272,8 @@ public class VCFLoaderTest to = new int[] { 45051615, 45051617, 45051619, 45051632, 45051634, 45051634 }; from = new int[] { transcript4.getStart(), transcript4.getEnd() }; - transcript4.setGeneLoci("human", "GRCh38", "5", new MapList(from, to, + transcript4.setGeneLoci("homo_sapiens", "GRCh38", "5", new MapList( + from, to, 1, 1)); /* @@ -505,6 +512,31 @@ public class VCFLoaderTest assertTrue(sf.getValue("CSQ").toString().contains("transcript3")); /* + * verify variants computed on protein product for transcript3 + * peptide is SWRECD + * codon variants are AGC/AGT position 1 which is synonymous + * and GAG/GGG which is E/G in position 4 + * the insertion variant is not transferred to the peptide + */ + DBRefEntry[] dbRefs = al.findName("transcript3").getDBRefs(); + SequenceI peptide = null; + for (DBRefEntry dbref : dbRefs) + { + if (dbref.getMap().getMap().getFromRatio() == 3) + { + peptide = dbref.getMap().getTo(); + } + } + List proteinFeatures = peptide.getSequenceFeatures(); + assertEquals(proteinFeatures.size(), 1); + sf = proteinFeatures.get(0); + assertEquals(sf.getFeatureGroup(), "VCF"); + assertEquals(sf.getBegin(), 4); + assertEquals(sf.getEnd(), 4); + assertEquals(sf.getType(), SequenceOntologyI.SEQUENCE_VARIANT); + assertEquals(sf.getDescription(), "p.Glu4Gly"); + + /* * verify variant feature(s) added to transcript4 * at columns 13 (2) and 17 (2), positions 7 and 11 */