[Biojava-l] DNATools lower case?
Alastair Kilpatrick
alastair.m.kilpatrick at googlemail.com
Wed Jun 29 10:22:25 UTC 2011
Hi all,
Just in case anyone is interested in this and still looking for a fix - this
isn't a proper solution but it seems to work so far (with thanks to Shirley,
have only tried with BioJava 1.X i'm afraid):
In BioJava 1.8.1, core-1.8.1.jar contains the file
\org\biojava\bio\symbol\AlphabetManager.xml
Within that file, the lines for atomic mappings need to be changed from:
<atomicMapping token="a">
to:
<atomicMapping token="A">
..similarly for C, G & T.
In BioJava 1.4, the equivalent file is at
\org\biojava\bio\symbol\Alphabet.xml - the changes are just the same.
After changing, I had to update my project setup, but that may just be an
Eclipse thing, isn't too much bother.
Alastair
PhD candidate,
School of Informatics, University of Edinburgh
On 27 May 2011 18:12, George Waldon <gwaldon at geneinfinity.org> wrote:
> Hi Shirley,
>
> I am not really familiar with this code but I think AlternateTokenization
> was introduced after the Logo code and that is why you do not find it there.
> Can you fill a bug report? Also I'll be happy to add any patch you submit.
>
> Thank you.
>
>
> George
>
> Quoting Shirley Hui <shirleyh at gmail.com <javascript:;>>:
>
> Thanks George. It looks like using alternate tokenization works if you
>> are
>> "stringifying" a Sequence explicitly using the alphabet.getTokenization()
>> method.
>>
>> But presumably this gets done within the DistributionLogo class or some
>> other class down the line and I don't want to modify any Biojava classes
>> unless I really have to.
>>
>> The way I am constructing the DNA sequences is like this:
>>
>> Sequences seq =DNATools.createDNASequence(**sequence, name);
>>
>> The list sequences is used to make a SimpleWeightMatrix wm.
>> Then the call to DistributionLogo is like this:
>>
>> Distribution dist = wm.getColumn(columnNumber);
>> DistributionLogo dl = new DistributionLogo();
>> dl.setRenderingHints(hints);
>> dl.setOpaque(false);
>> dl.setDistribution(dist);
>> dl.setPreferredSize(new Dimension((int) columnWidth, (int) columnHeight));
>> dl.setLogoPainter(new TextLogoPainter());
>> dl.setStyle(symbolColorStyle);
>>
>> There no way that I can tell right now in the DNATools API to make the
>> DNATools use the alternate string tokenization via the call to
>> createDNASequence()
>> or another type of set method?
>>
>> shirley
>>
>>
>> On Fri, May 27, 2011 at 12:15 PM, George Waldon <gwaldon at geneinfinity.org<javascript:;>
>> >**wrote:
>>
>> Hello Shirley,
>>>
>>> I think you need to use AlternateTokenisation at some point; check
>>> BJ1.8.1
>>> Cookbook at http://www.biojava.org/wiki/**BioJava:Cookbook:Sequence<http://www.biojava.org/wiki/BioJava:Cookbook:Sequence>
>>>
>>> regards,
>>>
>>> George
>>>
>>>
>>> Quoting Shirley Hui <shirleyh at gmail.com <javascript:;>>:
>>>
>>> Hi,
>>>
>>>> I am using DNATools to generate dna Sequences.
>>>> I noticed that the static methods in DNATools a(),c(),t(),g() map to
>>>> lower
>>>> case characters.
>>>> I am using using DistributionLogo class to draw sequences logos for a
>>>> set
>>>> of
>>>> dna Sequences.
>>>> I think DistributionLogo is calling the static methods to map the
>>>> nucleotides which is lower case.
>>>> But I want the logo output the nucleotides in uppercase. How can I do
>>>> this?
>>>> Thanks for your help
>>>> shirley
>>>> ______________________________**_________________
>>>> Biojava-l mailing list - Biojava-l at lists.open-bio.org <javascript:;>
>>>> http://lists.open-bio.org/**mailman/listinfo/biojava-l<http://lists.open-bio.org/mailman/listinfo/biojava-l>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>
>
> ______________________________**_________________
> Biojava-l mailing list - Biojava-l at lists.open-bio.org <javascript:;>
> http://lists.open-bio.org/**mailman/listinfo/biojava-l<http://lists.open-bio.org/mailman/listinfo/biojava-l>
>
More information about the Biojava-l
mailing list