import jalview.analysis.*;
-import jalview.util.*;
-
import java.util.*;
/** Data structure to hold and manipulate a multiple sequence alignment
{
Sequence ds = new Sequence(snew.getName(),
AlignSeq.extractGaps("-. ",
- snew.getSequence()),
+ snew.getSequenceAsString()),
snew.getStart(),
snew.getEnd());
{
SequenceGroup sg = (SequenceGroup) groups.elementAt(i);
- if (sg.getSequences(false).contains(s))
+ if (sg.getSequences(null).contains(s))
{
return sg;
}
for (int i = 0; i < gSize; i++)
{
SequenceGroup sg = (SequenceGroup) groups.elementAt(i);
- if(sg==null || sg.getSequences(false)==null)
+ if(sg==null || sg.getSequences(null)==null)
{
this.deleteGroup(sg);
gSize--;
continue;
}
- if (sg.getSequences(false).contains(s))
+ if (sg.getSequences(null).contains(s))
{
temp.addElement(sg);
}
{
if (!groups.contains(sg))
{
- groups.addElement(sg);
+ if(hiddenSequences.getSize()>0)
+ {
+ int i, iSize = sg.getSize();
+ for (i = 0; i < iSize; i++)
+ {
+ if (!sequences.contains(sg.getSequenceAt(i)))
+ {
+ sg.deleteSequence(sg.getSequenceAt(i), false);
+ iSize--;
+ i--;
+ }
+ }
+
+ if (sg.getSize() < 1)
+ return;
+ }
+
+ groups.addElement(sg);
}
}
for (int i = 0; i < sequences.size(); i++)
{
Sequence seq = (Sequence) sequences.elementAt(i);
- seq.setSequence( seq.getSequence().replace('.', gc) );
- seq.setSequence( seq.getSequence().replace('-', gc) );
- seq.setSequence( seq.getSequence().replace(' ', gc) );
+ seq.setSequence( seq.getSequenceAsString().replace('.', gc) );
+ seq.setSequence( seq.getSequenceAsString().replace('-', gc) );
+ seq.setSequence( seq.getSequenceAsString().replace(' ', gc) );
}
}
}
- public void adjustSequenceAnnotations()
- {
- if(annotations!=null)
- {
- for (int a = 0; a < annotations.length; a++)
- {
- if (annotations[a].sequenceRef != null)
- {
- annotations[a].adjustForAlignment();
- }
- }
- }
- }
-
/**
* DOCUMENT ME!
*
seqs[i] = new Sequence(currentSeq.getName(),
AlignSeq.extractGaps(
jalview.util.Comparison.GapChars,
- currentSeq.getSequence()
+ currentSeq.getSequenceAsString()
),
currentSeq.getStart(),
currentSeq.getEnd());
{
return hiddenSequences;
}
- SequenceI [] getVisibleAndRepresentedSeqs()
- {
- if(hiddenSequences==null || hiddenSequences.getSize()<1)
- return getSequencesArray();
-
- Vector seqs = new Vector();
- SequenceI seq;
- SequenceGroup hidden;
- for (int i = 0; i < sequences.size(); i++)
- {
- seq = (SequenceI) sequences.elementAt(i);
- seqs.addElement(seq);
- hidden = seq.getHiddenSequences();
- if(hidden!=null)
- {
- for(int j=0; j<hidden.getSize(false); j++)
- {
- seqs.addElement(hidden.getSequenceAt(j));
- }
- }
- }
- SequenceI [] result = new SequenceI[seqs.size()];
- for(int i=0; i<seqs.size(); i++)
- result[i] = (SequenceI)seqs.elementAt(i);
-
- return result;
-
- }
public CigarArray getCompactAlignment()
{