Hey Jim,
Thanks for your reply.
I have one main alignment, on this alignment i apply some sequence filter
after which some sequences and some columns form the alignment are deleted.
In my viewer i want to show the main full alignmnet with deleted sequences
and columns highlighted/selected/coloured, so that user can see what
changes have been made and then decide the next step.
for the alignment view, this is what i have done:
SequenceI[] seqs = new SequenceI[ado.getAlignment().size()]; //
ado=alignmnet data object
for (int i = 0; i < seqs.length; i++) {
seqs[i] = new Sequence(ado.getAlignment().get(i).getHeader(),
ado.getAlignment().get(i).getOriginalSequence());
// String name , and
sequence
}
Alignment alignment = new Alignment(seqs);
AlignFrame af = new AlignFrame(alignment, null, null, false);
af.setVisible(false);
af.setEnabled(false);
AlignViewport avw = new AlignViewport(alignment, null);
avw.setGlobalColourScheme(new ZappoColourScheme());
AlignmentPanel apl = new AlignmentPanel(af, avw);
apl.setAnnotationVisible(false);
this.jScrollPane1.setViewportView(apl);
and so i get the jalview alignmnet viewer in my jScrollPane.
i am able to show the deleted sequences as coloured sequence in the full
alignment by:
SequenceI[] alteredSeqs = new SequenceI[altseq.size()]; // altseq is an
ArrayList<String> of sequences left the filter.
for (int i = 0; i < alteredSeqs.length; i++) {
alteredSeqs[i] = new Sequence(name.get(i), altseq.get(i));
}
Alignment alteredAlignment = new Alignment(alteredSeqs);
AlignFrame af = new AlignFrame(alignment, null, null, false);
af.setVisible(false);
af.setEnabled(false);
AlignViewport avw = new AlignViewport(alignment, null);
for (int i = 0; i < seqs.length; i++) { // seq is full alignment.
SequenceI s = alteredAlignment.findName(seqs[i].getName());
if (s == null) {
avw.setSequenceColour(alignment.getSequenceAt(alignment.findIndex(seqs[i])),
Color.red);
}
}
AlignmentPanel apl = new AlignmentPanel(af, avw);
apl.setAnnotationVisible(false);
this.jScrollPane1.setViewportView(apl);
My alignment filter class, gves me an option to store a conserved string.
This string has "x" at the conserved positions,i.e, the positions which are
retained in the alignment after the filter and "-" for position which have
been deleted. So form this string i make a column selection as below:
ArrayList<Integer> conPos2origPos = new ArrayList<Integer>();
for (int i = 0; i < constr.length(); i++) { // constr is the conserved
string
if (constr.charAt(i) == '-') {
conPos2origPos.add(i);
}
}
ColumnSelection col = new ColumnSelection();
for (int j = 0; j < conPos2origPos.size(); j++) {
col.addElement(conPos2origPos.get(j));
}
Now i am able to highlight/colour these columns in the full alignment.
Hope the explanation is not very confusing.
Suggestions/help is welcome.
Regards,
Nicee.
On Thu, Jul 12, 2012 at 5:56 PM, Jim Procter <[email protected]> wrote:
> Not sure where you have got the column selection from without seeing how
> you have integrated jalview... since there isn't a clear api for doing this
> yet. Can you send me a code sample so i can help you out?
>
> Jim.
>
> Ps. I realize this is unreleased code. But one of the great things about
> open source is you get help for free if you develop your code in the open
> too :)
>
> On Jul 11, 2012 3:37 PM, "Nicee Srivastava" <[email protected]> wrote:
>
>
> Hello everyone,
>
> Is there a way to programmaticaly colour the selected column in jalview? I
> have a ColumnSelection and want to show it in a different colour.
> Any suggestion/help would be great.
> Thanks.
>
> Regards,
> Nicee.
>
>
>
> _______________________________________________
> Jalview-discuss mailing list
> [email protected]
> http://www.compbio.dundee.ac.uk/mailman/listinfo/jalview-discuss
>
>
--
Regards,
Nicee Srivastava
Phd Student,
Group of Prof. Dr. Dirk Fasshauer,
Faculty of Biology and Medicine,
Department of Biology and Cellular Morphology,
Quartier UNIL-CHUV,
Rue du Bugnon 9,
CH-1005 Lausanne .
_______________________________________________
Jalview-discuss mailing list
[email protected]
http://www.compbio.dundee.ac.uk/mailman/listinfo/jalview-discuss