Search in sources :

Example 41 with SequenceVariation

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

the class SequenceVariationImplTest method testBuildExtensionTerm.

// p.Ter110GlnextTer17
@Test
public void testBuildExtensionTerm() throws Exception {
    SequenceVariation pm = new SequenceVariationImpl.FluentBuilding().selectAminoAcid(AminoAcidCode.STOP, 110).thenTerminationExtension(17, AminoAcidCode.GLUTAMINE).build();
    Assert.assertEquals(AminoAcidCode.STOP, pm.getVaryingSequence().getFirstAminoAcid());
    Assert.assertEquals(110, pm.getVaryingSequence().getFirstAminoAcidPos());
    Assert.assertEquals(AminoAcidCode.STOP, pm.getVaryingSequence().getLastAminoAcid());
    Assert.assertEquals(110, pm.getVaryingSequence().getLastAminoAcidPos());
    Assert.assertTrue(pm.getSequenceChange() instanceof ExtensionTermination);
    Assert.assertEquals(17, ((ExtensionTermination) pm.getSequenceChange()).getNewPos());
    Assert.assertEquals(AminoAcidCode.GLUTAMINE, ((ExtensionTermination) pm.getSequenceChange()).getValue());
}
Also used : SequenceVariation(org.nextprot.api.commons.bio.variation.prot.SequenceVariation) Test(org.junit.Test)

Example 42 with SequenceVariation

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

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

the class SequenceVariationImplTest method testBuildExtensionInit1.

// p.Met1ext-5
@Test
public void testBuildExtensionInit1() throws Exception {
    SequenceVariation pm = new SequenceVariationImpl.FluentBuilding().selectAminoAcid(AminoAcidCode.METHIONINE, 1).thenInitiationExtension(-5, AminoAcidCode.METHIONINE).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(-5, ((ExtensionInitiation) pm.getSequenceChange()).getNewPos());
    Assert.assertEquals(AminoAcidCode.METHIONINE, ((ExtensionInitiation) pm.getSequenceChange()).getValue());
}
Also used : SequenceVariation(org.nextprot.api.commons.bio.variation.prot.SequenceVariation) Test(org.junit.Test)

Example 44 with SequenceVariation

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

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

the class SequenceVariationImplTest method testBuildPtm.

@Test
public void testBuildPtm() throws Exception {
    SequenceVariation pm = new SequenceVariationImpl.FluentBuilding().selectAminoAcid(AminoAcidCode.CYSTEINE, 123).thenAddModification(AminoAcidModification.S_NITROSATION).build();
    Assert.assertEquals(AminoAcidCode.CYSTEINE, pm.getVaryingSequence().getFirstAminoAcid());
    Assert.assertEquals(123, pm.getVaryingSequence().getFirstAminoAcidPos());
    Assert.assertEquals(AminoAcidCode.CYSTEINE, pm.getVaryingSequence().getLastAminoAcid());
    Assert.assertEquals(123, pm.getVaryingSequence().getLastAminoAcidPos());
    Assert.assertEquals(AminoAcidModification.S_NITROSATION, pm.getSequenceChange().getValue());
}
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