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