X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FAlignmentView.java;h=e6684705b23d43bc0c912d534563120b562924b0;hb=0bdaa0deb6ee514912d2ed730e19f618bc44cb69;hp=7340d3b6a9276aac68feb9d6707ac5919ad680c4;hpb=174230b4233d9ce80f94527768d2cd2f76da11ab;p=jalview.git diff --git a/src/jalview/datamodel/AlignmentView.java b/src/jalview/datamodel/AlignmentView.java index 7340d3b..e668470 100644 --- 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 int firstCol=0; public AlignmentView(CigarArray seqcigararray) { if (!seqcigararray.isSeqCigarArray()) @@ -49,6 +50,15 @@ public class AlignmentView 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) { @@ -64,7 +74,10 @@ public class AlignmentView { return sequences; } - + /** + * @see CigarArray.getDeletedRegions + * @return int[] { vis_start, sym_start, length } + */ public int[] getContigs() { return contigs; @@ -89,7 +102,19 @@ public class AlignmentView { String[] seqs=new String[sequences.length]; for (int n=0; n 0) + { + int start = 0; + int nvis = 0; + int fwidth = width; + for (int contig = 0; contig < contigs.length; contig += 3) + { + if ( (contigs[contig + 1] - start) > 0) + { + nvis++; + } + fwidth += contigs[contig + 2]; // end up with full region width (including hidden regions) + start = contigs[contig + 1] + contigs[contig + 2]; + } + if (start < fwidth) + { + nvis++; + } + int viscontigs[] = new int[nvis*2]; + nvis=0; + start=0; + for (int contig=0; contig 0) + { + viscontigs[nvis] = start; + viscontigs[nvis+1]=contigs[contig+1]-1; // end is inclusive + nvis+=2; + } + start = contigs[contig + 1] + contigs[contig + 2]; + } + if (start