click on the annotation row label and select
<strong>Normalise Consensus Logo</strong> to scale all columns of the
logo to the same height.
- </p>
+
+<p><strong>cDNA Consensus</strong></p>
+A <a href="../features/splitView.html">Split Frame View</a> of cDNA and Protein alignments will show the consensus for cDNA below the protein alignment.<br/>
+This may provide additional information on mutations in DNA that is not visible in the peptide alignment.
</body>
</html>
<p/></p>Coding DNA (cDNA) and its protein product can be displayed in a split view, with cDNA above and protein below. The two alignments are
linked, with these features supported:
<ul>
-<li>mouseover or scrolling of either alignment is followed by the other (unless you turn off <strong><a href="../menus/alwview.html">"View | Automatic Scrolling"</a></strong>)</li>
+<li>mouseover or scrolling of either alignment is followed by the other (unless you turn off <strong><a href="../menus/alwview.html">"View→Automatic Scrolling"</a></strong>)</li>
<li>on selecting rows, columns or regions in one alignment, the corresponding selection is made in the other</li>
-<li>sequence ordering in one alignment (using the cursor, or <strong><a href="../calculate/sorting.html">"Calculate | Sort")</a></strong> is also applied to the other</li>
+<li>sequence ordering in one alignment (using the cursor, or <strong><a href="../calculate/sorting.html">"Calculate→Sort")</a></strong> is also applied to the other</li>
<li>editing (gap insertion / deletion) in the protein alignment is reflected in the cDNA (but not vice versa)</li>
<li>on <strong><a href="../calculations/tree.html">"Calculate Tree"</a></strong> in either alignment, grouping, colouring and sorting by tree are applied to both</li>
-<li>the <strong><a href="../menus/alwformat.html">"Format | Font"</a></strong> menu option has an option 'Scale protein residues to codons'; select this option to make each protein residue
+<li>the <strong><a href="../menus/alwformat.html">"Format→Font"</a></strong> menu option has an option 'Scale protein residues to codons'; select this option to make each protein residue
the same width as a DNA codon (so the alignments 'line up' vertically)</li>
+<li>menu option <strong>"View→Protein"</strong> (in the cDNA panel) or <strong>"View→Nucleotide"</strong> (in the protein panel) allows you to show or hide the complementary alignment</li>
+<li>you can adjust panel heights by dragging the divider between them using the mouse</li>
+<li>menu options <a href="menus/alwview.html"><strong>"View→New View / Expand Views / Gather Views"</strong></a> behave as for a normal alignment window, but always create new views
+as split frames</li>
</ul>
<p>An alignment annotation row on the protein alignment shows the <strong><a href="../calculations/consensus.html">cDNA consensus</a></strong> for each peptide column.<br/>
This consensus may reveal variation in nucleotides coding for conserved protein residues.</p>
The additional options below apply to Jalview Desktop only.</p>
<p><strong><em>Translate as cDNA</em></strong></p>
-<p>Menu option <strong><a href="../menus/alwcalculate.html">"Calculate | Translate as cDNA"</a></strong> is available for a nucleotide alignment. Selecting this option shows the DNA and its
+<p>Menu option <strong><a href="../menus/alwcalculate.html">"Calculate→Translate as cDNA"</a></strong> is available for a nucleotide alignment. Selecting this option shows the DNA and its
calculated protein product in a Split Frame view.</p>
<p><strong><em>Get Cross-References</em></strong></p>
-<p>Menu option <strong><a href="../menus/alwcalculate.html">"Calculate | Get Cross-References"</a></strong> is available for fetched sequences which have cross-references to other databases.
+<p>Menu option <strong><a href="../menus/alwcalculate.html">"Calculate→Get Cross-References"</a></strong> is available for fetched sequences which have cross-references to other databases.
On selecting protein cross-references (for a cDNA alignment), or DNA xrefs (for peptide), a Split Frame view is opened showing cDNA and peptide.</p>
<p><strong><em>Realign a Split View</em></strong></p>
</ul>
</li>
</ul>
-
+
+<p><strong><em>Applet</em></strong></p>
+<p>To see a split frame view in the Jalview applet, provide these applet parameters:
+<table border="1">
+<tr><th>Parameter</th><th>Value</th><th>Description</th>
+<tr><td>file</td><td>path to an alignment file</td><td>a cDNA (or protein) alignment</td>
+<tr><td>file</td><td>path to an alignment file</td><td>a protein (or cDNA) alignment</td>
+<tr><td>enableSplitFrame</td><td>true</td><td>to enable the Split Frame feature</td>
+</table>
+<p/>If compatible sequences are present in the input alignments, Jalview will open a Split Frame view.<br/>
+If not, only the first alignment will be opened (an error message is written to the Java console).
<p><em>Split Frame Views were introduced in Jalview 2.9</em></p>
</body>
annotation which can then be used to sort the alignment via the Sort
by→Score menu.</em> <br></li>
<li><strong>Translate as cDNA</strong> (not applet)<br><em>This option is visible for nucleotide alignments.
- Selecting this option shows the DNA's calculated protein product in a new window. Note that the
+ Selecting this option shows the DNA's calculated protein product in a new <a href="../features/splitView.html">split frame</a> window. Note that the
translation is not frame- or intron-aware; it simply translates all codons in each sequence, using the
standard <a href="../misc/geneticCode.html">genetic code</a> (any incomplete final codon is discarded).
You can perform this action on the whole alignment,
or selected rows, columns, or regions.</em> <br></li>
<li><strong>Get Cross-References</strong> (not applet)<br><em>This option is visible where sequences have cross-references to
other standard databases; for example, an EMBL entry may have cross-references to one or more UNIPROT entries.
- Select the database to view all cross-referenced sequences in a new window.</em> <br></li>
+ Select the database to view all cross-referenced sequences in a new <a href="../features/splitView.html">split frame</a> window.</em> <br></li>
<li><strong>Autocalculate Consensus</strong><br> <em>For
large alignments it can be useful to deselect "Autocalculate
Consensus" when editing. This prevents the sometimes lengthy
warn.couldnt_create_sequence_fetcher_client = Could not create the sequence fetcher client. Check error logs for details.
warn.server_didnt_pass_validation = Service did not pass validation.\nCheck the Jalview Console for more details.
warn.url_must_contain = Sequence URL must contain $SEQUENCE_ID$ or a regex $SEQUENCE_ID=/<regex>/=$
+warn.urls_not_contacted = URLs that could not be contacted
+warn.urls_no_jaba = URLs without any JABA Services
info.validate_jabaws_server = Validate JabaWS Server ?\n(Look in console output for results)
label.test_server = Test Server?
info.you_want_jalview_to_find_uniprot_accessions = Do you want Jalview to find\nUniprot Accession ids for given sequence names?
@Override
public void addFromText_actionPerformed(ActionEvent e)
{
- Desktop.instance.inputTextboxMenuItem_actionPerformed(viewport);
+ Desktop.instance.inputTextboxMenuItem_actionPerformed(viewport
+ .getAlignPanel());
}
@Override
static final int yOffset = 30;
- private static final int THREE = 3;
-
private static AlignFrame currentAlignFrame;
public static jalview.ws.jws1.Discoverer discoverer;
public void run()
{
Cache.log.debug("Filechooser init thread started.");
- JalviewFileChooser chooser = new JalviewFileChooser(
+ new JalviewFileChooser(
jalview.bin.Cache.getProperty("LAST_DIRECTORY"),
jalview.io.AppletFormatAdapter.READABLE_EXTENSIONS,
jalview.io.AppletFormatAdapter.READABLE_FNAMES,
});
}
+ @Override
protected void showNews_actionPerformed(ActionEvent e)
{
showNews(showNews.isSelected());
@Override
public void run()
{
- long instance = System.currentTimeMillis();
+ long now = System.currentTimeMillis();
Desktop.instance.setProgressBar(
- MessageManager.getString("status.refreshing_news"),
- instance);
+ MessageManager.getString("status.refreshing_news"), now);
jvnews.refreshNews();
- Desktop.instance.setProgressBar(null, instance);
+ Desktop.instance.setProgressBar(null, now);
jvnews.showNews();
}
}).start();
{
}
+ @Override
public void dropActionChanged(DropTargetDragEvent evt)
{
}
* @param e
* DOCUMENT ME!
*/
+ @Override
public void inputLocalFileMenuItem_actionPerformed(AlignViewport viewport)
{
JalviewFileChooser chooser = new JalviewFileChooser(
* @param e
* DOCUMENT ME!
*/
+ @Override
public void inputURLMenuItem_actionPerformed(AlignViewport viewport)
{
// This construct allows us to have a wider textfield
}
/**
- * DOCUMENT ME!
+ * Opens the CutAndPaste window for the user to paste an alignment in to
*
- * @param e
- * DOCUMENT ME!
+ * @param viewPanel
+ * - if not null, the pasted alignment is added to the current
+ * alignment; if null, to a new alignment window
*/
- public void inputTextboxMenuItem_actionPerformed(AlignViewport viewport)
+ @Override
+ public void inputTextboxMenuItem_actionPerformed(
+ AlignmentViewPanel viewPanel)
{
CutAndPasteTransfer cap = new CutAndPasteTransfer();
-// cap.setForInput(viewport.getAlignPanel());
- cap.setForInput(null);
+ cap.setForInput(viewPanel);
Desktop.addInternalFrame(cap,
MessageManager.getString("label.cut_paste_alignmen_file"),
true, 600, 500);
/*
* Exit the program
*/
+ @Override
public void quit()
{
Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
* @param e
* DOCUMENT ME!
*/
+ @Override
public void aboutMenuItem_actionPerformed(ActionEvent e)
{
// StringBuffer message = getAboutMessage(false);
* @param e
* DOCUMENT ME!
*/
+ @Override
public void documentationMenuItem_actionPerformed(ActionEvent e)
{
try
}
}
+ @Override
public void closeAll_actionPerformed(ActionEvent e)
{
JInternalFrame[] frames = desktop.getAllFrames();
}
}
+ @Override
public void raiseRelated_actionPerformed(ActionEvent e)
{
reorderAssociatedWindows(false, false);
}
+ @Override
public void minimizeAssociated_actionPerformed(ActionEvent e)
{
reorderAssociatedWindows(true, false);
* @seejalview.jbgui.GDesktop#garbageCollect_actionPerformed(java.awt.event.
* ActionEvent)
*/
+ @Override
protected void garbageCollect_actionPerformed(ActionEvent e)
{
// We simply collect the garbage
* jalview.jbgui.GDesktop#showMemusage_actionPerformed(java.awt.event.ActionEvent
* )
*/
+ @Override
protected void showMemusage_actionPerformed(ActionEvent e)
{
desktop.showMemoryUsage(showMemusage.isSelected());
* jalview.jbgui.GDesktop#showConsole_actionPerformed(java.awt.event.ActionEvent
* )
*/
+ @Override
protected void showConsole_actionPerformed(ActionEvent e)
{
showConsole(showConsole.isSelected());
* @param e
* DOCUMENT ME!
*/
+ @Override
protected void preferences_actionPerformed(ActionEvent e)
{
new Preferences();
* @param e
* DOCUMENT ME!
*/
+ @Override
public void saveState_actionPerformed(ActionEvent e)
{
JalviewFileChooser chooser = new JalviewFileChooser(
* @param e
* DOCUMENT ME!
*/
+ @Override
public void loadState_actionPerformed(ActionEvent e)
{
JalviewFileChooser chooser = new JalviewFileChooser(
}
}
+ @Override
public void inputSequence_actionPerformed(ActionEvent e)
{
new SequenceFetcher(this);
jalview.gui.VamsasApplication v_client = null;
+ @Override
public void vamsasImport_actionPerformed(ActionEvent e)
{
if (v_client == null)
return (v_client.inSession());
}
+ @Override
public void vamsasStart_actionPerformed(ActionEvent e)
{
if (v_client == null)
.getString("label.new_vamsas_session"));
}
+ @Override
public void vamsasStop_actionPerformed(ActionEvent e)
{
if (v_client != null)
}
}
+ @Override
public void vamsasSave_actionPerformed(ActionEvent e)
{
if (v_client != null)
showMemoryUsage(showMemoryUsage);
}
- public void showMemoryUsage(boolean showMemoryUsage)
+ public void showMemoryUsage(boolean showMemory)
{
- this.showMemoryUsage = showMemoryUsage;
- if (showMemoryUsage)
+ this.showMemoryUsage = showMemory;
+ if (showMemory)
{
Thread worker = new Thread(this);
worker.start();
{
public void actionPerformed(ActionEvent e)
{
- groovyShell_actionPerformed(e);
+ groovyShell_actionPerformed();
}
});
toolsMenu.add(groovyShell);
/**
* Add Groovy Support to Jalview
*/
- public void groovyShell_actionPerformed(ActionEvent e)
+ public void groovyShell_actionPerformed()
{
// use reflection to avoid creating compilation dependency.
if (!jalview.bin.Cache.groovyJarsPresent())
if (progressBars.get(new Long(id)) != null)
{
- JPanel progressPanel = progressBars.remove(new Long(id));
+ JPanel panel = progressBars.remove(new Long(id));
if (progressBarHandlers.contains(new Long(id)))
{
progressBarHandlers.remove(new Long(id));
}
- removeProgressPanel(progressPanel);
+ removeProgressPanel(panel);
}
else
{
epsRendering.setSelectedItem(Cache.getDefault("EPS_RENDERING",
"Prompt each time"));
autoIdWidth.setSelected(Cache.getDefault("FIGURE_AUTOIDWIDTH", false));
- userIdWidth.setEnabled(autoIdWidth.isSelected());
- userIdWidthlabel.setEnabled(autoIdWidth.isSelected());
+ userIdWidth.setEnabled(!autoIdWidth.isSelected());
+ userIdWidthlabel.setEnabled(!autoIdWidth.isSelected());
Integer wi = Cache.getIntegerProperty("FIGURE_USERIDWIDTH");
userIdWidth.setText(wi == null ? "" : wi.toString());
blcjv.setSelected(Cache.getDefault("BLC_JVSUFFIX", true));
*/
package jalview.jbgui;
+import jalview.api.AlignmentViewPanel;
import jalview.util.MessageManager;
import java.awt.FlowLayout;
* @param e
* DOCUMENT ME!
*/
- protected void inputTextboxMenuItem_actionPerformed(
- jalview.gui.AlignViewport av)
+ protected void inputTextboxMenuItem_actionPerformed(AlignmentViewPanel avp)
{
}
if (getInvalidServiceUrls() != null
&& getInvalidServiceUrls().size() > 0)
{
- ermsg.append("URLs that could not be contacted: \n");
+ ermsg.append(MessageManager.getString("warn.urls_not_contacted")
+ + ": \n");
for (String svcurl : getInvalidServiceUrls())
{
if (list)
if (getUrlsWithoutServices() != null
&& getUrlsWithoutServices().size() > 0)
{
- ermsg.append("URLs without any JABA Services : \n");
+ ermsg.append(MessageManager.getString("warn.urls_no_jaba") + ": \n");
for (String svcurl : getUrlsWithoutServices())
{
if (list)
import jalview.datamodel.SequenceI;
import jalview.io.AppletFormatAdapter;
import jalview.io.FormatAdapter;
+import jalview.util.MessageManager;
import java.awt.Component;
import java.io.IOException;
testee.configureReferenceAnnotationsMenu(menu, seqs);
assertTrue(menu.isEnabled());
- String expected = "<html><style> p.ttip {width: 350; text-align: justify; word-wrap: break-word;}</style><p class=\"ttip\">Add annotations for<br/>JMOL/secondary structure<br/>PBD/Temp</p></html>";
+ String s = MessageManager.getString("label.add_annotations_for");
+ String expected = "<html><style> p.ttip {width: 350; text-align: justify; word-wrap: break-word;}</style><p class=\"ttip\">"
+ + s + "<br/>Jmol/secondary structure<br/>PDB/Temp</p></html>";
assertEquals(expected, menu.getToolTipText());
}
testee.configureReferenceAnnotationsMenu(menu, seqs);
assertTrue(menu.isEnabled());
- String expected = "<html><style> p.ttip {width: 350; text-align: justify; word-wrap: break-word;}</style><p class=\"ttip\">Add annotations for<br/>JMOL/secondary structure<br/>PBD/Temp</p></html>";
+ String s = MessageManager.getString("label.add_annotations_for");
+ String expected = "<html><style> p.ttip {width: 350; text-align: justify; word-wrap: break-word;}</style><p class=\"ttip\">"
+ + s + "<br/>Jmol/secondary structure<br/>PDB/Temp</p></html>";
assertEquals(expected, menu.getToolTipText());
}
// PDB.secondary structure on Sequence0
AlignmentAnnotation annotation = new AlignmentAnnotation(
"secondary structure", "", 0);
- annotation.setCalcId("PBD");
+ annotation.setCalcId("PDB");
seqs.get(0).getDatasetSequence().addAlignmentAnnotation(annotation);
if (addToSequence)
{
// PDB.Temp on Sequence1
annotation = new AlignmentAnnotation("Temp", "", 0);
- annotation.setCalcId("PBD");
+ annotation.setCalcId("PDB");
seqs.get(1).getDatasetSequence().addAlignmentAnnotation(annotation);
if (addToSequence)
{
// JMOL.secondary structure on Sequence0
annotation = new AlignmentAnnotation("secondary structure", "", 0);
- annotation.setCalcId("JMOL");
+ annotation.setCalcId("Jmol");
seqs.get(0).getDatasetSequence().addAlignmentAnnotation(annotation);
if (addToSequence)
{
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
import jalview.gui.AlignFrame;
-import jalview.gui.Desktop;
-import jalview.structure.StructureMapping;
-import jalview.structure.StructureSelectionManager;
import java.io.File;
AlignmentI al;
- String pdbStr = "examples/1gaq.txt";
-
String pdbId;
+ /**
+ * Ensure 'process secondary structure from PDB and add annotations' are set
+ * in preferences, and load PDB example file 1gaq
+ *
+ * @throws Exception
+ */
@BeforeMethod(alwaysRun = true)
public void setup() throws Exception
{
Cache.applicationProperties.setProperty("ADD_SS_ANN",
Boolean.TRUE.toString());
FileLoader loader = new FileLoader(false);
- AlignFrame af = loader.LoadFileWaitTillLoaded(pdbStr,
+ AlignFrame af = loader.LoadFileWaitTillLoaded("examples/1gaq.txt",
FormatAdapter.FILE);
al = af.getViewport().getAlignment();
pdbId = al.getSequenceAt(0).getDatasetSequence().getAllPDBEntries()
@Test(groups ={ "Functional" })
public void checkPDBSequenceFeatures()
{
- StructureSelectionManager ssm = StructureSelectionManager
- .getStructureSelectionManager(Desktop.instance);
- StructureMapping[] mappings = ssm.getMapping("1gaq");
- // suspect we really want to make assertions on sequence features
- // in these mappings' sequencess
/*
* 1GAQ/A
*/
@BeforeClass(alwaysRun = true)
public static void setUpBeforeClass() throws Exception
{
- jalview.bin.Jalview.main(new String[]
- { "-props",
+ jalview.bin.Jalview.main(new String[] { "-props",
"test/jalview/io/testProps.jvprops" });
}
import static org.testng.AssertJUnit.assertTrue;
import jalview.datamodel.AlignedCodonFrame;
+import jalview.datamodel.Sequence;
+import jalview.datamodel.SequenceFeature;
+import jalview.datamodel.SequenceI;
+import jalview.io.FormatAdapter;
import java.util.HashSet;
import java.util.Set;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
+import MCview.PDBfile;
+
public class StructureSelectionManagerTest
{
private StructureSelectionManager ssm;
assertTrue(ssm.seqmappings.contains(acf2));
assertTrue(ssm.seqmappings.contains(acf3));
}
+
+ /**
+ * Verify that RESNUM sequence features are present after creating a PDB
+ * mapping
+ */
+ @Test(groups = { "Functional" })
+ public void testSetMapping_seqFeatures()
+ {
+ SequenceI seq = new Sequence(
+ "1GAQ|B",
+ "ATYNVKLITPEGEVELQVPDDVYILDQAEEDGIDLPYSCRAGSCSSCAGKVVSGSVDQSDQSYLDDGQIADGWVLTCHAYPTSDVVIETHKEEELTGA");
+ StructureSelectionManager sm = new StructureSelectionManager();
+ sm.setProcessSecondaryStructure(true);
+ sm.setAddTempFacAnnot(true);
+ PDBfile pmap = sm.setMapping(true, new SequenceI[] { seq },
+ new String[] { null }, "examples/1gaq.txt",
+ FormatAdapter.FILE);
+ assertTrue(pmap != null);
+
+ assertEquals(3, pmap.getSeqs().size());
+ assertEquals("1GAQ|A", pmap.getSeqs().get(0).getName());
+ assertEquals("1GAQ|B", pmap.getSeqs().get(1).getName());
+ assertEquals("1GAQ|C", pmap.getSeqs().get(2).getName());
+
+ /*
+ * Verify a RESNUM sequence feature in the PDBfile sequence
+ */
+ SequenceFeature sf = pmap.getSeqs().get(0).getSequenceFeatures()[0];
+ assertEquals("RESNUM", sf.getType());
+ assertEquals("1gaq", sf.getFeatureGroup());
+ assertEquals("GLU: 19 1gaqA", sf.getDescription());
+
+ /*
+ * Verify a RESNUM sequence feature in the StructureSelectionManager mapped
+ * sequence
+ */
+ StructureMapping map = sm.getMapping("examples/1gaq.txt")[0];
+ sf = map.sequence.getSequenceFeatures()[0];
+ assertEquals("RESNUM", sf.getType());
+ assertEquals("1gaq", sf.getFeatureGroup());
+ assertEquals("ALA: 1 1gaqB", sf.getDescription());
+ }
}
import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.DBRefSource;
+import jalview.datamodel.FeatureProperties;
+import jalview.datamodel.SequenceFeature;
+import jalview.datamodel.SequenceI;
import jalview.util.DBRefUtils;
import jalview.ws.SequenceFetcher;
{
}
+ /**
+ * Tests that standard protein database sources include Uniprot (as the first)
+ * and also PDB. (Additional sources are dependent on available of DAS
+ * services.)
+ */
@Test(groups ={ "Functional" })
public void testStandardProtDbs()
{
srces.addAll(srcesfordb);
}
}
- DbSourceProxy uniprot = null;
+
int i = 0;
+ int uniprotPos = -1;
+ int pdbPos = -1;
// append the selected sequence sources to the default dbs
for (DbSourceProxy s : srces)
{
- if (s.getDbSource().equalsIgnoreCase(DBRefSource.UNIPROT))
+ if (s instanceof jalview.ws.dbsources.Uniprot)
{
- i++;
+ uniprotPos = i;
}
-
- if (s instanceof jalview.ws.dbsources.Uniprot)
+ if (s instanceof jalview.ws.dbsources.Pdb)
{
- uniprot = s;
- break;
+ pdbPos = i;
}
+ i++;
}
assertTrue("Failed to find Uniprot source as first source amongst "
- + srces.size() + " sources (source was at position " + i + ")",
- uniprot != null && i < 2);
+ + srces.size() + " sources (source was at position "
+ + uniprotPos + ")", uniprotPos == 0);
+ assertTrue("Failed to find PDB source amongst " + srces.size()
+ + " sources", pdbPos >= 0);
}
+ /**
+ * Tests retrieval of one entry from EMBL. Test is dependent on availability
+ * of network and the EMBL service.
+ *
+ * @throws Exception
+ */
@Test(groups =
{ "External" })
public void testEmblUniprotProductRecovery() throws Exception
{
- String retrievalId = "CAA23748"; // "V00488";
+ String retrievalId = "V00488";
DbSourceProxy embl = new SequenceFetcher().getSourceProxy(DBRefSource.EMBL).get(0);
assertNotNull("Couldn't find the EMBL retrieval client", embl);
verifyProteinNucleotideXref(retrievalId, embl);
}
+ /**
+ * Tests retrieval of one entry from EMBLCDS. Test is dependent on
+ * availability of network and the EMBLCDS service.
+ *
+ * @throws Exception
+ */
@Test(groups =
{ "External" })
public void testEmblCDSUniprotProductRecovery() throws Exception
verifyProteinNucleotideXref(retrievalId, embl);
}
+ /**
+ * Helper method to perform database retrieval and verification of results.
+ *
+ * @param retrievalId
+ * @param embl
+ * @throws Exception
+ */
private void verifyProteinNucleotideXref(String retrievalId,
DbSourceProxy embl) throws Exception
{
AlignmentI alsq = embl.getSequenceRecords(retrievalId);
assertNotNull("Couldn't find the EMBL record " + retrievalId, alsq);
assertEquals("Didn't retrieve right number of records", 1, alsq.getHeight());
- DBRefEntry[] dr = DBRefUtils.selectRefs(alsq.getSequenceAt(0).getDBRef(), DBRefSource.PROTEINSEQ);
+ SequenceI seq = alsq.getSequenceAt(0);
+ assertEquals("Wrong sequence name", embl.getDbSource() + "|"
+ + retrievalId, seq.getName());
+ SequenceFeature[] sfs = seq.getSequenceFeatures();
+ assertNotNull("Sequence features missing", sfs);
+ assertTrue(
+ "Feature not CDS",
+ FeatureProperties.isCodingFeature(embl.getDbSource(),
+ sfs[0].getType()));
+ assertEquals(embl.getDbSource(), sfs[0].getFeatureGroup());
+ DBRefEntry[] dr = DBRefUtils.selectRefs(seq.getDBRef(), DBRefSource.PROTEINSEQ);
assertNotNull(dr);
assertEquals("Expected a single Uniprot cross reference", 1, dr.length);
- assertEquals("Expected cross refernce map to be one amino acid", dr[0]
+ assertEquals("Expected cross reference map to be one amino acid", dr[0]
.getMap().getMappedWidth(), 1);
- assertEquals("Expected local refernce map to be 3 nucleotides", dr[0]
+ assertEquals("Expected local reference map to be 3 nucleotides", dr[0]
.getMap().getWidth(), 3);
AlignmentI sprods = CrossRef.findXrefSequences(alsq.getSequencesArray(), true, dr[0].getSource(), alsq.getDataset());
assertNotNull(
"Couldn't recover cross reference sequence from dataset. Was it ever added ?",
sprods);
-
-
+ assertEquals("Didn't xref right number of records", 1,
+ sprods.getHeight());
+ SequenceI proteinSeq = sprods.getSequenceAt(0);
+ assertEquals(proteinSeq.getSequenceAsString(), dr[0].getMap().getTo()
+ .getSequenceAsString());
+ assertEquals(dr[0].getSource() + "|" + dr[0].getAccessionId(),
+ proteinSeq.getName());
}
}