git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0da0ed9
)
JAL-2110 bug fixing and tidying for get cross-refs
author
gmungoc
<g.m.carstairs@dundee.ac.uk>
Fri, 1 Jul 2016 15:54:01 +0000
(16:54 +0100)
committer
gmungoc
<g.m.carstairs@dundee.ac.uk>
Fri, 1 Jul 2016 15:54:01 +0000
(16:54 +0100)
src/jalview/analysis/AlignmentUtils.java
patch
|
blob
|
history
src/jalview/analysis/CrossRef.java
patch
|
blob
|
history
src/jalview/datamodel/AlignedCodonFrame.java
patch
|
blob
|
history
src/jalview/gui/AlignFrame.java
patch
|
blob
|
history
src/jalview/util/DBRefUtils.java
patch
|
blob
|
history
src/jalview/ws/jws2/MsaWSThread.java
patch
|
blob
|
history
diff --git
a/src/jalview/analysis/AlignmentUtils.java
b/src/jalview/analysis/AlignmentUtils.java
index
f94d393
..
9150d62
100644
(file)
--- a/
src/jalview/analysis/AlignmentUtils.java
+++ b/
src/jalview/analysis/AlignmentUtils.java
@@
-2347,13
+2347,13
@@
public class AlignmentUtils
{
/*
* Map will hold, for each aligned column position, a map of
{
/*
* Map will hold, for each aligned column position, a map of
- * {unalignedSequence, sequenceCharacter} at that position.
+ * {unalignedSequence, characterPerSequence} at that position.
* TreeMap keeps the entries in ascending column order.
*/
Map<Integer, Map<SequenceI, Character>> map = new TreeMap<Integer, Map<SequenceI, Character>>();
/*
* TreeMap keeps the entries in ascending column order.
*/
Map<Integer, Map<SequenceI, Character>> map = new TreeMap<Integer, Map<SequenceI, Character>>();
/*
- * r any sequences that have no mapping so can't be realigned
+ * record any sequences that have no mapping so can't be realigned
*/
unmapped.addAll(unaligned.getSequences());
*/
unmapped.addAll(unaligned.getSequences());
@@
-2402,6
+2402,15
@@
public class AlignmentUtils
return false;
}
return false;
}
+ /*
+ * invert mapping if it is from unaligned to aligned sequence
+ */
+ if (seqMap.getTo() == fromSeq.getDatasetSequence())
+ {
+ seqMap = new Mapping(seq.getDatasetSequence(), seqMap.getMap()
+ .getInverse());
+ }
+
char[] fromChars = fromSeq.getSequence();
int toStart = seq.getStart();
char[] toChars = seq.getSequence();
char[] fromChars = fromSeq.getSequence();
int toStart = seq.getStart();
char[] toChars = seq.getSequence();
@@
-2435,7
+2444,8
@@
public class AlignmentUtils
* of the next character of the mapped-to sequence; stop when all
* the characters of the range have been counted
*/
* of the next character of the mapped-to sequence; stop when all
* the characters of the range have been counted
*/
- while (mappedCharPos <= range[1])
+ while (mappedCharPos <= range[1] && fromCol <= fromChars.length
+ && fromCol >= 0)
{
if (!Comparison.isGap(fromChars[fromCol - 1]))
{
{
if (!Comparison.isGap(fromChars[fromCol - 1]))
{
diff --git
a/src/jalview/analysis/CrossRef.java
b/src/jalview/analysis/CrossRef.java
index
0011e39
..
e73912d
100644
(file)
--- a/
src/jalview/analysis/CrossRef.java
+++ b/
src/jalview/analysis/CrossRef.java
@@
-357,7
+357,8
@@
public class CrossRef
{
ASequenceFetcher sftch = SequenceFetcherFactory.getSequenceFetcher();
SequenceI[] retrieved = null;
{
ASequenceFetcher sftch = SequenceFetcherFactory.getSequenceFetcher();
SequenceI[] retrieved = null;
- SequenceI dss = null;
+ SequenceI dss = seq.getDatasetSequence() == null ? seq : seq
+ .getDatasetSequence();
try
{
retrieved = sftch.getSequences(sourceRefs, !fromDna);
try
{
retrieved = sftch.getSequences(sourceRefs, !fromDna);
diff --git
a/src/jalview/datamodel/AlignedCodonFrame.java
b/src/jalview/datamodel/AlignedCodonFrame.java
index
a4b99bf
..
18aaecf
100644
(file)
--- a/
src/jalview/datamodel/AlignedCodonFrame.java
+++ b/
src/jalview/datamodel/AlignedCodonFrame.java
@@
-702,7
+702,7
@@
public class AlignedCodonFrame
}
/**
}
/**
- * Returns the first mapping found that is from 'fromSeq' to 'toSeq', or null
+ * Returns the first mapping found that is between 'fromSeq' and 'toSeq', or null
* if none found
*
* @param fromSeq
* if none found
*
* @param fromSeq
@@
-713,12
+713,17
@@
public class AlignedCodonFrame
*/
public Mapping getMappingBetween(SequenceI fromSeq, SequenceI toSeq)
{
*/
public Mapping getMappingBetween(SequenceI fromSeq, SequenceI toSeq)
{
+ SequenceI dssFrom = fromSeq.getDatasetSequence() == null ? fromSeq
+ : fromSeq.getDatasetSequence();
+ SequenceI dssTo = toSeq.getDatasetSequence() == null ? toSeq : toSeq
+ .getDatasetSequence();
+
for (SequenceToSequenceMapping mapping : mappings)
{
SequenceI from = mapping.fromSeq;
SequenceI to = mapping.mapping.to;
for (SequenceToSequenceMapping mapping : mappings)
{
SequenceI from = mapping.fromSeq;
SequenceI to = mapping.mapping.to;
- if ((from == fromSeq || from == fromSeq.getDatasetSequence())
- && (to == toSeq || to == toSeq.getDatasetSequence()))
+ if ((from == dssFrom && to == dssTo)
+ || (from == dssTo && to == dssFrom))
{
return mapping.mapping;
}
{
return mapping.mapping;
}
diff --git
a/src/jalview/gui/AlignFrame.java
b/src/jalview/gui/AlignFrame.java
index
64bdf44
..
b310ab9
100644
(file)
--- a/
src/jalview/gui/AlignFrame.java
+++ b/
src/jalview/gui/AlignFrame.java
@@
-4763,7
+4763,6
@@
public class AlignFrame extends GAlignFrame implements DropTargetListener,
AlignmentI copyAlignment = null;
final SequenceI[] sequenceSelection = AlignFrame.this.viewport
.getSequenceSelection();
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)
{
diff --git
a/src/jalview/util/DBRefUtils.java
b/src/jalview/util/DBRefUtils.java
index
ed6d860
..
d5d0cf5
100755
(executable)
--- a/
src/jalview/util/DBRefUtils.java
+++ b/
src/jalview/util/DBRefUtils.java
@@
-546,7
+546,7
@@
public class DBRefUtils
/**
* Returns the (possibly empty) list of those supplied dbrefs which have the
/**
* Returns the (possibly empty) list of those supplied dbrefs which have the
- * specified source databse
+ * specified source database, with a case-insensitive match of source name
*
* @param dbRefs
* @param source
*
* @param dbRefs
* @param source
@@
-560,7
+560,7
@@
public class DBRefUtils
{
for (DBRefEntry dbref : dbRefs)
{
{
for (DBRefEntry dbref : dbRefs)
{
- if (source.equals(dbref.getSource()))
+ if (source.equalsIgnoreCase(dbref.getSource()))
{
matches.add(dbref);
}
{
matches.add(dbref);
}
diff --git
a/src/jalview/ws/jws2/MsaWSThread.java
b/src/jalview/ws/jws2/MsaWSThread.java
index
bfae384
..
e425624
100644
(file)
--- a/
src/jalview/ws/jws2/MsaWSThread.java
+++ b/
src/jalview/ws/jws2/MsaWSThread.java
@@
-1032,6
+1032,10
@@
class MsaWSThread extends AWS2Thread implements WSClientI
// becomes null if the alignment window was closed before the alignment
// job finished.
AlignmentI copyComplement = new Alignment(complement);
// becomes null if the alignment window was closed before the alignment
// job finished.
AlignmentI copyComplement = new Alignment(complement);
+ // todo should this be done by copy constructor?
+ copyComplement.setGapCharacter(complement.getGapCharacter());
+ // share the same dataset (and the mappings it holds)
+ copyComplement.setDataset(complement.getDataset());
copyComplement.alignAs(al);
if (copyComplement.getHeight() > 0)
{
copyComplement.alignAs(al);
if (copyComplement.getHeight() > 0)
{