Search in sources :

Example 1 with AminoAcidCode

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

the class SequenceVariationImplTest method testBuildDeletion1AaAndInsertion1.

@Test
public void testBuildDeletion1AaAndInsertion1() throws Exception {
    SequenceVariation pm = new SequenceVariationImpl.FluentBuilding().selectAminoAcid(AminoAcidCode.THREONINE, 399).thenDeleteAndInsert(AminoAcidCode.LEUCINE).build();
    Assert.assertEquals(AminoAcidCode.THREONINE, pm.getVaryingSequence().getFirstAminoAcid());
    Assert.assertEquals(399, pm.getVaryingSequence().getFirstAminoAcidPos());
    Assert.assertEquals(AminoAcidCode.THREONINE, pm.getVaryingSequence().getLastAminoAcid());
    Assert.assertEquals(399, pm.getVaryingSequence().getLastAminoAcidPos());
    Assert.assertTrue(pm.getSequenceChange() instanceof DeletionAndInsertion);
    Assert.assertArrayEquals(new AminoAcidCode[] { AminoAcidCode.LEUCINE }, (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 2 with AminoAcidCode

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

the class SequenceVariantHGVSParseDelinsTest method testParseDeletion1AaAndInsertion1.

// /// DELETION FOLLOWED BY INSERTIONS
@Test
public void testParseDeletion1AaAndInsertion1() throws Exception {
    SequenceVariation pm = format.parse("p.T399delinsL");
    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 3 with AminoAcidCode

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

the class SequenceVariantHGVSParseDelinsTest method testParseDeletionMultiAasAndInsertion1Code3.

@Test
public void testParseDeletionMultiAasAndInsertion1Code3() throws Exception {
    SequenceVariation pm = format.parse("p.Leu330_Ala331delinsPhe");
    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 4 with AminoAcidCode

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

the class SequenceVariantHGVSParseDelinsTest method testParseAANonStandardDelins1.

@Test
public void testParseAANonStandardDelins1() throws Exception {
    format = new SequenceVariantHGVSFormat(ParsingMode.PERMISSIVE);
    SequenceVariation pm = format.parse("p.T399>L");
    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 5 with AminoAcidCode

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

the class SequenceVariantHGVSParseDelinsTest method testParseAANonStandardDelins3.

@Test
public void testParseAANonStandardDelins3() throws Exception {
    format = new SequenceVariantHGVSFormat(ParsingMode.PERMISSIVE);
    SequenceVariation pm = format.parse("p.W39_E40>*");
    Assert.assertEquals(AminoAcidCode.TRYPTOPHAN, pm.getVaryingSequence().getFirstAminoAcid());
    Assert.assertEquals(AminoAcidCode.GLUTAMIC_ACID, pm.getVaryingSequence().getLastAminoAcid());
    Assert.assertEquals(39, pm.getVaryingSequence().getFirstAminoAcidPos());
    Assert.assertEquals(40, pm.getVaryingSequence().getLastAminoAcidPos());
    Assert.assertEquals(SequenceChange.Type.DELETION_INSERTION, pm.getSequenceChange().getType());
    Assert.assertArrayEquals(AminoAcidCode.valueOfAminoAcidCodeSequence("*"), (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)

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