Search in sources :

Example 41 with SingleFeatureQuery

use of org.nextprot.api.isoform.mapper.domain.SingleFeatureQuery in project nextprot-api by calipho-sib.

the class FeatureQuerySuccessTest method testOnSuccess.

@Test
public void testOnSuccess() throws FeatureQueryException, ParseException {
    SingleFeatureQuery query = new SingleFeatureQuery("NX_Q9UI33", "SCN11A-p.Leu1158Pro", AnnotationCategory.VARIANT.getApiTypeName());
    SequenceVariant sequenceVariant = new SequenceVariant("SCN11A-p.Leu1158Pro");
    String seqIso1 = "MDDRCYPVIFPDERNFRPFTSDSLAAIEKRIAIQKEKKKSKDQTGEVPQPRPQLDLKASRKLPKLYGDIPRELIGKPLEDLDPFYRNHKTFMVLNRKRTIYRFSAKHALFIFGPFNSIRSLAIRVSVHSLFSMFIIGTVIINCVFMATGPAKNSNSNNTDIAECVFTGIYIFEALIKILARGFILDEFSFLRDPWNWLDSIVIGIAIVSYIPGITIKLLPLRTFRVFRALKAISVVSRLKVIVGALLRSVKKLVNVIILTFFCLSIFALVGQQLFMGSLNLKCISRDCKNISNPEAYDHCFEKKENSPEFKMCGIWMGNSACSIQYECKHTKINPDYNYTNFDNFGWSFLAMFRLMTQDSWEKLYQQTLRTTGLYSVFFFIVVIFLGSFYLINLTLAVVTMAYEEQNKNVAAEIEAKEKMFQEAQQLLKEEKEALVAMGIDRSSLTSLETSYFTPKKRKLFGNKKRKSFFLRESGKDQPPGSDSDEDCQKKPQLLEQTKRLSQNLSLDHFDEHGDPLQRQRALSAVSILTITMKEQEKSQEPCLPCGENLASKYLVWNCCPQWLCVKKVLRTVMTDPFTELAITICIIINTVFLAMEHHKMEASFEKMLNIGNLVFTSIFIAEMCLKIIALDPYHYFRRGWNIFDSIVALLSFADVMNCVLQKRSWPFLRSFRVLRVFKLAKSWPTLNTLIKIIGNSVGALGSLTVVLVIVIFIFSVVGMQLFGRSFNSQKSPKLCNPTGPTVSCLRHWHMGDFWHSFLVVFRILCGEWIENMWECMQEANASSSLCVIVFILITVIGKLVVLNLFIALLLNSF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ALDRFRRAFCFVRHTLEHFCHKWCRKQNLPQQKEVAGGCAAQSKDIIPLVMEMKRGSETQEELGILTSVPKTLGVRHDWTWLAPLAEEEDDVEFSGEDNAQRITQPEPEQQKSDVTSILSECSTIDLQDGFGWLPEMVPKKQPERCLPKGFGCCFPCCSVDKRKPPWVIWWNLRKTCYQIVKHSWFESFIIFVILLSSGALIFEDVHLENQPKIQELLNCTDIIFTHIFILEMVLKWVAFGFGKYFTSAWCCLDFIIVIVSVTTLINLMELKSFRTLRALRPLRALSQFEGMKVVVNALIGAIPAILNVLLVCLIFWLVFCILGVYFFSGKFGKCINGTDSVINYTIITNKSQCESGNFSWINQKVNFDNVGNAYLALLQVATFKGWMDIIYAAVDSTEKEQQPEFESNSLGYIYFVVFIIFGSFFTLNLFIGVIIDNFNQQQKKLGGQDIFMTEEQKKYYNAMKKLGSKKPQKPIPRPLNKCQGLVFDIVTSQIFDIIIISLIILNMISMMAESYNQPKAMKSILDHLNWVFVVIFTLECLIKIFALRQYYFTNGWNLFDCVVVLLSIVSTMISTLENQEHIPFPPTLFRIVRLARIGRILRLVRAARGIRTLLFALMMSLPSLFNIGLLLFLIMFIYAILGMNWFSKVNPESGIDDIFNFKTFASSMLCLFQISTSAGWDSLLSPMLRSKESCNSSSENCHLPGIATSYFVSYIIISFLIVVNMYIAVILENFNTATEESEDPLGEDDFDIFYEVWEKFDPEATQFIKYSALSDFADALPEPLRVAKPNKYQFLVMDLPMVSEDRLHCMDILFAFTARVLGGSDGLDSMKAMMEEKFMEANPLKKLYEPIVTTTKRKEEERGAAIIQKAFRKYMMKVTKGDQGDQNDLENGPHSPLQTLCNGDLSSFGVAKGKVHCD";
    Isoform iso1 = SequenceVariantTest.mockIsoform("NX_Q9UI33-1", "Iso 1", true, seqIso1);
    Isoform iso2 = SequenceVariantTest.mockIsoform("NX_Q9UI33-2", "Iso 2", false, seqIso2);
    Isoform iso3 = SequenceVariantTest.mockIsoform("NX_Q9UI33-3", "Iso 3", false, seqIso3);
    Entry entry = SequenceVariantTest.mockEntry("NX_Q9UI33", iso1, iso2, iso3);
    SingleFeatureQuerySuccessImpl result = new SingleFeatureQuerySuccessImpl(entry, query, sequenceVariant);
    result.addMappedFeature(iso1, 1158, 1158);
    result.addMappedFeature(iso2, 1158, 1158);
    result.addMappedFeature(iso3, 1120, 1120);
    result.addUnmappedFeature(SequenceVariantTest.mockIsoform("NX_Q9UI33-23", "Iso 23", false, ""));
    Assert.assertEquals("SCN11A-iso1-p.Leu1158Pro", result.getData().get("NX_Q9UI33-1").getIsoSpecificFeature());
    Assert.assertEquals("SCN11A-iso2-p.Leu1158Pro", result.getData().get("NX_Q9UI33-2").getIsoSpecificFeature());
    Assert.assertEquals("SCN11A-iso3-p.Leu1120Pro", result.getData().get("NX_Q9UI33-3").getIsoSpecificFeature());
    Assert.assertNull(result.getData().get("NX_Q9UI33-23").getIsoSpecificFeature());
}
Also used : Entry(org.nextprot.api.core.domain.Entry) SingleFeatureQuery(org.nextprot.api.isoform.mapper.domain.SingleFeatureQuery) Isoform(org.nextprot.api.core.domain.Isoform) Test(org.junit.Test)

Aggregations

SingleFeatureQuery (org.nextprot.api.isoform.mapper.domain.SingleFeatureQuery)41 Test (org.junit.Test)36 FeatureQueryResult (org.nextprot.api.isoform.mapper.domain.FeatureQueryResult)33 IsoformMappingBaseTest (org.nextprot.api.isoform.mapper.IsoformMappingBaseTest)29 SequenceVariantTest (org.nextprot.api.isoform.mapper.domain.impl.SequenceVariantTest)6 FeatureQueryFailureImpl (org.nextprot.api.isoform.mapper.domain.impl.FeatureQueryFailureImpl)3 Isoform (org.nextprot.api.core.domain.Isoform)2 BufferedReader (java.io.BufferedReader)1 FileInputStream (java.io.FileInputStream)1 InputStreamReader (java.io.InputStreamReader)1 PrintWriter (java.io.PrintWriter)1 ParseException (java.text.ParseException)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Function (java.util.function.Function)1 Ignore (org.junit.Ignore)1 AminoAcidCode (org.nextprot.api.commons.bio.AminoAcidCode)1 SequenceVariation (org.nextprot.api.commons.bio.variation.prot.SequenceVariation)1 Entry (org.nextprot.api.core.domain.Entry)1 GeneMasterCodonPosition (org.nextprot.api.core.utils.seqmap.GeneMasterCodonPosition)1