git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-2110 avoid potential race condition where user changes selection after ‘show...
[jalview.git]
/
src
/
jalview
/
gui
/
AlignFrame.java
diff --git
a/src/jalview/gui/AlignFrame.java
b/src/jalview/gui/AlignFrame.java
index
c5fb11f
..
04cee93
100644
(file)
--- a/
src/jalview/gui/AlignFrame.java
+++ b/
src/jalview/gui/AlignFrame.java
@@
-4734,6
+4734,12
@@
public class AlignFrame extends GAlignFrame implements DropTargetListener,
AlignmentI xrefsAlignment = makeCrossReferencesAlignment(dataset,
xrefs);
AlignmentI xrefsAlignment = makeCrossReferencesAlignment(dataset,
xrefs);
+ if (!dna)
+ {
+ xrefsAlignment = AlignmentUtils.makeCdsAlignment(
+ xrefsAlignment.getSequencesArray(), dataset, sel);
+ xrefsAlignment.alignAs(alignment);
+ }
AlignFrame newFrame = new AlignFrame(xrefsAlignment, DEFAULT_WIDTH,
DEFAULT_HEIGHT);
AlignFrame newFrame = new AlignFrame(xrefsAlignment, DEFAULT_WIDTH,
DEFAULT_HEIGHT);
@@
-4761,14
+4767,11
@@
public class AlignFrame extends GAlignFrame implements DropTargetListener,
* sequences). If we are DNA, drop introns and update mappings
*/
AlignmentI copyAlignment = null;
* sequences). If we are DNA, drop introns and update mappings
*/
AlignmentI copyAlignment = null;
- final SequenceI[] sequenceSelection = AlignFrame.this.viewport
- .getSequenceSelection();
- // List<AlignedCodonFrame> cf = xrefs.getCodonFrames();
boolean copyAlignmentIsAligned = false;
if (dna)
{
boolean copyAlignmentIsAligned = false;
if (dna)
{
- copyAlignment = AlignmentUtils.makeCdsAlignment(
- sequenceSelection, dataset);
+ copyAlignment = AlignmentUtils.makeCdsAlignment(sel, dataset,
+ xrefsAlignment.getSequencesArray());
if (copyAlignment.getHeight() == 0)
{
System.err.println("Failed to make CDS alignment");
if (copyAlignment.getHeight() == 0)
{
System.err.println("Failed to make CDS alignment");
@@
-4788,8
+4791,8
@@
public class AlignFrame extends GAlignFrame implements DropTargetListener,
}
else
{
}
else
{
- copyAlignment = AlignmentUtils.makeCopyAlignment(
- sequenceSelection, xrefs.getSequencesArray());
+ copyAlignment = AlignmentUtils.makeCopyAlignment(sel,
+ xrefs.getSequencesArray(), dataset);
}
copyAlignment.setGapCharacter(AlignFrame.this.viewport
.getGapCharacter());
}
copyAlignment.setGapCharacter(AlignFrame.this.viewport
.getGapCharacter());
@@
-4822,7
+4825,7
@@
public class AlignFrame extends GAlignFrame implements DropTargetListener,
* align cdna to protein - currently only if
* fetching and aligning Ensembl transcripts!
*/
* align cdna to protein - currently only if
* fetching and aligning Ensembl transcripts!
*/
- if (DBRefSource.ENSEMBL.equalsIgnoreCase(source))
+ if (dna && DBRefSource.ENSEMBL.equalsIgnoreCase(source))
{
copyAlignment.alignAs(xrefsAlignment);
}
{
copyAlignment.alignAs(xrefsAlignment);
}
@@
-4881,6
+4884,8
@@
public class AlignFrame extends GAlignFrame implements DropTargetListener,
* Makes an alignment containing the given sequences, and adds them to the
* given dataset, which is also set as the dataset for the new alignment
*
* Makes an alignment containing the given sequences, and adds them to the
* given dataset, which is also set as the dataset for the new alignment
*
+ * TODO: refactor to DatasetI method
+ *
* @param dataset
* @param seqs
* @return
* @param dataset
* @param seqs
* @return
@@
-5950,8
+5955,13
@@
public class AlignFrame extends GAlignFrame implements DropTargetListener,
protected void setAnnotationsVisibility(boolean visible,
boolean forSequences, boolean forAlignment)
{
protected void setAnnotationsVisibility(boolean visible,
boolean forSequences, boolean forAlignment)
{
- for (AlignmentAnnotation aa : alignPanel.getAlignment()
- .getAlignmentAnnotation())
+ AlignmentAnnotation[] anns = alignPanel.getAlignment()
+ .getAlignmentAnnotation();
+ if (anns == null)
+ {
+ return;
+ }
+ for (AlignmentAnnotation aa : anns)
{
/*
* don't display non-positional annotations on an alignment
{
/*
* don't display non-positional annotations on an alignment