Search in sources :

Example 6 with AminoAcidCode

use of org.nextprot.api.commons.bio.AminoAcidCode in project nextprot-api by calipho-sib.

the class SequenceVariantHGVSParseDelinsTest method testParseDeletion1AaAndInsertion1Code3.

@Test
public void testParseDeletion1AaAndInsertion1Code3() throws Exception {
    SequenceVariation pm = format.parse("p.Thr399delinsLeu");
    Assert.assertEquals(AminoAcidCode.THREONINE, pm.getVaryingSequence().getFirstAminoAcid());
    Assert.assertEquals(399, pm.getVaryingSequence().getFirstAminoAcidPos());
    Assert.assertEquals(SequenceChange.Type.DELETION_INSERTION, pm.getSequenceChange().getType());
    Assert.assertArrayEquals(AminoAcidCode.valueOfAminoAcidCodeSequence("L"), (AminoAcidCode[]) pm.getSequenceChange().getValue());
}
Also used : SequenceVariation(org.nextprot.api.commons.bio.variation.prot.SequenceVariation) AminoAcidCode(org.nextprot.api.commons.bio.AminoAcidCode) Test(org.junit.Test)

Example 7 with AminoAcidCode

use of org.nextprot.api.commons.bio.AminoAcidCode in project nextprot-api by calipho-sib.

the class SequenceVariantHGVSParseDelinsTest method testParseAANonStandardDelins2.

@Test
public void testParseAANonStandardDelins2() throws Exception {
    format = new SequenceVariantHGVSFormat(ParsingMode.PERMISSIVE);
    SequenceVariation pm = format.parse("p.L330_A331>F");
    Assert.assertEquals(AminoAcidCode.LEUCINE, pm.getVaryingSequence().getFirstAminoAcid());
    Assert.assertEquals(AminoAcidCode.ALANINE, pm.getVaryingSequence().getLastAminoAcid());
    Assert.assertEquals(330, pm.getVaryingSequence().getFirstAminoAcidPos());
    Assert.assertEquals(331, pm.getVaryingSequence().getLastAminoAcidPos());
    Assert.assertEquals(SequenceChange.Type.DELETION_INSERTION, pm.getSequenceChange().getType());
    Assert.assertArrayEquals(AminoAcidCode.valueOfAminoAcidCodeSequence("F"), (AminoAcidCode[]) pm.getSequenceChange().getValue());
}
Also used : SequenceVariation(org.nextprot.api.commons.bio.variation.prot.SequenceVariation) AminoAcidCode(org.nextprot.api.commons.bio.AminoAcidCode) Test(org.junit.Test)

Example 8 with AminoAcidCode

use of org.nextprot.api.commons.bio.AminoAcidCode in project nextprot-api by calipho-sib.

the class SequenceVariantHGVSParseDelinsTest method testParseAANonStandardDelins4.

@Test
public void testParseAANonStandardDelins4() throws Exception {
    format = new SequenceVariantHGVSFormat(ParsingMode.PERMISSIVE);
    SequenceVariation pm = format.parse("p.D419_R420>SSDG");
    Assert.assertEquals(AminoAcidCode.ASPARTIC_ACID, pm.getVaryingSequence().getFirstAminoAcid());
    Assert.assertEquals(AminoAcidCode.ARGININE, pm.getVaryingSequence().getLastAminoAcid());
    Assert.assertEquals(419, pm.getVaryingSequence().getFirstAminoAcidPos());
    Assert.assertEquals(420, pm.getVaryingSequence().getLastAminoAcidPos());
    Assert.assertEquals(SequenceChange.Type.DELETION_INSERTION, pm.getSequenceChange().getType());
    Assert.assertArrayEquals(AminoAcidCode.valueOfAminoAcidCodeSequence("SSDG"), (AminoAcidCode[]) pm.getSequenceChange().getValue());
}
Also used : SequenceVariation(org.nextprot.api.commons.bio.variation.prot.SequenceVariation) AminoAcidCode(org.nextprot.api.commons.bio.AminoAcidCode) Test(org.junit.Test)

Example 9 with AminoAcidCode

use of org.nextprot.api.commons.bio.AminoAcidCode 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 10 with AminoAcidCode

use of org.nextprot.api.commons.bio.AminoAcidCode 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)

Aggregations

AminoAcidCode (org.nextprot.api.commons.bio.AminoAcidCode)28 Test (org.junit.Test)19 SequenceVariation (org.nextprot.api.commons.bio.variation.prot.SequenceVariation)18 Matcher (java.util.regex.Matcher)9 ParseException (java.text.ParseException)2 AminoAcidModification (org.nextprot.api.commons.bio.variation.prot.impl.seqchange.AminoAcidModification)1 IsoformMappingBaseTest (org.nextprot.api.isoform.mapper.IsoformMappingBaseTest)1 FeatureQueryResult (org.nextprot.api.isoform.mapper.domain.FeatureQueryResult)1 SingleFeatureQuery (org.nextprot.api.isoform.mapper.domain.SingleFeatureQuery)1