use of org.nextprot.api.core.domain.Entry in project nextprot-api by calipho-sib.
the class IsoformUtilsTest method testGetIsoformByNameLowerCase.
@Test
public void testGetIsoformByNameLowerCase() throws Exception {
Entry entry = entryBuilderService.build(EntryConfig.newConfig("NX_P06213").withTargetIsoforms());
Assert.assertEquals("NX_P06213-1", IsoformUtils.getIsoformByName(entry, "long").getUniqueName());
}
use of org.nextprot.api.core.domain.Entry in project nextprot-api by calipho-sib.
the class IsoformUtilsTest method testGetIsoformByName.
@Test
public void testGetIsoformByName() throws Exception {
Entry entry = entryBuilderService.build(EntryConfig.newConfig("NX_P06213").withTargetIsoforms());
Assert.assertEquals("NX_P06213-1", IsoformUtils.getIsoformByName(entry, "Long").getUniqueName());
}
use of org.nextprot.api.core.domain.Entry in project nextprot-api by calipho-sib.
the class IsoformUtilsTest method testGetCanonicalIsoform.
@Test
public void testGetCanonicalIsoform() throws Exception {
Entry entry = entryBuilderService.build(EntryConfig.newConfig("NX_P01308").withTargetIsoforms());
Assert.assertNotNull(IsoformUtils.getCanonicalIsoform(entry));
Assert.assertEquals("NX_P01308-1", IsoformUtils.getCanonicalIsoform(entry).getUniqueName());
}
use of org.nextprot.api.core.domain.Entry in project nextprot-api by calipho-sib.
the class IsoformSequencePositionMapperTest method getProjectedPositionNotInFrame.
/*
NX_P38398-3, pos=1812
NX_P38398-4, pos=1812
NX_P38398-5, pos=1812
NX_P38398-6, pos=1812 -> nucleotides not in frame
NX_P38398-2, pos=1812 -> no map as expected
NX_P38398-7, pos=1812
NX_P38398-8, pos=1812
*/
// TODO: missing specifications for "nucleotides not in frame" case (see User/story "Check not in frame")
@Ignore
@Test
public void getProjectedPositionNotInFrame() throws Exception {
Entry entry = entryBuilderService.build(EntryConfig.newConfig("NX_P38398").withTargetIsoforms());
Integer position = IsoformSequencePositionMapper.getProjectedPosition(IsoformUtils.getIsoformByName(entry, "NX_P38398-1"), 1812, IsoformUtils.getIsoformByName(entry, "NX_P38398-6"));
Assert.assertNotNull(position);
}
use of org.nextprot.api.core.domain.Entry in project nextprot-api by calipho-sib.
the class AnnotationUtilsTest method exportMergedAnnotationsForBrca1AndScn9A.
// @Test
public void exportMergedAnnotationsForBrca1AndScn9A() throws FileNotFoundException {
List<String> accessions = Arrays.asList("NX_Q15858", "NX_P38398");
List<String> headers = Arrays.asList("accession", "uniqueName", "category", "annotationName", "annotationHash", "masterPosition");
PrintWriter pw = new PrintWriter("mergedBrca1AndScn9AVariants.tsv");
// write header line
pw.append(headers.stream().collect(Collectors.joining("\t"))).append("\n");
for (String accession : accessions) {
Entry entry = entryBuilderService.build(EntryConfig.newConfig(accession).withAnnotations());
List<Annotation> mergedAnnotations = entry.getAnnotations().stream().filter(a -> a.getAnnotationHash() != null).filter(a -> a.getUniqueName().startsWith("AN")).filter(a -> a.getAPICategory() == AnnotationCategory.VARIANT || a.getAPICategory() == AnnotationCategory.MUTAGENESIS).collect(Collectors.toList());
pw.append(exportAnnotationsAsTsvString(entry, mergedAnnotations));
}
pw.close();
}
Aggregations