use of org.nextprot.api.core.domain.Isoform in project nextprot-api by calipho-sib.
the class SequenceVariantTest method testFormatIsoformSpecifiqueFeatureTypeNonIsoWithSpace.
@Test
public void testFormatIsoformSpecifiqueFeatureTypeNonIsoWithSpace() throws Exception {
SequenceVariant variant = new SequenceVariant("GTF2A1-p.Gln13Thr");
Isoform iso = mockIsoform("whatever", "37 kDa", true);
Assert.assertEquals("iso37_kDa", variant.formatIsoformFeatureName(iso));
}
use of org.nextprot.api.core.domain.Isoform in project nextprot-api by calipho-sib.
the class StatementETLBaseUnitTest method mockIsoform.
private Isoform mockIsoform(String accession, String name, boolean canonical) {
Isoform isoform = Mockito.mock(Isoform.class);
when(isoform.getUniqueName()).thenReturn(accession);
when(isoform.getIsoformAccession()).thenReturn(accession);
when(isoform.isCanonicalIsoform()).thenReturn(canonical);
EntityName entityName = Mockito.mock(EntityName.class);
when(entityName.getName()).thenReturn(name);
when(isoform.getMainEntityName()).thenReturn(entityName);
return isoform;
}
use of org.nextprot.api.core.domain.Isoform in project nextprot-api by calipho-sib.
the class StatementETLBaseUnitTest method init.
@Before
public void init() {
MockitoAnnotations.initMocks(this);
mockIsoMapperService();
List<Isoform> isoformsNX_P43246 = Arrays.asList(mockIsoform("NX_P43246-1", "Iso 1", true), mockIsoform("NX_P43246-2", "Iso 2", true));
List<Isoform> isoformsNX_P52701 = Arrays.asList(mockIsoform("NX_P52701-1", "GTBP-N", true), mockIsoform("NX_P52701-2", "GTBP-alt", false), mockIsoform("NX_P52701-3", "Iso 3", false), mockIsoform("NX_P52701-4", "Iso 4", false));
List<Isoform> isoformsNX_Q15858 = Arrays.asList(mockIsoform("NX_Q15858-1", "Iso 1", true), mockIsoform("NX_Q15858-2", "Iso 2", false), mockIsoform("NX_Q15858-3", "Iso 3", false), mockIsoform("NX_Q15858-4", "Iso 4", false));
Mockito.when(isoformService.findIsoformsByEntryName("NX_P43246")).thenReturn(isoformsNX_P43246);
Mockito.when(isoformService.findIsoformsByEntryName("NX_P52701")).thenReturn(isoformsNX_P52701);
Mockito.when(isoformService.findIsoformsByEntryName("NX_Q15858")).thenReturn(isoformsNX_Q15858);
statementETLServiceMocked = new StatementETLServiceImpl();
transformerMockedService = new StatementTranformerServiceImpl();
transformerMockedService.setIsoformMappingService(new IsoformMappingLocalMockImpl());
transformerMockedService.setIsoformService(isoformService);
statementETLServiceMocked.setStatementTransformerService(transformerMockedService);
}
use of org.nextprot.api.core.domain.Isoform in project nextprot-api by calipho-sib.
the class SequenceFeatureValidator method checkFeatureChangingAminoAcids.
/**
* Check that first and last amino-acid(s) described by the feature exists on isoform sequence at given positions
* Part of the contract a validator should implement to validate a feature on an isoform sequence.
*/
private void checkFeatureChangingAminoAcids(SequenceFeature sequenceFeature) throws FeatureQueryException {
SequenceVariation variation = sequenceFeature.getProteinVariation();
Isoform isoform = sequenceFeature.getIsoform(entry);
// do check only position for STOP code
if (sequenceFeature.getProteinVariation().getVaryingSequence().getFirstAminoAcid() == AminoAcidCode.STOP) {
checkIsoformPos(isoform, variation.getVaryingSequence().getFirstAminoAcidPos() - 1, query, false);
} else {
checkIsoformPosAndAminoAcids(isoform, variation.getVaryingSequence().getFirstAminoAcidPos(), variation.getVaryingSequence().getFirstAminoAcid().get1LetterCode(), query);
}
if (sequenceFeature.getProteinVariation().getVaryingSequence().getLastAminoAcid() == AminoAcidCode.STOP) {
checkIsoformPos(isoform, variation.getVaryingSequence().getLastAminoAcidPos() - 1, query, false);
} else {
checkIsoformPosAndAminoAcids(isoform, variation.getVaryingSequence().getLastAminoAcidPos(), variation.getVaryingSequence().getLastAminoAcid().get1LetterCode(), query);
}
}
use of org.nextprot.api.core.domain.Isoform in project nextprot-api by calipho-sib.
the class IsoformUtilsTest method createIsoforms.
private List<Isoform> createIsoforms(String... mainNames) {
List<Isoform> list = new ArrayList<>();
for (String mainName : mainNames) {
Isoform isoform = new Isoform();
EntityName name = new EntityName();
name.setName(mainName);
isoform.setMainEntityName(name);
list.add(isoform);
}
return list;
}
Aggregations