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
Merge branch 'develop' into features/JAL-2446NCList
[jalview.git]
/
src
/
jalview
/
datamodel
/
Alignment.java
diff --git
a/src/jalview/datamodel/Alignment.java
b/src/jalview/datamodel/Alignment.java
index
8371036
..
f5e6fc7
100755
(executable)
--- a/
src/jalview/datamodel/Alignment.java
+++ b/
src/jalview/datamodel/Alignment.java
@@
-62,6
+62,8
@@
public class Alignment implements AlignmentI
HiddenSequences hiddenSequences;
HiddenSequences hiddenSequences;
+ HiddenColumns hiddenCols;
+
public Hashtable alignmentProperties;
private List<AlignedCodonFrame> codonFrameList;
public Hashtable alignmentProperties;
private List<AlignedCodonFrame> codonFrameList;
@@
-70,7
+72,8
@@
public class Alignment implements AlignmentI
{
groups = Collections.synchronizedList(new ArrayList<SequenceGroup>());
hiddenSequences = new HiddenSequences(this);
{
groups = Collections.synchronizedList(new ArrayList<SequenceGroup>());
hiddenSequences = new HiddenSequences(this);
- codonFrameList = new ArrayList<AlignedCodonFrame>();
+ hiddenCols = new HiddenColumns();
+ codonFrameList = new ArrayList<>();
nucleotide = Comparison.isNucleotide(seqs);
nucleotide = Comparison.isNucleotide(seqs);
@@
-125,7
+128,7
@@
public class Alignment implements AlignmentI
public Alignment(SeqCigar[] alseqs)
{
SequenceI[] seqs = SeqCigar.createAlignmentSequences(alseqs,
public Alignment(SeqCigar[] alseqs)
{
SequenceI[] seqs = SeqCigar.createAlignmentSequences(alseqs,
- gapCharacter, new ColumnSelection(), null);
+ gapCharacter, new HiddenColumns(), null);
initAlignment(seqs);
}
initAlignment(seqs);
}
@@
-402,7
+405,7
@@
public class Alignment implements AlignmentI
@Override
public SequenceGroup[] findAllGroups(SequenceI s)
{
@Override
public SequenceGroup[] findAllGroups(SequenceI s)
{
- ArrayList<SequenceGroup> temp = new ArrayList<SequenceGroup>();
+ ArrayList<SequenceGroup> temp = new ArrayList<>();
synchronized (groups)
{
synchronized (groups)
{
@@
-453,7
+456,7
@@
public class Alignment implements AlignmentI
return;
}
}
return;
}
}
- sg.setContext(this);
+ sg.setContext(this, true);
groups.add(sg);
}
}
groups.add(sg);
}
}
@@
-530,7
+533,7
@@
public class Alignment implements AlignmentI
}
for (SequenceGroup sg : groups)
{
}
for (SequenceGroup sg : groups)
{
- sg.setContext(null);
+ sg.setContext(null, false);
}
groups.clear();
}
}
groups.clear();
}
@@
-546,7
+549,7
@@
public class Alignment implements AlignmentI
{
removeAnnotationForGroup(g);
groups.remove(g);
{
removeAnnotationForGroup(g);
groups.remove(g);
- g.setContext(null);
+ g.setContext(null, false);
}
}
}
}
}
}
@@
-1064,21
+1067,18
@@
public class Alignment implements AlignmentI
currentSeq = currentSeq.createDatasetSequence();
}
}
currentSeq = currentSeq.createDatasetSequence();
}
}
- if (seqs.contains(currentSeq))
- {
- return;
- }
- List<SequenceI> toProcess = new ArrayList<SequenceI>();
+
+ List<SequenceI> toProcess = new ArrayList<>();
toProcess.add(currentSeq);
while (toProcess.size() > 0)
{
// use a queue ?
SequenceI curDs = toProcess.remove(0);
toProcess.add(currentSeq);
while (toProcess.size() > 0)
{
// use a queue ?
SequenceI curDs = toProcess.remove(0);
- if (seqs.contains(curDs))
+
+ if (!seqs.add(curDs))
{
continue;
}
{
continue;
}
- seqs.add(curDs);
// iterate over database references, making sure we add forward referenced
// sequences
if (curDs.getDBRefs() != null)
// iterate over database references, making sure we add forward referenced
// sequences
if (curDs.getDBRefs() != null)
@@
-1121,7
+1121,7
@@
public class Alignment implements AlignmentI
return;
}
// try to avoid using SequenceI.equals at this stage, it will be expensive
return;
}
// try to avoid using SequenceI.equals at this stage, it will be expensive
- Set<SequenceI> seqs = new LinkedIdentityHashSet<SequenceI>();
+ Set<SequenceI> seqs = new LinkedIdentityHashSet<>();
for (int i = 0; i < getHeight(); i++)
{
for (int i = 0; i < getHeight(); i++)
{
@@
-1327,6
+1327,12
@@
public class Alignment implements AlignmentI
}
@Override
}
@Override
+ public HiddenColumns getHiddenColumns()
+ {
+ return hiddenCols;
+ }
+
+ @Override
public CigarArray getCompactAlignment()
{
synchronized (sequences)
public CigarArray getCompactAlignment()
{
synchronized (sequences)
@@
-1400,7
+1406,7
@@
public class Alignment implements AlignmentI
{
return null;
}
{
return null;
}
- List<AlignedCodonFrame> cframes = new ArrayList<AlignedCodonFrame>();
+ List<AlignedCodonFrame> cframes = new ArrayList<>();
for (AlignedCodonFrame acf : getCodonFrames())
{
if (acf.involvesSequence(seq))
for (AlignedCodonFrame acf : getCodonFrames())
{
if (acf.involvesSequence(seq))
@@
-1477,7
+1483,7
@@
public class Alignment implements AlignmentI
if (sqs != null)
{
// avoid self append deadlock by
if (sqs != null)
{
// avoid self append deadlock by
- List<SequenceI> toappendsq = new ArrayList<SequenceI>();
+ List<SequenceI> toappendsq = new ArrayList<>();
synchronized (sqs)
{
for (SequenceI addedsq : sqs)
synchronized (sqs)
{
for (SequenceI addedsq : sqs)
@@
-1618,7
+1624,7
@@
public class Alignment implements AlignmentI
@Override
public Iterable<AlignmentAnnotation> findAnnotation(String calcId)
{
@Override
public Iterable<AlignmentAnnotation> findAnnotation(String calcId)
{
- List<AlignmentAnnotation> aa = new ArrayList<AlignmentAnnotation>();
+ List<AlignmentAnnotation> aa = new ArrayList<>();
AlignmentAnnotation[] alignmentAnnotation = getAlignmentAnnotation();
if (alignmentAnnotation != null)
{
AlignmentAnnotation[] alignmentAnnotation = getAlignmentAnnotation();
if (alignmentAnnotation != null)
{
@@
-1639,7
+1645,7
@@
public class Alignment implements AlignmentI
public Iterable<AlignmentAnnotation> findAnnotations(SequenceI seq,
String calcId, String label)
{
public Iterable<AlignmentAnnotation> findAnnotations(SequenceI seq,
String calcId, String label)
{
- ArrayList<AlignmentAnnotation> aa = new ArrayList<AlignmentAnnotation>();
+ ArrayList<AlignmentAnnotation> aa = new ArrayList<>();
for (AlignmentAnnotation ann : getAlignmentAnnotation())
{
if ((calcId == null || (ann.getCalcId() != null && ann.getCalcId()
for (AlignmentAnnotation ann : getAlignmentAnnotation())
{
if ((calcId == null || (ann.getCalcId() != null && ann.getCalcId()
@@
-1844,7
+1850,7
@@
public class Alignment implements AlignmentI
@Override
public Set<String> getSequenceNames()
{
@Override
public Set<String> getSequenceNames()
{
- Set<String> names = new HashSet<String>();
+ Set<String> names = new HashSet<>();
for (SequenceI seq : getSequences())
{
names.add(seq.getName());
for (SequenceI seq : getSequences())
{
names.add(seq.getName());
@@
-1944,4
+1950,10
@@
public class Alignment implements AlignmentI
}
return new int[] { startPos, endPos };
}
}
return new int[] { startPos, endPos };
}
+
+ @Override
+ public void setHiddenColumns(HiddenColumns cols)
+ {
+ hiddenCols = cols;
+ }
}
}