Search in sources :

Example 31 with SequenceVariation

use of org.nextprot.api.commons.bio.variation.prot.SequenceVariation in project nextprot-api by calipho-sib.

the class SequenceVariantHGVSParseFrameshiftTest method testParseAANonStandardFrameshift.

@Ignore
@Test
public void testParseAANonStandardFrameshift() throws Exception {
    format = new SequenceVariantHGVSFormat(ParsingMode.PERMISSIVE);
    SequenceVariation pm = format.parse("p.S1476fs*>9");
    Assert.assertEquals(AminoAcidCode.SERINE, pm.getVaryingSequence().getFirstAminoAcid());
    Assert.assertEquals(1476, pm.getVaryingSequence().getFirstAminoAcidPos());
    Assert.assertEquals(SequenceChange.Type.FRAMESHIFT, pm.getSequenceChange().getType());
    Assert.assertEquals(9, pm.getSequenceChange().getValue());
}
Also used : SequenceVariation(org.nextprot.api.commons.bio.variation.prot.SequenceVariation) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 32 with SequenceVariation

use of org.nextprot.api.commons.bio.variation.prot.SequenceVariation in project nextprot-api by calipho-sib.

the class SequenceVariantHGVSParseInsertionTest method testParseInsertionsVariants.

@Test
public void testParseInsertionsVariants() throws ParseException {
    format = new SequenceVariantHGVSFormat(ParsingMode.PERMISSIVE);
    SequenceVariation pm = format.parse("p.Met1875_Glu1876insMet");
    assertProteinSequenceVariation(pm, AminoAcidCode.METHIONINE, AminoAcidCode.GLUTAMIC_ACID, 1875);
    Assert.assertEquals(SequenceChange.Type.INSERTION, pm.getSequenceChange().getType());
    Assert.assertArrayEquals(AminoAcidCode.valueOfAminoAcidCodeSequence("M"), (AminoAcidCode[]) pm.getSequenceChange().getValue());
    Assert.assertEquals(1875, ((Insertion) pm.getSequenceChange()).getInsertAfterPos());
}
Also used : SequenceVariation(org.nextprot.api.commons.bio.variation.prot.SequenceVariation) AminoAcidCode(org.nextprot.api.commons.bio.AminoAcidCode) Test(org.junit.Test)

Example 33 with SequenceVariation

use of org.nextprot.api.commons.bio.variation.prot.SequenceVariation in project nextprot-api by calipho-sib.

the class SequenceVariantHGVSParseInsertionTest method testParseInsertion.

@Test
public void testParseInsertion() throws Exception {
    format = new SequenceVariantHGVSFormat(ParsingMode.PERMISSIVE);
    SequenceVariation pm = format.parse("p.C136_A137insGM");
    assertProteinSequenceVariation(pm, AminoAcidCode.CYSTEINE, AminoAcidCode.ALANINE, 136);
    Assert.assertEquals(SequenceChange.Type.INSERTION, pm.getSequenceChange().getType());
    Assert.assertArrayEquals(AminoAcidCode.valueOfAminoAcidCodeSequence("GM"), (AminoAcidCode[]) pm.getSequenceChange().getValue());
    Assert.assertEquals(136, ((Insertion) pm.getSequenceChange()).getInsertAfterPos());
}
Also used : SequenceVariation(org.nextprot.api.commons.bio.variation.prot.SequenceVariation) AminoAcidCode(org.nextprot.api.commons.bio.AminoAcidCode) Test(org.junit.Test)

Example 34 with SequenceVariation

use of org.nextprot.api.commons.bio.variation.prot.SequenceVariation in project nextprot-api by calipho-sib.

the class SequenceVariantHGVSParseSubstitutionTest method testParseSubstitutionStop.

@Test
public void testParseSubstitutionStop() throws Exception {
    SequenceVariation pm = format.parse("p.R54*");
    Assert.assertEquals(AminoAcidCode.ARGININE, pm.getVaryingSequence().getFirstAminoAcid());
    Assert.assertEquals(AminoAcidCode.ARGININE, pm.getVaryingSequence().getLastAminoAcid());
    Assert.assertEquals(54, pm.getVaryingSequence().getFirstAminoAcidPos());
    Assert.assertEquals(54, pm.getVaryingSequence().getLastAminoAcidPos());
    Assert.assertTrue(pm.getSequenceChange() instanceof Substitution);
    Assert.assertEquals(AminoAcidCode.STOP, pm.getSequenceChange().getValue());
}
Also used : Substitution(org.nextprot.api.commons.bio.variation.prot.impl.seqchange.Substitution) SequenceVariation(org.nextprot.api.commons.bio.variation.prot.SequenceVariation) Test(org.junit.Test)

Example 35 with SequenceVariation

use of org.nextprot.api.commons.bio.variation.prot.SequenceVariation in project nextprot-api by calipho-sib.

the class SequenceVariantHGVSParseSubstitutionTest method testParseAATerSubstitutionFixCode3.

@Test
public void testParseAATerSubstitutionFixCode3() throws Exception {
    format = new SequenceVariantHGVSFormat(ParsingMode.PERMISSIVE);
    SequenceVariation pm = format.parse("p.Ter104Glu");
    Assert.assertEquals(AminoAcidCode.STOP, pm.getVaryingSequence().getFirstAminoAcid());
    Assert.assertEquals(AminoAcidCode.STOP, pm.getVaryingSequence().getLastAminoAcid());
    Assert.assertEquals(104, pm.getVaryingSequence().getFirstAminoAcidPos());
    Assert.assertTrue(pm.getSequenceChange() instanceof Substitution);
    Assert.assertEquals(AminoAcidCode.GLUTAMIC_ACID, pm.getSequenceChange().getValue());
}
Also used : Substitution(org.nextprot.api.commons.bio.variation.prot.impl.seqchange.Substitution) SequenceVariation(org.nextprot.api.commons.bio.variation.prot.SequenceVariation) Test(org.junit.Test)

Aggregations

SequenceVariation (org.nextprot.api.commons.bio.variation.prot.SequenceVariation)88 Test (org.junit.Test)85 SequenceVariationImpl (org.nextprot.api.commons.bio.variation.prot.impl.SequenceVariationImpl)31 AminoAcidCode (org.nextprot.api.commons.bio.AminoAcidCode)18 Substitution (org.nextprot.api.commons.bio.variation.prot.impl.seqchange.Substitution)6 Ignore (org.junit.Ignore)2 Frameshift (org.nextprot.api.commons.bio.variation.prot.impl.seqchange.Frameshift)2 Isoform (org.nextprot.api.core.domain.Isoform)2 GeneMasterCodonPosition (org.nextprot.api.core.utils.seqmap.GeneMasterCodonPosition)2 SequenceFeature (org.nextprot.api.isoform.mapper.domain.SequenceFeature)1 SingleFeatureQuery (org.nextprot.api.isoform.mapper.domain.SingleFeatureQuery)1