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
formatting
[jalview.git]
/
src
/
jalview
/
datamodel
/
AlignmentView.java
diff --git
a/src/jalview/datamodel/AlignmentView.java
b/src/jalview/datamodel/AlignmentView.java
index
a76e90e
..
8b86a82
100644
(file)
--- a/
src/jalview/datamodel/AlignmentView.java
+++ b/
src/jalview/datamodel/AlignmentView.java
@@
-40,6
+40,7
@@
public class AlignmentView
private SeqCigar[] sequences = null;
private int[] contigs = null;
private int width=0;
private SeqCigar[] sequences = null;
private int[] contigs = null;
private int width=0;
+ private int firstCol=0;
public AlignmentView(CigarArray seqcigararray)
{
if (!seqcigararray.isSeqCigarArray())
public AlignmentView(CigarArray seqcigararray)
{
if (!seqcigararray.isSeqCigarArray())
@@
-49,6
+50,15
@@
public class AlignmentView
sequences = seqcigararray.getSeqCigarArray();
width = seqcigararray.getWidth(); // visible width
}
sequences = seqcigararray.getSeqCigarArray();
width = seqcigararray.getWidth(); // visible width
}
+ /**
+ * Create an alignmentView where the first column corresponds with the 'firstcol' column of some reference alignment
+ * @param sdata
+ * @param firstcol
+ */
+ public AlignmentView(CigarArray sdata, int firstcol) {
+ this(sdata);
+ firstCol=firstcol;
+ }
public void setSequences(SeqCigar[] sequences)
{
public void setSequences(SeqCigar[] sequences)
{
@@
-234,8
+244,8
@@
public class AlignmentView
}
else
{
}
else
{
- alignment[s].setSequence(alignment[s].getSequence() +
- mseq[s].getSequence());
+ alignment[s].setSequence(alignment[s].getSequenceAsString() +
+ mseq[s].getSequenceAsString());
if (mseq[s].getStart() <= mseq[s].getEnd())
{
alignment[s].setEnd(mseq[s].getEnd());
if (mseq[s].getStart() <= mseq[s].getEnd())
{
alignment[s].setEnd(mseq[s].getEnd());
@@
-266,8
+276,8
@@
public class AlignmentView
}
else
{
}
else
{
- alignment[s].setSequence(alignment[s].getSequence() +
- oseq.getSequence());
+ alignment[s].setSequence(alignment[s].getSequenceAsString() +
+ oseq.getSequenceAsString());
if (oseq.getEnd() >= oseq.getStart())
{
alignment[s].setEnd(oseq.getEnd());
if (oseq.getEnd() >= oseq.getStart())
{
alignment[s].setEnd(oseq.getEnd());
@@
-293,8
+303,8
@@
public class AlignmentView
}
else
{
}
else
{
- alignment[s].setSequence(alignment[s].getSequence() +
- hseq.getSequence());
+ alignment[s].setSequence(alignment[s].getSequenceAsString() +
+ hseq.getSequenceAsString());
if (hseq.getEnd() >= hseq.getStart())
{
alignment[s].setEnd(hseq.getEnd());
if (hseq.getEnd() >= hseq.getStart())
{
alignment[s].setEnd(hseq.getEnd());
@@
-322,8
+332,8
@@
public class AlignmentView
}
else
{
}
else
{
- alignment[s].setSequence(alignment[s].getSequence() +
- mseq[s].getSequence());
+ alignment[s].setSequence(alignment[s].getSequenceAsString() +
+ mseq[s].getSequenceAsString());
if (mseq[s].getEnd() >= mseq[s].getStart())
{
alignment[s].setEnd(mseq[s].getEnd());
if (mseq[s].getEnd() >= mseq[s].getStart())
{
alignment[s].setEnd(mseq[s].getEnd());
@@
-356,8
+366,8
@@
public class AlignmentView
}
else
{
}
else
{
- alignment[s].setSequence(alignment[s].getSequence() +
- oseq.getSequence());
+ alignment[s].setSequence(alignment[s].getSequenceAsString() +
+ oseq.getSequenceAsString());
if (oseq.getEnd() >= oseq.getStart())
{
alignment[s].setEnd(oseq.getEnd());
if (oseq.getEnd() >= oseq.getStart())
{
alignment[s].setEnd(oseq.getEnd());
@@
-387,7
+397,7
@@
public class AlignmentView
}
/**
* returns simple array of start end positions of visible range on alignment.
}
/**
* returns simple array of start end positions of visible range on alignment.
- * vis_start and vis_end are inclusive - use SequenceI.getSubSequence(vis_start, vis_end+1) to recover visible sequence from underlying alignment.
+ * vis_start and vis_end are inclusive - use SequenceI.getSubSequence(vis_start, vis_end+1) to recover visible sequence from underlying alignment.
* @return int[] { start_i, end_i } for 1<i<n visible regions.
*/
public int[] getVisibleContigs() {
* @return int[] { start_i, end_i } for 1<i<n visible regions.
*/
public int[] getVisibleContigs() {
@@
-419,7
+429,7
@@
public class AlignmentView
viscontigs[nvis+1]=contigs[contig+1]-1; // end is inclusive
nvis+=2;
}
viscontigs[nvis+1]=contigs[contig+1]-1; // end is inclusive
nvis+=2;
}
- start = contigs[contig + 1] + contigs[contig + 2];
+ start = contigs[contig + 1] + contigs[contig + 2];
}
if (start<fwidth) {
viscontigs[nvis] = start;
}
if (start<fwidth) {
viscontigs[nvis] = start;
@@
-431,4
+441,12
@@
public class AlignmentView
return new int[] { 0, width};
}
}
return new int[] { 0, width};
}
}
+ /**
+ *
+ * @return position of first visible column of AlignmentView within its parent's alignment reference frame
+ */
+ public int getAlignmentOrigin() {
+ // TODO Auto-generated method stub
+ return firstCol;
+ }
}
}