Search in sources :

Example 6 with SequenceVariation

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

the class SequenceVariationImplTest method testBuildSubstitution.

@Test
public void testBuildSubstitution() throws Exception {
    SequenceVariation pm = new SequenceVariationImpl.FluentBuilding().selectAminoAcid(AminoAcidCode.ARGININE, 54).thenSubstituteWith(AminoAcidCode.CYSTEINE).build();
    Assert.assertEquals(AminoAcidCode.ARGININE, pm.getVaryingSequence().getFirstAminoAcid());
    Assert.assertEquals(54, pm.getVaryingSequence().getFirstAminoAcidPos());
    Assert.assertEquals(AminoAcidCode.ARGININE, pm.getVaryingSequence().getLastAminoAcid());
    Assert.assertEquals(54, pm.getVaryingSequence().getLastAminoAcidPos());
    Assert.assertTrue(!pm.getVaryingSequence().isMultipleAminoAcids());
    Assert.assertTrue(pm.getSequenceChange() instanceof Substitution);
    Assert.assertEquals(AminoAcidCode.CYSTEINE, pm.getSequenceChange().getValue());
}
Also used : SequenceVariation(org.nextprot.api.commons.bio.variation.prot.SequenceVariation) Test(org.junit.Test)

Example 7 with SequenceVariation

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

the class SequenceModificationBedFormatTest method testFormatWith1LetterCodeAAMod.

@Test
public void testFormatWith1LetterCodeAAMod() throws Exception {
    SequenceVariation pm = new SequenceVariationImpl.FluentBuilding().selectAminoAcid(AminoAcidCode.CYSTEINE, 54).thenAddModification(AminoAcidModification.S_NITROSATION).build();
    Assert.assertEquals("SNO-C54", format.format(pm, AminoAcidCode.CodeType.ONE_LETTER));
}
Also used : SequenceVariation(org.nextprot.api.commons.bio.variation.prot.SequenceVariation) SequenceVariationImpl(org.nextprot.api.commons.bio.variation.prot.impl.SequenceVariationImpl) Test(org.junit.Test)

Example 8 with SequenceVariation

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

the class SequenceModificationBedFormatTest method testFormatWith3LetterCodeAAMod.

@Test
public void testFormatWith3LetterCodeAAMod() throws Exception {
    SequenceVariation pm = new SequenceVariationImpl.FluentBuilding().selectAminoAcid(AminoAcidCode.CYSTEINE, 54).thenAddModification(AminoAcidModification.S_NITROSATION).build();
    Assert.assertEquals("SNO-Cys54", format.format(pm, AminoAcidCode.CodeType.THREE_LETTER));
}
Also used : SequenceVariation(org.nextprot.api.commons.bio.variation.prot.SequenceVariation) SequenceVariationImpl(org.nextprot.api.commons.bio.variation.prot.impl.SequenceVariationImpl) Test(org.junit.Test)

Example 9 with SequenceVariation

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

the class SequenceVariantHGVSExtensionFormatTest method testFormatExtensionTermCode1.

@Test
public void testFormatExtensionTermCode1() throws Exception {
    SequenceVariation pm = new SequenceVariationImpl.FluentBuilding().selectAminoAcid(AminoAcidCode.STOP, 110).thenTerminationExtension(17, AminoAcidCode.GLUTAMINE).build();
    Assert.assertEquals("p.*110Qext*17", format.format(pm));
}
Also used : SequenceVariation(org.nextprot.api.commons.bio.variation.prot.SequenceVariation) SequenceVariationImpl(org.nextprot.api.commons.bio.variation.prot.impl.SequenceVariationImpl) Test(org.junit.Test)

Example 10 with SequenceVariation

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

the class SequenceVariantHGVSExtensionFormatTest method testParseTerminationExtensionCode3.

@Test
public void testParseTerminationExtensionCode3() throws Exception {
    SequenceVariation pm = format.parse("p.Ter110Glnext*17");
    Assert.assertEquals(AminoAcidCode.STOP, pm.getVaryingSequence().getFirstAminoAcid());
    Assert.assertEquals(110, pm.getVaryingSequence().getFirstAminoAcidPos());
    Assert.assertEquals(SequenceChange.Type.EXTENSION_TERM, pm.getSequenceChange().getType());
    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)

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