public class MappedFeaturesTest
{
- @Test
+ @Test(groups = "Functional")
public void testFindProteinVariants()
{
/*
* 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[]
* T>C at dna13, consequence CGT>CGC synonymous
*/
List<SequenceFeature> 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,
/*
* 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");
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<String, String> 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