+ * JAL-3529 - verify uniprot refs for sequences are output for sequences
+ * retrieved via Pfam
+ */
+ @Test(groups = { "Functional" })
+ public void dbrefOutput() throws Exception
+ {
+ // sequences retrieved in a Pfam domain alignment also have a PFAM database
+ // reference
+ SequenceI sq = new Sequence("FER2_SPIOL", "AASSDDDFFF");
+ sq.addDBRef(new DBRefEntry("UNIPROT", "1", "P00224"));
+ sq.addDBRef(new DBRefEntry("PFAM", "1", "P00224.1"));
+ sq.addDBRef(new DBRefEntry("PFAM", "1", "PF00111"));
+ AppletFormatAdapter af = new AppletFormatAdapter();
+ String toStockholm = af.formatSequences(FileFormat.Stockholm,
+ new Alignment(new SequenceI[]
+ { sq }), false);
+ assertTrue(toStockholm.indexOf("P00224") > -1,
+ "Couldn't locate UNIPROT Accession in generated Stockholm file.");
+ AlignmentI fromStockholm = af.readFile(toStockholm,
+ DataSourceType.PASTE, FileFormat.Stockholm);
+ SequenceI importedSeq = fromStockholm.getSequenceAt(0);
+ List<DBRefEntry> dbrefs = DBRefUtils.searchRefs(importedSeq.getDBRefs(),
+ "P00224");
+ assertTrue(dbrefs.size() == 1,
+ "Couldn't find Uniprot DBRef on re-imported sequence.");
+
+ }
+
+ /**