[Biojava-l] Chromatogram viewer
Andy Yates
ayates at ebi.ac.uk
Wed Aug 15 08:33:10 UTC 2007
If you are working with processed traces i.e. ones which are normalized
to an intensity of around 1,000 & have very little background noise then
it is possible to look at the chromatogram's method getBaseCalls(). This
gives you a base call & the offset in the trace it occurs at. Then it's
a case of editing the ChromatogramGraphic Option. The ones you need are
TO_TRACE_SAMPLE and FROM_TRACE_SAMPLE.
So in practice it would look something like this (I haven't compiled
this so it may not work but you can get the gist of it).
Chromatogram c = getChromatogramFromSomewhere();
ChromatogramGraphic cg = new ChromatogramGraphic(c);
Integer from = new Integer(getScanFromBase(c, 200));
Integer to = new Integer(getScanFromBase(c, 400));
cg.setOption(ChromatogramGraphic.Option.FROM_TRACE_SAMPLE, from);
cg.setOption(ChromatogramGraphic.Option.TO_TRACE_SAMPLE, to);
//Then do the drawing
public int getScanFromBase(Chromatogram c, int base) {
Alingment align = c.getBaseCalls();
Symbol baseCall = align.symbolAt(Chromatogram.OFFSETS, base);
int offset = ((IntegerSymbol)baseCall).intValue();
return offset;
}
Hope that helps
Andy Yates
King Jordan wrote:
> I would like to be able to display a specific sub-range of a chromatogram.
> For instance, I may have and abi or scf file with 1,000 bp and I would like
> to display only positions 200-400. Is there some way to modify the abi or
> scf file with biojava to accomplish this?
>
> Thanks in advance,
> King
>
> -----------------------
> I. King Jordan
> Associate Professor
> School of Biology
> Georgia Institute of Technology
> 310 Ferst Drive
> Atlanta, GA 30332-0230
> 404-385-2224
> http://esbg.gatech.edu
>
>
>
> _______________________________________________
> Biojava-l mailing list - Biojava-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/biojava-l
More information about the Biojava-l
mailing list