Search in sources :

Example 46 with SequenceVariation

use of org.nextprot.api.commons.bio.variation.prot.SequenceVariation 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 47 with SequenceVariation

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

the class SequenceVariationImplTest method testBuildDuplication.

@Test
public void testBuildDuplication() throws Exception {
    /*
        p.Ala3_Ser5dup (several amino acids): a duplication of amino acids Ala3 to Ser5 in the sequence MetGlyAlaArgSerSerHis to MetGlyAlaArgSerAlaArgSerSerHis
         */
    SequenceVariation pm = new SequenceVariationImpl.FluentBuilding().selectAminoAcidRange(AminoAcidCode.ALANINE, 3, AminoAcidCode.SERINE, 5).thenDuplicate().build();
    Assert.assertEquals(AminoAcidCode.ALANINE, pm.getVaryingSequence().getFirstAminoAcid());
    Assert.assertEquals(3, pm.getVaryingSequence().getFirstAminoAcidPos());
    Assert.assertEquals(AminoAcidCode.SERINE, pm.getVaryingSequence().getLastAminoAcid());
    Assert.assertEquals(5, pm.getVaryingSequence().getLastAminoAcidPos());
    Assert.assertTrue(pm.getSequenceChange() instanceof Duplication);
    Assert.assertEquals(5, ((Duplication) pm.getSequenceChange()).getInsertAfterPos());
}
Also used : SequenceVariation(org.nextprot.api.commons.bio.variation.prot.SequenceVariation) Test(org.junit.Test)

Example 48 with SequenceVariation

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

the class SequenceVariationImplTest method testBuildExtensionInit2.

// p.Met1Valext-12
@Test
public void testBuildExtensionInit2() throws Exception {
    SequenceVariation pm = new SequenceVariationImpl.FluentBuilding().selectAminoAcid(AminoAcidCode.METHIONINE, 1).thenInitiationExtension(-12, AminoAcidCode.VALINE).build();
    Assert.assertEquals(AminoAcidCode.METHIONINE, pm.getVaryingSequence().getFirstAminoAcid());
    Assert.assertEquals(1, pm.getVaryingSequence().getFirstAminoAcidPos());
    Assert.assertEquals(AminoAcidCode.METHIONINE, pm.getVaryingSequence().getLastAminoAcid());
    Assert.assertEquals(1, pm.getVaryingSequence().getLastAminoAcidPos());
    Assert.assertTrue(pm.getSequenceChange() instanceof ExtensionInitiation);
    Assert.assertEquals(-12, ((ExtensionInitiation) pm.getSequenceChange()).getNewPos());
    Assert.assertEquals(AminoAcidCode.VALINE, ((ExtensionInitiation) pm.getSequenceChange()).getValue());
}
Also used : SequenceVariation(org.nextprot.api.commons.bio.variation.prot.SequenceVariation) Test(org.junit.Test)

Example 49 with SequenceVariation

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

the class SequenceVariationImplTest method testBuildRangeDeletion.

@Test
public void testBuildRangeDeletion() throws Exception {
    SequenceVariation pm = new SequenceVariationImpl.FluentBuilding().selectAminoAcidRange(AminoAcidCode.LYSINE, 487, AminoAcidCode.LEUCINE, 498).thenDelete().build();
    Assert.assertEquals(AminoAcidCode.LYSINE, pm.getVaryingSequence().getFirstAminoAcid());
    Assert.assertEquals(487, pm.getVaryingSequence().getFirstAminoAcidPos());
    Assert.assertEquals(AminoAcidCode.LEUCINE, pm.getVaryingSequence().getLastAminoAcid());
    Assert.assertEquals(498, pm.getVaryingSequence().getLastAminoAcidPos());
    Assert.assertEquals(SequenceChange.Type.DELETION, pm.getSequenceChange().getType());
    Assert.assertNull(pm.getSequenceChange().getValue());
}
Also used : SequenceVariation(org.nextprot.api.commons.bio.variation.prot.SequenceVariation) Test(org.junit.Test)

Example 50 with SequenceVariation

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

the class SequenceModificationBedFormatTest method testParsing3LetterCodeAAFormat.

@Test
public void testParsing3LetterCodeAAFormat() throws Exception {
    SequenceVariation pm = format.parse("SNO-Cys54");
    Assert.assertEquals(AminoAcidCode.CYSTEINE, pm.getVaryingSequence().getFirstAminoAcid());
    Assert.assertEquals(54, pm.getVaryingSequence().getFirstAminoAcidPos());
    Assert.assertEquals(AminoAcidModification.S_NITROSATION, pm.getSequenceChange());
}
Also used : 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