JAL-2738 remove commented code, unit test coverage
[jalview.git] / test / jalview / io / vcf / VCFLoaderTest.java
1 package jalview.io.vcf;
2
3 import static org.testng.Assert.assertEquals;
4 import static org.testng.Assert.assertTrue;
5
6 import jalview.datamodel.AlignmentI;
7 import jalview.datamodel.DBRefEntry;
8 import jalview.datamodel.Mapping;
9 import jalview.datamodel.Sequence;
10 import jalview.datamodel.SequenceFeature;
11 import jalview.datamodel.SequenceI;
12 import jalview.datamodel.features.SequenceFeatures;
13 import jalview.gui.AlignFrame;
14 import jalview.io.DataSourceType;
15 import jalview.io.FileLoader;
16 import jalview.io.gff.Gff3Helper;
17 import jalview.io.gff.SequenceOntologyI;
18 import jalview.util.MapList;
19
20 import java.io.File;
21 import java.io.IOException;
22 import java.io.PrintWriter;
23 import java.util.List;
24
25 import org.testng.annotations.Test;
26
27 public class VCFLoaderTest
28 {
29   private static final float DELTA = 0.00001f;
30
31   // columns 9717- of gene P30419 from Ensembl (much modified)
32   private static final String FASTA = ""
33           +
34           /*
35            * forward strand 'gene' and 'transcript' with two exons
36            */
37           ">gene1/1-25 chromosome:GRCh38:17:45051610:45051634:1\n"
38           + "CAAGCTGGCGGACGAGAGTGTGACA\n"
39           + ">transcript1/1-18\n--AGCTGGCG----AGAGTGTGAC-\n"
40
41           /*
42            * reverse strand gene and transcript (reverse complement alleles!)
43            */
44           + ">gene2/1-25 chromosome:GRCh38:17:45051610:45051634:-1\n"
45           + "TGTCACACTCTCGTCCGCCAGCTTG\n"
46           + ">transcript2/1-18\n" + "-GTCACACTCT----CGCCAGCT--\n"
47
48           /*
49            * 'gene' on chromosome 5 with two transcripts
50            */
51           + ">gene3/1-25 chromosome:GRCh38:5:45051610:45051634:1\n"
52           + "CAAGCTGGCGGACGAGAGTGTGACA\n"
53           + ">transcript3/1-18\n--AGCTGGCG----AGAGTGTGAC-\n"
54           + ">transcript4/1-18\n-----TGG-GGACGAGAGTGTGA-A\n";
55
56   private static final String[] VCF = { "##fileformat=VCFv4.2",
57       "##INFO=<ID=AF,Number=A,Type=Float,Description=\"Allele Frequency, for each ALT allele, in the same order as listed\">",
58       "##reference=GRCh38",
59       "#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO",
60       // A/T,C variants in position 2 of gene sequence (precedes transcript)
61       // should create 2 variant features with respective scores
62       "17\t45051611\t.\tA\tT,C\t1666.64\tRF\tAC=15;AF=5.0e-03,4.0e-03",
63       // SNP G/C in position 4 of gene sequence, position 2 of transcript
64       // insertion G/GA is transferred to nucleotide but not to peptide
65       "17\t45051613\t.\tG\tGA,C\t1666.64\tRF\tAC=15;AF=3.0e-03,2.0e-03" };
66
67   @Test(groups = "Functional")
68   public void testDoLoad() throws IOException
69   {
70     AlignmentI al = buildAlignment();
71     VCFLoader loader = new VCFLoader(al);
72
73     File f = makeVcf();
74
75     loader.doLoad(f.getPath(), null);
76
77     /*
78      * verify variant feature(s) added to gene
79      * NB alleles at a locus may not be processed, and features added,
80      * in the order in which they appear in the VCF record as method
81      * VariantContext.getAlternateAlleles() does not guarantee order
82      * - order of assertions here matches what we find (is not important) 
83      */
84     List<SequenceFeature> geneFeatures = al.getSequenceAt(0)
85             .getSequenceFeatures();
86     SequenceFeatures.sortFeatures(geneFeatures, true);
87     assertEquals(geneFeatures.size(), 4);
88     SequenceFeature sf = geneFeatures.get(0);
89     assertEquals(sf.getFeatureGroup(), "VCF");
90     assertEquals(sf.getBegin(), 2);
91     assertEquals(sf.getEnd(), 2);
92     assertEquals(sf.getScore(), 4.0e-03, DELTA);
93     assertEquals(sf.getValue(Gff3Helper.ALLELES), "A,C");
94     assertEquals(sf.getType(), SequenceOntologyI.SEQUENCE_VARIANT);
95     sf = geneFeatures.get(1);
96     assertEquals(sf.getFeatureGroup(), "VCF");
97     assertEquals(sf.getBegin(), 2);
98     assertEquals(sf.getEnd(), 2);
99     assertEquals(sf.getType(), SequenceOntologyI.SEQUENCE_VARIANT);
100     assertEquals(sf.getScore(), 5.0e-03, DELTA);
101     assertEquals(sf.getValue(Gff3Helper.ALLELES), "A,T");
102
103     sf = geneFeatures.get(2);
104     assertEquals(sf.getFeatureGroup(), "VCF");
105     assertEquals(sf.getBegin(), 4);
106     assertEquals(sf.getEnd(), 4);
107     assertEquals(sf.getType(), SequenceOntologyI.SEQUENCE_VARIANT);
108     assertEquals(sf.getScore(), 2.0e-03, DELTA);
109     assertEquals(sf.getValue(Gff3Helper.ALLELES), "G,C");
110
111     sf = geneFeatures.get(3);
112     assertEquals(sf.getFeatureGroup(), "VCF");
113     assertEquals(sf.getBegin(), 4);
114     assertEquals(sf.getEnd(), 4);
115     assertEquals(sf.getType(), SequenceOntologyI.SEQUENCE_VARIANT);
116     assertEquals(sf.getScore(), 3.0e-03, DELTA);
117     assertEquals(sf.getValue(Gff3Helper.ALLELES), "G,GA");
118
119     /*
120      * verify variant feature(s) added to transcript
121      */
122     List<SequenceFeature> transcriptFeatures = al.getSequenceAt(1)
123             .getSequenceFeatures();
124     assertEquals(transcriptFeatures.size(), 2);
125     sf = transcriptFeatures.get(0);
126     assertEquals(sf.getFeatureGroup(), "VCF");
127     assertEquals(sf.getBegin(), 2);
128     assertEquals(sf.getEnd(), 2);
129     assertEquals(sf.getType(), SequenceOntologyI.SEQUENCE_VARIANT);
130     assertEquals(sf.getScore(), 2.0e-03, DELTA);
131     assertEquals(sf.getValue(Gff3Helper.ALLELES), "G,C");
132     sf = transcriptFeatures.get(1);
133     assertEquals(sf.getFeatureGroup(), "VCF");
134     assertEquals(sf.getBegin(), 2);
135     assertEquals(sf.getEnd(), 2);
136     assertEquals(sf.getType(), SequenceOntologyI.SEQUENCE_VARIANT);
137     assertEquals(sf.getScore(), 3.0e-03, DELTA);
138     assertEquals(sf.getValue(Gff3Helper.ALLELES), "G,GA");
139
140     /*
141      * verify SNP variant feature(s) computed and added to protein
142      * first codon AGC varies to ACC giving S/T
143      */
144     DBRefEntry[] dbRefs = al.getSequenceAt(1).getDBRefs();
145     SequenceI peptide = null;
146     for (DBRefEntry dbref : dbRefs)
147     {
148       if (dbref.getMap().getMap().getFromRatio() == 3)
149       {
150         peptide = dbref.getMap().getTo();
151       }
152     }
153     List<SequenceFeature> proteinFeatures = peptide.getSequenceFeatures();
154     assertEquals(proteinFeatures.size(), 1);
155     sf = proteinFeatures.get(0);
156     assertEquals(sf.getFeatureGroup(), "VCF");
157     assertEquals(sf.getBegin(), 1);
158     assertEquals(sf.getEnd(), 1);
159     assertEquals(sf.getType(), SequenceOntologyI.SEQUENCE_VARIANT);
160     assertEquals(sf.getDescription(), "p.Ser1Thr");
161   }
162
163   private File makeVcf() throws IOException
164   {
165     File f = File.createTempFile("Test", ".vcf");
166     f.deleteOnExit();
167     PrintWriter pw = new PrintWriter(f);
168     for (String vcfLine : VCF)
169     {
170       pw.println(vcfLine);
171     }
172     pw.close();
173     return f;
174   }
175
176   /**
177    * Make a simple alignment with one 'gene' and one 'transcript'
178    * 
179    * @return
180    */
181   private AlignmentI buildAlignment()
182   {
183     AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(FASTA,
184             DataSourceType.PASTE);
185
186     /*
187      * map gene1 sequence to chromosome (normally done when the sequence is fetched
188      * from Ensembl and transcripts computed)
189      */
190     AlignmentI alignment = af.getViewport().getAlignment();
191     SequenceI gene1 = alignment.findName("gene1");
192     int[] to = new int[] { 45051610, 45051634 };
193     int[] from = new int[] { gene1.getStart(), gene1.getEnd() };
194     gene1.setGeneLoci("human", "GRCh38", "17", new MapList(from, to, 1, 1));
195
196     /*
197      * map 'transcript1' to chromosome via 'gene1'
198      * transcript1/1-18 is gene1/3-10,15-24
199      * which is chromosome 45051612-45051619,45051624-45051633
200      */
201     to = new int[] { 45051612, 45051619, 45051624, 45051633 };
202     SequenceI transcript1 = alignment.findName("transcript1");
203     from = new int[] { transcript1.getStart(), transcript1.getEnd() };
204     transcript1.setGeneLoci("human", "GRCh38", "17", new MapList(from, to,
205             1, 1));
206
207     /*
208      * map gene2 to chromosome reverse strand
209      */
210     SequenceI gene2 = alignment.findName("gene2");
211     to = new int[] { 45051634, 45051610 };
212     from = new int[] { gene2.getStart(), gene2.getEnd() };
213     gene2.setGeneLoci("human", "GRCh38", "17", new MapList(from, to, 1, 1));
214
215     /*
216      * map 'transcript2' to chromosome via 'gene2'
217      * transcript2/1-18 is gene2/2-11,16-23
218      * which is chromosome 45051633-45051624,45051619-45051612
219      */
220     to = new int[] { 45051633, 45051624, 45051619, 45051612 };
221     SequenceI transcript2 = alignment.findName("transcript2");
222     from = new int[] { transcript2.getStart(), transcript2.getEnd() };
223     transcript2.setGeneLoci("human", "GRCh38", "17", new MapList(from, to,
224             1, 1));
225
226     /*
227      * add a protein product as a DBRef on transcript1
228      */
229     SequenceI peptide1 = new Sequence("ENSP001", "SWRECD");
230     MapList mapList = new MapList(new int[] { 1, 18 }, new int[] { 1, 6 },
231             3, 1);
232     Mapping map = new Mapping(peptide1, mapList);
233     DBRefEntry product = new DBRefEntry("", "", "ENSP001", map);
234     transcript1.addDBRef(product);
235
236     /*
237      * add a protein product as a DBRef on transcript2
238      */
239     SequenceI peptide2 = new Sequence("ENSP002", "VTLSPA");
240     mapList = new MapList(new int[] { 1, 18 }, new int[] { 1, 6 }, 3, 1);
241     map = new Mapping(peptide2, mapList);
242     product = new DBRefEntry("", "", "ENSP002", map);
243     transcript2.addDBRef(product);
244
245     /*
246      * map gene3 to chromosome 
247      */
248     SequenceI gene3 = alignment.findName("gene3");
249     to = new int[] { 45051610, 45051634 };
250     from = new int[] { gene3.getStart(), gene3.getEnd() };
251     gene3.setGeneLoci("human", "GRCh38", "5", new MapList(from, to, 1, 1));
252
253     /*
254      * map 'transcript3' to chromosome
255      */
256     SequenceI transcript3 = alignment.findName("transcript3");
257     to = new int[] { 45051612, 45051619, 45051624, 45051633 };
258     from = new int[] { transcript3.getStart(), transcript3.getEnd() };
259     transcript3.setGeneLoci("human", "GRCh38", "5", new MapList(from, to,
260             1, 1));
261
262     /*
263      * map 'transcript4' to chromosome
264      */
265     SequenceI transcript4 = alignment.findName("transcript4");
266     to = new int[] { 45051615, 45051617, 45051619, 45051632, 45051634,
267         45051634 };
268     from = new int[] { transcript4.getStart(), transcript4.getEnd() };
269     transcript4.setGeneLoci("human", "GRCh38", "5", new MapList(from, to,
270             1, 1));
271
272     /*
273      * add a protein product as a DBRef on transcript3
274      */
275     SequenceI peptide3 = new Sequence("ENSP003", "SWRECD");
276     mapList = new MapList(new int[] { 1, 18 }, new int[] { 1, 6 }, 3, 1);
277     map = new Mapping(peptide3, mapList);
278     product = new DBRefEntry("", "", "ENSP003", map);
279     transcript3.addDBRef(product);
280
281     return alignment;
282   }
283
284   /**
285    * Test with 'gene' and 'transcript' mapped to the reverse strand of the
286    * chromosome. The VCF variant positions (in forward coordinates) should get
287    * correctly located on sequence positions.
288    * 
289    * @throws IOException
290    */
291   @Test(groups = "Functional")
292   public void testDoLoad_reverseStrand() throws IOException
293   {
294     AlignmentI al = buildAlignment();
295
296     VCFLoader loader = new VCFLoader(al);
297
298     File f = makeVcf();
299
300     loader.doLoad(f.getPath(), null);
301
302     /*
303      * verify variant feature(s) added to gene2
304      * gene/1-25 maps to chromosome 45051634- reverse strand
305      * variants A/T, A/C at 45051611 and G/GA,G/C at 45051613 map to
306      * T/A, T/G and C/TC,C/G at gene positions 24 and 22 respectively
307      */
308     List<SequenceFeature> geneFeatures = al.getSequenceAt(2)
309             .getSequenceFeatures();
310     SequenceFeatures.sortFeatures(geneFeatures, true);
311     assertEquals(geneFeatures.size(), 4);
312     SequenceFeature sf = geneFeatures.get(0);
313     assertEquals(sf.getFeatureGroup(), "VCF");
314     assertEquals(sf.getBegin(), 22);
315     assertEquals(sf.getEnd(), 22);
316     assertEquals(sf.getType(), SequenceOntologyI.SEQUENCE_VARIANT);
317     assertEquals(sf.getScore(), 2.0e-03, DELTA);
318     assertEquals("C,G", sf.getValue(Gff3Helper.ALLELES));
319
320     sf = geneFeatures.get(1);
321     assertEquals(sf.getFeatureGroup(), "VCF");
322     assertEquals(sf.getBegin(), 22);
323     assertEquals(sf.getEnd(), 22);
324     assertEquals(sf.getType(), SequenceOntologyI.SEQUENCE_VARIANT);
325     assertEquals(sf.getScore(), 3.0e-03, DELTA);
326     assertEquals("C,TC", sf.getValue(Gff3Helper.ALLELES));
327
328     sf = geneFeatures.get(2);
329     assertEquals(sf.getFeatureGroup(), "VCF");
330     assertEquals(sf.getBegin(), 24);
331     assertEquals(sf.getEnd(), 24);
332     assertEquals(sf.getType(), SequenceOntologyI.SEQUENCE_VARIANT);
333     assertEquals(sf.getScore(), 4.0e-03, DELTA);
334     assertEquals("T,G", sf.getValue(Gff3Helper.ALLELES));
335
336     sf = geneFeatures.get(3);
337     assertEquals(sf.getFeatureGroup(), "VCF");
338     assertEquals(sf.getBegin(), 24);
339     assertEquals(sf.getEnd(), 24);
340     assertEquals(sf.getType(), SequenceOntologyI.SEQUENCE_VARIANT);
341     assertEquals(sf.getScore(), 5.0e-03, DELTA);
342     assertEquals("T,A", sf.getValue(Gff3Helper.ALLELES));
343
344     /*
345      * verify variant feature(s) added to transcript2
346      * variants G/GA,G/C at position 22 of gene overlap and map to
347      * C/TC,C/G at position 17 of transcript
348      */
349     List<SequenceFeature> transcriptFeatures = al.getSequenceAt(3)
350             .getSequenceFeatures();
351     assertEquals(transcriptFeatures.size(), 2);
352     sf = transcriptFeatures.get(0);
353     assertEquals(sf.getFeatureGroup(), "VCF");
354     assertEquals(sf.getBegin(), 17);
355     assertEquals(sf.getEnd(), 17);
356     assertEquals(sf.getType(), SequenceOntologyI.SEQUENCE_VARIANT);
357     assertEquals(sf.getScore(), 2.0e-03, DELTA);
358     assertEquals("C,G", sf.getValue(Gff3Helper.ALLELES));
359
360     sf = transcriptFeatures.get(1);
361     assertEquals(sf.getFeatureGroup(), "VCF");
362     assertEquals(sf.getBegin(), 17);
363     assertEquals(sf.getEnd(), 17);
364     assertEquals(sf.getType(), SequenceOntologyI.SEQUENCE_VARIANT);
365     assertEquals(sf.getScore(), 3.0e-03, DELTA);
366     assertEquals("C,TC", sf.getValue(Gff3Helper.ALLELES));
367
368     /*
369      * verify variant feature(s) computed and added to protein
370      * last codon GCT varies to GGT giving A/G in the last peptide position
371      */
372     DBRefEntry[] dbRefs = al.getSequenceAt(3).getDBRefs();
373     SequenceI peptide = null;
374     for (DBRefEntry dbref : dbRefs)
375     {
376       if (dbref.getMap().getMap().getFromRatio() == 3)
377       {
378         peptide = dbref.getMap().getTo();
379       }
380     }
381     List<SequenceFeature> proteinFeatures = peptide.getSequenceFeatures();
382     assertEquals(proteinFeatures.size(), 1);
383     sf = proteinFeatures.get(0);
384     assertEquals(sf.getFeatureGroup(), "VCF");
385     assertEquals(sf.getBegin(), 6);
386     assertEquals(sf.getEnd(), 6);
387     assertEquals(sf.getType(), SequenceOntologyI.SEQUENCE_VARIANT);
388     assertEquals(sf.getDescription(), "p.Ala6Gly");
389   }
390
391   /**
392    * Tests that if VEP consequence (CSQ) data is present in the VCF data, then
393    * it is added to the variant feature, but restricted where possible to the
394    * consequences for a specific transcript
395    * 
396    * @throws IOException
397    */
398   @Test(groups = "Functional")
399   public void testDoLoad_vepCsq() throws IOException
400   {
401     AlignmentI al = buildAlignment();
402
403     VCFLoader loader = new VCFLoader(al);
404
405     /*
406      * VCF data file with variants at gene3 positions
407      * 1 C/A
408      * 5 C/T
409      * 9 CGT/C (deletion)
410      * 13 C/G, C/T
411      * 17 A/AC (insertion), A/G
412      */
413     loader.doLoad("test/jalview/io/vcf/testVcf.dat", null);
414
415     /*
416      * verify variant feature(s) added to gene3
417      */
418     List<SequenceFeature> geneFeatures = al.findName("gene3")
419             .getSequenceFeatures();
420     SequenceFeatures.sortFeatures(geneFeatures, true);
421     assertEquals(geneFeatures.size(), 7);
422     SequenceFeature sf = geneFeatures.get(0);
423     assertEquals(sf.getBegin(), 1);
424     assertEquals(sf.getEnd(), 1);
425     assertEquals(sf.getScore(), 0.1f, DELTA);
426     assertEquals(sf.getValue("alleles"), "C,A");
427     // gene features include Consequence for all transcripts
428     assertEquals(((String) sf.getValue("CSQ")).split(",").length, 2);
429
430     sf = geneFeatures.get(1);
431     assertEquals(sf.getBegin(), 5);
432     assertEquals(sf.getEnd(), 5);
433     assertEquals(sf.getScore(), 0.2f, DELTA);
434     assertEquals(sf.getValue("alleles"), "C,T");
435     assertEquals(((String) sf.getValue("CSQ")).split(",").length, 2);
436
437     sf = geneFeatures.get(2);
438     assertEquals(sf.getBegin(), 9);
439     assertEquals(sf.getEnd(), 11); // deletion over 3 positions
440     assertEquals(sf.getScore(), 0.3f, DELTA);
441     assertEquals(sf.getValue("alleles"), "CGG,C");
442     assertEquals(((String) sf.getValue("CSQ")).split(",").length, 2);
443
444     sf = geneFeatures.get(3);
445     assertEquals(sf.getBegin(), 13);
446     assertEquals(sf.getEnd(), 13);
447     assertEquals(sf.getScore(), 0.5f, DELTA);
448     assertEquals(sf.getValue("alleles"), "C,T");
449     assertEquals(((String) sf.getValue("CSQ")).split(",").length, 2);
450
451     sf = geneFeatures.get(4);
452     assertEquals(sf.getBegin(), 13);
453     assertEquals(sf.getEnd(), 13);
454     assertEquals(sf.getScore(), 0.4f, DELTA);
455     assertEquals(sf.getValue("alleles"), "C,G");
456     assertEquals(((String) sf.getValue("CSQ")).split(",").length, 2);
457
458     sf = geneFeatures.get(5);
459     assertEquals(sf.getBegin(), 17);
460     assertEquals(sf.getEnd(), 17);
461     assertEquals(sf.getScore(), 0.7f, DELTA);
462     assertEquals(sf.getValue("alleles"), "A,G");
463     assertEquals(((String) sf.getValue("CSQ")).split(",").length, 2);
464
465     sf = geneFeatures.get(6);
466     assertEquals(sf.getBegin(), 17);
467     assertEquals(sf.getEnd(), 17); // insertion
468     assertEquals(sf.getScore(), 0.6f, DELTA);
469     assertEquals(sf.getValue("alleles"), "A,AC");
470     assertEquals(((String) sf.getValue("CSQ")).split(",").length, 2);
471
472     /*
473      * verify variant feature(s) added to transcript3
474      * at columns 5 (1), 17 (2), positions 3, 11
475      * note the deletion at columns 9-11 is not transferred since col 11
476      * has no mapping to transcript 3 
477      */
478     List<SequenceFeature> transcriptFeatures = al.findName("transcript3")
479             .getSequenceFeatures();
480     SequenceFeatures.sortFeatures(transcriptFeatures, true);
481     assertEquals(transcriptFeatures.size(), 3);
482     sf = transcriptFeatures.get(0);
483     assertEquals(sf.getBegin(), 3);
484     assertEquals(sf.getEnd(), 3);
485     assertEquals(sf.getScore(), 0.2f, DELTA);
486     assertEquals(sf.getValue("alleles"), "C,T");
487     // transcript features only have Consequence for that transcripts
488     assertEquals(((String) sf.getValue("CSQ")).split(",").length, 1);
489     assertTrue(sf.getValue("CSQ").toString().contains("transcript3"));
490
491     sf = transcriptFeatures.get(1);
492     assertEquals(sf.getBegin(), 11);
493     assertEquals(sf.getEnd(), 11);
494     assertEquals(sf.getScore(), 0.7f, DELTA);
495     assertEquals(sf.getValue("alleles"), "A,G");
496     assertEquals(((String) sf.getValue("CSQ")).split(",").length, 1);
497     assertTrue(sf.getValue("CSQ").toString().contains("transcript3"));
498
499     sf = transcriptFeatures.get(2);
500     assertEquals(sf.getBegin(), 11);
501     assertEquals(sf.getEnd(), 11);
502     assertEquals(sf.getScore(), 0.6f, DELTA);
503     assertEquals(sf.getValue("alleles"), "A,AC");
504     assertEquals(((String) sf.getValue("CSQ")).split(",").length, 1);
505     assertTrue(sf.getValue("CSQ").toString().contains("transcript3"));
506
507     /*
508      * verify variant feature(s) added to transcript4
509      * at columns 13 (2) and 17 (2), positions 7 and 11
510      */
511     transcriptFeatures = al.findName("transcript4").getSequenceFeatures();
512     SequenceFeatures.sortFeatures(transcriptFeatures, true);
513     assertEquals(transcriptFeatures.size(), 4);
514     sf = transcriptFeatures.get(0);
515     assertEquals(sf.getBegin(), 7);
516     assertEquals(sf.getEnd(), 7);
517     assertEquals(sf.getScore(), 0.5f, DELTA);
518     assertEquals(sf.getValue("alleles"), "C,T");
519     assertEquals(((String) sf.getValue("CSQ")).split(",").length, 1);
520     assertTrue(sf.getValue("CSQ").toString().contains("transcript4"));
521
522     sf = transcriptFeatures.get(1);
523     assertEquals(sf.getBegin(), 7);
524     assertEquals(sf.getEnd(), 7);
525     assertEquals(sf.getScore(), 0.4f, DELTA);
526     assertEquals(sf.getValue("alleles"), "C,G");
527     assertEquals(((String) sf.getValue("CSQ")).split(",").length, 1);
528     assertTrue(sf.getValue("CSQ").toString().contains("transcript4"));
529
530     sf = transcriptFeatures.get(2);
531     assertEquals(sf.getBegin(), 11);
532     assertEquals(sf.getEnd(), 11);
533     assertEquals(sf.getScore(), 0.7f, DELTA);
534     assertEquals(sf.getValue("alleles"), "A,G");
535     assertEquals(((String) sf.getValue("CSQ")).split(",").length, 1);
536     assertTrue(sf.getValue("CSQ").toString().contains("transcript4"));
537
538     sf = transcriptFeatures.get(3);
539     assertEquals(sf.getBegin(), 11);
540     assertEquals(sf.getEnd(), 11);
541     assertEquals(sf.getScore(), 0.6f, DELTA);
542     assertEquals(sf.getValue("alleles"), "A,AC");
543     assertEquals(((String) sf.getValue("CSQ")).split(",").length, 1);
544     assertTrue(sf.getValue("CSQ").toString().contains("transcript4"));
545   }
546 }