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());
}
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());
}
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());
}
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());
}
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());
}
Aggregations