JAL-4334 failing test using whole of Q29079 accession. Can be trimmed.
authorJames Procter <j.procter@dundee.ac.uk>
Mon, 13 Nov 2023 10:28:37 +0000 (10:28 +0000)
committerJames Procter <j.procter@dundee.ac.uk>
Mon, 13 Nov 2023 10:28:37 +0000 (10:28 +0000)
test/jalview/ws/dbsources/UniprotTest.java

index 176cddc..48f1f43 100644 (file)
@@ -34,6 +34,7 @@ import java.util.List;
 
 import org.testng.Assert;
 import org.testng.annotations.BeforeClass;
+import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 
 import jalview.datamodel.DBRefEntry;
@@ -324,4 +325,318 @@ public class UniprotTest
     ft.getVariation().clear(); // variant missing - is ignored
     assertEquals("Hello", Uniprot.getDescription(ft));
   }
+
+  @DataProvider
+  public Object[][] problemEntries()
+  {
+    return new Object[][] {
+        new Object[]
+        { new String(
+                "<uniprot xmlns=\"http://uniprot.org/uniprot\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://uniprot.org/uniprot http://www.uniprot.org/docs/uniprot.xsd\">\n"
+                        + "<entry xmlns=\"http://uniprot.org/uniprot\" dataset=\"Swiss-Prot\" created=\"1997-11-01\" modified=\"2023-09-13\" version=\"103\">\n"
+                        + "<accession>Q29079</accession>\n"
+                        + "<accession>Q29017</accession>\n"
+                        + "<name>PAG2_PIG</name>\n" + "<protein>\n"
+                        + "<recommendedName>\n"
+                        + "<fullName>Pregnancy-associated glycoprotein 2</fullName>\n"
+                        + "<shortName>PAG 2</shortName>\n"
+                        + "<ecNumber>3.4.23.-</ecNumber>\n"
+                        + "</recommendedName>\n" + "</protein>\n"
+                        + "<gene>\n"
+                        + "<name type=\"primary\">PAG2</name>\n"
+                        + "</gene>\n" + "<organism>\n"
+                        + "<name type=\"scientific\">Sus scrofa</name>\n"
+                        + "<name type=\"common\">Pig</name>\n"
+                        + "<dbReference type=\"NCBI Taxonomy\" id=\"9823\"/>\n"
+                        + "<lineage>\n" + "<taxon>Eukaryota</taxon>\n"
+                        + "<taxon>Metazoa</taxon>\n"
+                        + "<taxon>Chordata</taxon>\n"
+                        + "<taxon>Craniata</taxon>\n"
+                        + "<taxon>Vertebrata</taxon>\n"
+                        + "<taxon>Euteleostomi</taxon>\n"
+                        + "<taxon>Mammalia</taxon>\n"
+                        + "<taxon>Eutheria</taxon>\n"
+                        + "<taxon>Laurasiatheria</taxon>\n"
+                        + "<taxon>Artiodactyla</taxon>\n"
+                        + "<taxon>Suina</taxon>\n"
+                        + "<taxon>Suidae</taxon>\n" + "<taxon>Sus</taxon>\n"
+                        + "</lineage>\n" + "</organism>\n"
+                        + "<reference key=\"1\">\n"
+                        + "<citation type=\"journal article\" date=\"1995\" name=\"Biol. Reprod.\" volume=\"53\" first=\"21\" last=\"28\">\n"
+                        + "<title>Porcine pregnancy-associated glycoproteins: new members of the aspartic proteinase gene family expressed in trophectoderm.</title>\n"
+                        + "<authorList>\n"
+                        + "<person name=\"Szafranska B.\"/>\n"
+                        + "<person name=\"Xie S.\"/>\n"
+                        + "<person name=\"Green J.\"/>\n"
+                        + "<person name=\"Roberts R.M.\"/>\n"
+                        + "</authorList>\n"
+                        + "<dbReference type=\"PubMed\" id=\"7669851\"/>\n"
+                        + "<dbReference type=\"DOI\" id=\"10.1095/biolreprod53.1.21\"/>\n"
+                        + "</citation>\n"
+                        + "<scope>NUCLEOTIDE SEQUENCE [GENOMIC DNA]</scope>\n"
+                        + "</reference>\n" + "<reference key=\"2\">\n"
+                        + "<citation type=\"journal article\" date=\"2001\" name=\"Mol. Reprod. Dev.\" volume=\"60\" first=\"137\" last=\"146\">\n"
+                        + "<title>Gene for porcine pregnancy-associated glycoprotein 2 (poPAG2): its structural organization and analysis of its promoter.</title>\n"
+                        + "<authorList>\n"
+                        + "<person name=\"Szafranska B.\"/>\n"
+                        + "<person name=\"Miura R.\"/>\n"
+                        + "<person name=\"Ghosh D.\"/>\n"
+                        + "<person name=\"Ezashi T.\"/>\n"
+                        + "<person name=\"Xie S.\"/>\n"
+                        + "<person name=\"Roberts R.M.\"/>\n"
+                        + "<person name=\"Green J.A.\"/>\n"
+                        + "</authorList>\n"
+                        + "<dbReference type=\"PubMed\" id=\"11553911\"/>\n"
+                        + "<dbReference type=\"DOI\" id=\"10.1002/mrd.1070\"/>\n"
+                        + "</citation>\n"
+                        + "<scope>NUCLEOTIDE SEQUENCE [GENOMIC DNA]</scope>\n"
+                        + "<source>\n" + "<tissue>Placenta</tissue>\n"
+                        + "</source>\n" + "</reference>\n"
+                        + "<comment type=\"subcellular location\">\n"
+                        + "<subcellularLocation>\n"
+                        + "<location>Secreted</location>\n"
+                        + "<location>Extracellular space</location>\n"
+                        + "</subcellularLocation>\n" + "</comment>\n"
+                        + "<comment type=\"tissue specificity\">\n"
+                        + "<text>Expressed throughout the chorion, with the signal localized exclusively over the trophectoderm.</text>\n"
+                        + "</comment>\n"
+                        + "<comment type=\"developmental stage\">\n"
+                        + "<text>Expression was detected at day 15, coinciding with the beginning of implantation, and continued throughout gestation.</text>\n"
+                        + "</comment>\n" + "<comment type=\"similarity\">\n"
+                        + "<text evidence=\"5\">Belongs to the peptidase A1 family.</text>\n"
+                        + "</comment>\n"
+                        + "<dbReference type=\"EC\" id=\"3.4.23.-\"/>\n"
+                        + "<dbReference type=\"EMBL\" id=\"U39763\">\n"
+                        + "<property type=\"protein sequence ID\" value=\"AAA92055.1\"/>\n"
+                        + "<property type=\"molecule type\" value=\"Genomic_DNA\"/>\n"
+                        + "</dbReference>\n"
+                        + "<dbReference type=\"EMBL\" id=\"U41421\">\n"
+                        + "<property type=\"protein sequence ID\" value=\"AAA92055.1\"/>\n"
+                        + "<property type=\"status\" value=\"JOINED\"/>\n"
+                        + "<property type=\"molecule type\" value=\"Genomic_DNA\"/>\n"
+                        + "</dbReference>\n"
+                        + "<dbReference type=\"EMBL\" id=\"U41422\">\n"
+                        + "<property type=\"protein sequence ID\" value=\"AAA92055.1\"/>\n"
+                        + "<property type=\"status\" value=\"JOINED\"/>\n"
+                        + "<property type=\"molecule type\" value=\"Genomic_DNA\"/>\n"
+                        + "</dbReference>\n"
+                        + "<dbReference type=\"EMBL\" id=\"U39199\">\n"
+                        + "<property type=\"protein sequence ID\" value=\"AAA92055.1\"/>\n"
+                        + "<property type=\"status\" value=\"JOINED\"/>\n"
+                        + "<property type=\"molecule type\" value=\"Genomic_DNA\"/>\n"
+                        + "</dbReference>\n"
+                        + "<dbReference type=\"EMBL\" id=\"U41423\">\n"
+                        + "<property type=\"protein sequence ID\" value=\"AAA92055.1\"/>\n"
+                        + "<property type=\"status\" value=\"JOINED\"/>\n"
+                        + "<property type=\"molecule type\" value=\"Genomic_DNA\"/>\n"
+                        + "</dbReference>\n"
+                        + "<dbReference type=\"EMBL\" id=\"U41424\">\n"
+                        + "<property type=\"protein sequence ID\" value=\"AAA92055.1\"/>\n"
+                        + "<property type=\"status\" value=\"JOINED\"/>\n"
+                        + "<property type=\"molecule type\" value=\"Genomic_DNA\"/>\n"
+                        + "</dbReference>\n"
+                        + "<dbReference type=\"EMBL\" id=\"U39762\">\n"
+                        + "<property type=\"protein sequence ID\" value=\"AAA92055.1\"/>\n"
+                        + "<property type=\"status\" value=\"JOINED\"/>\n"
+                        + "<property type=\"molecule type\" value=\"Genomic_DNA\"/>\n"
+                        + "</dbReference>\n"
+                        + "<dbReference type=\"EMBL\" id=\"L34361\">\n"
+                        + "<property type=\"protein sequence ID\" value=\"AAA81531.1\"/>\n"
+                        + "<property type=\"molecule type\" value=\"Genomic_DNA\"/>\n"
+                        + "</dbReference>\n"
+                        + "<dbReference type=\"PIR\" id=\"I46617\">\n"
+                        + "<property type=\"entry name\" value=\"I46617\"/>\n"
+                        + "</dbReference>\n"
+                        + "<dbReference type=\"AlphaFoldDB\" id=\"Q29079\"/>\n"
+                        + "<dbReference type=\"SMR\" id=\"Q29079\"/>\n"
+                        + "<dbReference type=\"MEROPS\" id=\"A01.051\"/>\n"
+                        + "<dbReference type=\"GlyCosmos\" id=\"Q29079\">\n"
+                        + "<property type=\"glycosylation\" value=\"2 sites, No reported glycans\"/>\n"
+                        + "</dbReference>\n"
+                        + "<dbReference type=\"InParanoid\" id=\"Q29079\"/>\n"
+                        + "<dbReference type=\"Proteomes\" id=\"UP000008227\">\n"
+                        + "<property type=\"component\" value=\"Unplaced\"/>\n"
+                        + "</dbReference>\n"
+                        + "<dbReference type=\"Proteomes\" id=\"UP000314985\">\n"
+                        + "<property type=\"component\" value=\"Unplaced\"/>\n"
+                        + "</dbReference>\n"
+                        + "<dbReference type=\"Proteomes\" id=\"UP000694570\">\n"
+                        + "<property type=\"component\" value=\"Unplaced\"/>\n"
+                        + "</dbReference>\n"
+                        + "<dbReference type=\"Proteomes\" id=\"UP000694571\">\n"
+                        + "<property type=\"component\" value=\"Unplaced\"/>\n"
+                        + "</dbReference>\n"
+                        + "<dbReference type=\"Proteomes\" id=\"UP000694720\">\n"
+                        + "<property type=\"component\" value=\"Unplaced\"/>\n"
+                        + "</dbReference>\n"
+                        + "<dbReference type=\"Proteomes\" id=\"UP000694722\">\n"
+                        + "<property type=\"component\" value=\"Unplaced\"/>\n"
+                        + "</dbReference>\n"
+                        + "<dbReference type=\"Proteomes\" id=\"UP000694723\">\n"
+                        + "<property type=\"component\" value=\"Unplaced\"/>\n"
+                        + "</dbReference>\n"
+                        + "<dbReference type=\"Proteomes\" id=\"UP000694724\">\n"
+                        + "<property type=\"component\" value=\"Unplaced\"/>\n"
+                        + "</dbReference>\n"
+                        + "<dbReference type=\"Proteomes\" id=\"UP000694725\">\n"
+                        + "<property type=\"component\" value=\"Unplaced\"/>\n"
+                        + "</dbReference>\n"
+                        + "<dbReference type=\"Proteomes\" id=\"UP000694726\">\n"
+                        + "<property type=\"component\" value=\"Unplaced\"/>\n"
+                        + "</dbReference>\n"
+                        + "<dbReference type=\"Proteomes\" id=\"UP000694727\">\n"
+                        + "<property type=\"component\" value=\"Unplaced\"/>\n"
+                        + "</dbReference>\n"
+                        + "<dbReference type=\"Proteomes\" id=\"UP000694728\">\n"
+                        + "<property type=\"component\" value=\"Unplaced\"/>\n"
+                        + "</dbReference>\n"
+                        + "<dbReference type=\"GO\" id=\"GO:0005615\">\n"
+                        + "<property type=\"term\" value=\"C:extracellular space\"/>\n"
+                        + "<property type=\"evidence\" value=\"ECO:0007669\"/>\n"
+                        + "<property type=\"project\" value=\"UniProtKB-SubCell\"/>\n"
+                        + "</dbReference>\n"
+                        + "<dbReference type=\"GO\" id=\"GO:0004190\">\n"
+                        + "<property type=\"term\" value=\"F:aspartic-type endopeptidase activity\"/>\n"
+                        + "<property type=\"evidence\" value=\"ECO:0000318\"/>\n"
+                        + "<property type=\"project\" value=\"GO_Central\"/>\n"
+                        + "</dbReference>\n"
+                        + "<dbReference type=\"GO\" id=\"GO:0006508\">\n"
+                        + "<property type=\"term\" value=\"P:proteolysis\"/>\n"
+                        + "<property type=\"evidence\" value=\"ECO:0000318\"/>\n"
+                        + "<property type=\"project\" value=\"GO_Central\"/>\n"
+                        + "</dbReference>\n"
+                        + "<dbReference type=\"Gene3D\" id=\"6.10.140.60\">\n"
+                        + "<property type=\"match status\" value=\"1\"/>\n"
+                        + "</dbReference>\n"
+                        + "<dbReference type=\"Gene3D\" id=\"2.40.70.10\">\n"
+                        + "<property type=\"entry name\" value=\"Acid Proteases\"/>\n"
+                        + "<property type=\"match status\" value=\"3\"/>\n"
+                        + "</dbReference>\n"
+                        + "<dbReference type=\"InterPro\" id=\"IPR001461\">\n"
+                        + "<property type=\"entry name\" value=\"Aspartic_peptidase_A1\"/>\n"
+                        + "</dbReference>\n"
+                        + "<dbReference type=\"InterPro\" id=\"IPR001969\">\n"
+                        + "<property type=\"entry name\" value=\"Aspartic_peptidase_AS\"/>\n"
+                        + "</dbReference>\n"
+                        + "<dbReference type=\"InterPro\" id=\"IPR012848\">\n"
+                        + "<property type=\"entry name\" value=\"Aspartic_peptidase_N\"/>\n"
+                        + "</dbReference>\n"
+                        + "<dbReference type=\"InterPro\" id=\"IPR033121\">\n"
+                        + "<property type=\"entry name\" value=\"PEPTIDASE_A1\"/>\n"
+                        + "</dbReference>\n"
+                        + "<dbReference type=\"InterPro\" id=\"IPR021109\">\n"
+                        + "<property type=\"entry name\" value=\"Peptidase_aspartic_dom_sf\"/>\n"
+                        + "</dbReference>\n"
+                        + "<dbReference type=\"PANTHER\" id=\"PTHR47966\">\n"
+                        + "<property type=\"entry name\" value=\"BETA-SITE APP-CLEAVING ENZYME, ISOFORM A-RELATED\"/>\n"
+                        + "<property type=\"match status\" value=\"1\"/>\n"
+                        + "</dbReference>\n"
+                        + "<dbReference type=\"PANTHER\" id=\"PTHR47966:SF49\">\n"
+                        + "<property type=\"entry name\" value=\"PEPSIN A-5\"/>\n"
+                        + "<property type=\"match status\" value=\"1\"/>\n"
+                        + "</dbReference>\n"
+                        + "<dbReference type=\"Pfam\" id=\"PF07966\">\n"
+                        + "<property type=\"entry name\" value=\"A1_Propeptide\"/>\n"
+                        + "<property type=\"match status\" value=\"1\"/>\n"
+                        + "</dbReference>\n"
+                        + "<dbReference type=\"Pfam\" id=\"PF00026\">\n"
+                        + "<property type=\"entry name\" value=\"Asp\"/>\n"
+                        + "<property type=\"match status\" value=\"2\"/>\n"
+                        + "</dbReference>\n"
+                        + "<dbReference type=\"PRINTS\" id=\"PR00792\">\n"
+                        + "<property type=\"entry name\" value=\"PEPSIN\"/>\n"
+                        + "</dbReference>\n"
+                        + "<dbReference type=\"SUPFAM\" id=\"SSF50630\">\n"
+                        + "<property type=\"entry name\" value=\"Acid proteases\"/>\n"
+                        + "<property type=\"match status\" value=\"2\"/>\n"
+                        + "</dbReference>\n"
+                        + "<dbReference type=\"PROSITE\" id=\"PS00141\">\n"
+                        + "<property type=\"entry name\" value=\"ASP_PROTEASE\"/>\n"
+                        + "<property type=\"match status\" value=\"2\"/>\n"
+                        + "</dbReference>\n"
+                        + "<dbReference type=\"PROSITE\" id=\"PS51767\">\n"
+                        + "<property type=\"entry name\" value=\"PEPTIDASE_A1\"/>\n"
+                        + "<property type=\"match status\" value=\"1\"/>\n"
+                        + "</dbReference>\n"
+                        + "<proteinExistence type=\"evidence at transcript level\"/>\n"
+                        + "<keyword id=\"KW-0064\">Aspartyl protease</keyword>\n"
+                        + "<keyword id=\"KW-1015\">Disulfide bond</keyword>\n"
+                        + "<keyword id=\"KW-0325\">Glycoprotein</keyword>\n"
+                        + "<keyword id=\"KW-0378\">Hydrolase</keyword>\n"
+                        + "<keyword id=\"KW-0645\">Protease</keyword>\n"
+                        + "<keyword id=\"KW-1185\">Reference proteome</keyword>\n"
+                        + "<keyword id=\"KW-0964\">Secreted</keyword>\n"
+                        + "<keyword id=\"KW-0732\">Signal</keyword>\n"
+                        + "<keyword id=\"KW-0865\">Zymogen</keyword>\n"
+                        + "<feature type=\"signal peptide\" evidence=\"2\">\n"
+                        + "<location>\n" + "<begin position=\"1\"/>\n"
+                        + "<end position=\"15\"/>\n" + "</location>\n"
+                        + "</feature>\n"
+                        + "<feature type=\"propeptide\" id=\"PRO_0000026107\" description=\"Activation peptide\" evidence=\"2\">\n"
+                        + "<location>\n" + "<begin position=\"16\"/>\n"
+                        + "<end status=\"unknown\"/>\n" + "</location>\n"
+                        + "</feature>\n"
+                        + "<feature type=\"chain\" id=\"PRO_0000026108\" description=\"Pregnancy-associated glycoprotein 2\">\n"
+                        + "<location>\n" + "<begin status=\"unknown\"/>\n"
+                        + "<end position=\"420\"/>\n" + "</location>\n"
+                        + "</feature>\n"
+                        + "<feature type=\"domain\" description=\"Peptidase A1\" evidence=\"3\">\n"
+                        + "<location>\n" + "<begin position=\"76\"/>\n"
+                        + "<end position=\"417\"/>\n" + "</location>\n"
+                        + "</feature>\n"
+                        + "<feature type=\"active site\" evidence=\"4\">\n"
+                        + "<location>\n" + "<position position=\"94\"/>\n"
+                        + "</location>\n" + "</feature>\n"
+                        + "<feature type=\"active site\" evidence=\"4\">\n"
+                        + "<location>\n" + "<position position=\"277\"/>\n"
+                        + "</location>\n" + "</feature>\n"
+                        + "<feature type=\"glycosylation site\" description=\"N-linked (GlcNAc...) asparagine\" evidence=\"2\">\n"
+                        + "<location>\n" + "<position position=\"56\"/>\n"
+                        + "</location>\n" + "</feature>\n"
+                        + "<feature type=\"glycosylation site\" description=\"N-linked (GlcNAc...) asparagine\" evidence=\"2\">\n"
+                        + "<location>\n" + "<position position=\"79\"/>\n"
+                        + "</location>\n" + "</feature>\n"
+                        + "<feature type=\"disulfide bond\" evidence=\"1\">\n"
+                        + "<location>\n" + "<begin position=\"107\"/>\n"
+                        + "<end position=\"112\"/>\n" + "</location>\n"
+                        + "</feature>\n"
+                        + "<feature type=\"disulfide bond\" evidence=\"1\">\n"
+                        + "<location>\n" + "<begin position=\"268\"/>\n"
+                        + "<end position=\"272\"/>\n" + "</location>\n"
+                        + "</feature>\n"
+                        + "<feature type=\"disulfide bond\" evidence=\"1\">\n"
+                        + "<location>\n" + "<begin position=\"341\"/>\n"
+                        + "<end position=\"376\"/>\n" + "</location>\n"
+                        + "</feature>\n"
+                        + "<feature type=\"sequence conflict\" description=\"In Ref. 1.\" evidence=\"5\" ref=\"1\">\n"
+                        + "<location>\n" + "<begin position=\"335\"/>\n"
+                        + "<end position=\"367\"/>\n" + "</location>\n"
+                        + "</feature>\n"
+                        + "<evidence type=\"ECO:0000250\" key=\"1\"/>\n"
+                        + "<evidence type=\"ECO:0000255\" key=\"2\"/>\n"
+                        + "<evidence type=\"ECO:0000255\" key=\"3\">\n"
+                        + "<source>\n"
+                        + "<dbReference type=\"PROSITE-ProRule\" id=\"PRU01103\"/>\n"
+                        + "</source>\n" + "</evidence>\n"
+                        + "<evidence type=\"ECO:0000255\" key=\"4\">\n"
+                        + "<source>\n"
+                        + "<dbReference type=\"PROSITE-ProRule\" id=\"PRU10094\"/>\n"
+                        + "</source>\n" + "</evidence>\n"
+                        + "<evidence type=\"ECO:0000305\" key=\"5\"/>\n"
+                        + "<sequence length=\"420\" mass=\"47132\" checksum=\"094153B6C1B1FCDB\" modified=\"1997-11-01\" version=\"1\" precursor=\"true\">MKWLVILGLVALSDCLVMIPLTKVKSVRESLREKGLLKNFLKEHPYNMIQNLLSKNSSHVQKFSYQPLRNYLDMVYVGNISIGTPPQQFSVVFDTGSSDLWVPSIYCKSKACVTHRSFNPSHSSTFHDRGKSIKLEYGSGKMSGFLGQDTVRIGQLTSTGQAFGLSKEETGKAFEHAIFDGILGLAYPSIAIKGTTTVIDNLKKQDQISEPVFAFYLSSDKEEGSVVMFGGVDKKYYKGDLKWVPLTQTSYWQIALDRITCRGRVIGCPRGCQAIVDTGTSMLHGPSKAVAKIHSLIKHFEKEYVVPCNARKALPDIVFTINNVDYPVPAQAYIRKYVVPCNARKALPDIVFTINNVDYPVPAQAYIRKNANNNRCYSTFEDIMDTLNQREIWILGDVFLRLYFTVYDEGQNRIGLAQAT</sequence>\n"
+                        + "</entry>\n"
+                        + "<copyright> Copyrighted by the UniProt Consortium, see https://www.uniprot.org/terms Distributed under the Creative Commons Attribution (CC BY 4.0) License </copyright>\n"
+                        + "</uniprot>") } };
+  }
+
+  @Test(groups = "Functional", dataProvider = "problemEntries")
+  public void testimportOfProblemEntries(String entry)
+  {
+    Uniprot u = new Uniprot();
+    InputStream is = new ByteArrayInputStream(entry.getBytes());
+    List<Entry> entries = u.getUniprotEntries(is);
+    assertEquals(1, entries.size());
+    SequenceI sq = u.uniprotEntryToSequence(entries.get(0));
+    assertNotNull(sq);
+  }
 }