Search in sources :

Example 21 with AminoAcidCode

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

the class SequenceVariationImplTest method testBuildDeletionMultiAasAndInsertion1.

@Test
public void testBuildDeletionMultiAasAndInsertion1() throws Exception {
    SequenceVariation pm = new SequenceVariationImpl.FluentBuilding().selectAminoAcidRange(AminoAcidCode.LEUCINE, 330, AminoAcidCode.ALANINE, 331).thenDeleteAndInsert(AminoAcidCode.PHENYLALANINE).build();
    Assert.assertEquals(AminoAcidCode.LEUCINE, pm.getVaryingSequence().getFirstAminoAcid());
    Assert.assertEquals(330, pm.getVaryingSequence().getFirstAminoAcidPos());
    Assert.assertEquals(AminoAcidCode.ALANINE, pm.getVaryingSequence().getLastAminoAcid());
    Assert.assertEquals(331, pm.getVaryingSequence().getLastAminoAcidPos());
    Assert.assertTrue(pm.getSequenceChange() instanceof DeletionAndInsertion);
    Assert.assertArrayEquals(new AminoAcidCode[] { AminoAcidCode.PHENYLALANINE }, (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 22 with AminoAcidCode

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

the class SequenceVariationImplTest method testBuildDeletionMultiAndInsertionMulti.

@Test
public void testBuildDeletionMultiAndInsertionMulti() throws Exception {
    SequenceVariation pm = new SequenceVariationImpl.FluentBuilding().selectAminoAcidRange(AminoAcidCode.ASPARTIC_ACID, 419, AminoAcidCode.ARGININE, 420).thenDeleteAndInsert(AminoAcidCode.SERINE, AminoAcidCode.SERINE, AminoAcidCode.ASPARTIC_ACID, AminoAcidCode.GLYCINE).build();
    Assert.assertEquals(AminoAcidCode.ASPARTIC_ACID, pm.getVaryingSequence().getFirstAminoAcid());
    Assert.assertEquals(419, pm.getVaryingSequence().getFirstAminoAcidPos());
    Assert.assertEquals(AminoAcidCode.ARGININE, pm.getVaryingSequence().getLastAminoAcid());
    Assert.assertEquals(420, pm.getVaryingSequence().getLastAminoAcidPos());
    Assert.assertTrue(pm.getSequenceChange() instanceof DeletionAndInsertion);
    Assert.assertArrayEquals(new AminoAcidCode[] { AminoAcidCode.SERINE, AminoAcidCode.SERINE, AminoAcidCode.ASPARTIC_ACID, AminoAcidCode.GLYCINE }, (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 23 with AminoAcidCode

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

the class SequenceVariationImplTest method testBuildInsertion.

@Test
public void testBuildInsertion() throws Exception {
    SequenceVariation pm = new SequenceVariationImpl.FluentBuilding().selectAminoAcidRange(AminoAcidCode.LYSINE, 2, AminoAcidCode.METHIONINE, 3).thenInsert(AminoAcidCode.GLUTAMINE, AminoAcidCode.SERINE, AminoAcidCode.LYSINE).build();
    Assert.assertEquals(AminoAcidCode.LYSINE, pm.getVaryingSequence().getFirstAminoAcid());
    Assert.assertEquals(2, pm.getVaryingSequence().getFirstAminoAcidPos());
    Assert.assertEquals(AminoAcidCode.METHIONINE, pm.getVaryingSequence().getLastAminoAcid());
    Assert.assertEquals(3, pm.getVaryingSequence().getLastAminoAcidPos());
    Assert.assertTrue(pm.getSequenceChange() instanceof Insertion);
    Assert.assertEquals(2, ((Insertion) pm.getSequenceChange()).getInsertAfterPos());
    Assert.assertArrayEquals(new AminoAcidCode[] { AminoAcidCode.GLUTAMINE, AminoAcidCode.SERINE, AminoAcidCode.LYSINE }, (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 24 with AminoAcidCode

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

the class SequenceVariantHGVSParseDelinsTest method testParseAmbiguousAminoAcidsFixCALIPHOMISC568.

@Test
public void testParseAmbiguousAminoAcidsFixCALIPHOMISC568() throws Exception {
    format = new SequenceVariantHGVSFormat(ParsingMode.PERMISSIVE);
    SequenceVariation pm = format.parse("p.Phe709delinsXaaTrpXaa");
    Assert.assertEquals(AminoAcidCode.PHENYLALANINE, pm.getVaryingSequence().getFirstAminoAcid());
    Assert.assertEquals(AminoAcidCode.PHENYLALANINE, pm.getVaryingSequence().getLastAminoAcid());
    Assert.assertEquals(709, pm.getVaryingSequence().getFirstAminoAcidPos());
    Assert.assertEquals(709, pm.getVaryingSequence().getLastAminoAcidPos());
    Assert.assertEquals(SequenceChange.Type.DELETION_INSERTION, pm.getSequenceChange().getType());
    Assert.assertArrayEquals(AminoAcidCode.valueOfAminoAcidCodeSequence("XWX"), (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 25 with AminoAcidCode

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

the class SequenceVariantHGVSParseDelinsTest method testParseDeletionMultiAndInsertionMultiCode3.

@Test
public void testParseDeletionMultiAndInsertionMultiCode3() throws Exception {
    SequenceVariation pm = format.parse("p.Asp419_Arg420delinsSerSerAspGly");
    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)

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