Search in sources :

Example 81 with SequenceVariation

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

the class SequenceVariantHGVSParseDelinsTest method testParseDeletionMultiAasAndInsertion1.

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

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

the class SequenceVariantHGVSParseDuplicationTest method testParseSimpleDuplication.

@Test
public void testParseSimpleDuplication() throws ParseException {
    SequenceVariation duplication = format.parse("p.Val417dup");
    Assert.assertEquals(AminoAcidCode.VALINE, duplication.getVaryingSequence().getFirstAminoAcid());
    Assert.assertEquals(AminoAcidCode.VALINE, duplication.getVaryingSequence().getLastAminoAcid());
    Assert.assertEquals(417, duplication.getVaryingSequence().getFirstAminoAcidPos());
    Assert.assertEquals(417, duplication.getVaryingSequence().getLastAminoAcidPos());
    Assert.assertEquals(SequenceChange.Type.DUPLICATION, duplication.getSequenceChange().getType());
    Assert.assertEquals(417, duplication.getSequenceChange().getValue());
}
Also used : SequenceVariation(org.nextprot.api.commons.bio.variation.prot.SequenceVariation) Test(org.junit.Test)

Example 83 with SequenceVariation

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

the class SequenceVariantHGVSParseFrameshiftTest method testParseFrameshift.

@Test
public void testParseFrameshift() throws Exception {
    SequenceVariation pm = format.parse("p.M682Afs*2");
    Assert.assertEquals(AminoAcidCode.METHIONINE, pm.getVaryingSequence().getFirstAminoAcid());
    Assert.assertEquals(682, pm.getVaryingSequence().getFirstAminoAcidPos());
    Assert.assertEquals(SequenceChange.Type.FRAMESHIFT, pm.getSequenceChange().getType());
    Assert.assertEquals(AminoAcidCode.ALANINE, ((Frameshift.Change) pm.getSequenceChange().getValue()).getChangedAminoAcid());
    Assert.assertEquals(2, ((Frameshift.Change) pm.getSequenceChange().getValue()).getNewTerminationPosition());
}
Also used : Frameshift(org.nextprot.api.commons.bio.variation.prot.impl.seqchange.Frameshift) SequenceVariation(org.nextprot.api.commons.bio.variation.prot.SequenceVariation) Test(org.junit.Test)

Example 84 with SequenceVariation

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

the class SequenceVariantHGVSParseFrameshiftTest method testParseFrameshiftCode3.

@Test
public void testParseFrameshiftCode3() throws Exception {
    SequenceVariation pm = format.parse("p.Met682AlafsTer2");
    Assert.assertEquals(AminoAcidCode.METHIONINE, pm.getVaryingSequence().getFirstAminoAcid());
    Assert.assertEquals(682, pm.getVaryingSequence().getFirstAminoAcidPos());
    Assert.assertEquals(SequenceChange.Type.FRAMESHIFT, pm.getSequenceChange().getType());
    Assert.assertEquals(AminoAcidCode.ALANINE, ((Frameshift.Change) pm.getSequenceChange().getValue()).getChangedAminoAcid());
    Assert.assertEquals(2, ((Frameshift.Change) pm.getSequenceChange().getValue()).getNewTerminationPosition());
}
Also used : Frameshift(org.nextprot.api.commons.bio.variation.prot.impl.seqchange.Frameshift) SequenceVariation(org.nextprot.api.commons.bio.variation.prot.SequenceVariation) Test(org.junit.Test)

Example 85 with SequenceVariation

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

the class SequenceVariantHGVSParseInsertionTest method testParseInsertionsVariants2.

@Test
public void testParseInsertionsVariants2() throws ParseException {
    format = new SequenceVariantHGVSFormat(ParsingMode.PERMISSIVE);
    SequenceVariation pm = format.parse("p.Lys722_Ala723insTyrLys");
    assertProteinSequenceVariation(pm, AminoAcidCode.LYSINE, AminoAcidCode.ALANINE, 722);
    Assert.assertEquals(SequenceChange.Type.INSERTION, pm.getSequenceChange().getType());
    Assert.assertArrayEquals(AminoAcidCode.valueOfAminoAcidCodeSequence("YK"), (AminoAcidCode[]) pm.getSequenceChange().getValue());
    Assert.assertEquals(722, ((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

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