[Biojava-l] SCF: support for ambiguities

Ben Berman benb at fruitfly.org
Fri Oct 31 13:38:32 UTC 2008


Is there a reason why IUPAC ambiguity codes have never been added to  
DNATools?  Would it hurt the performance of symbol lookups?


On Oct 31, 2008, at 3:05 AM, community at struck.lu wrote:

> Hello,
>
>
> I am using the SCF class in the context of HIV-1 population  
> sequencing. In
> this context we do have sometimes ambiguous base calls. To support  
> them I
> extended the SCF class to allow for IUPAC ambiguities up to 2  
> nucleotides.
>
> Therefore I simply added the following code to the "decode" function:
>
> #########################
>        public Symbol decode(byte call) throws IllegalSymbolException {
>
>            //get the DNA Alphabet
>            Alphabet dna = DNATools.getDNA();
>
>            char c = (char) call;
>            switch (c) {
>                case 'a':
>                case 'A':
>                    return DNATools.a();
>                case 'c':
>                case 'C':
>                    return DNATools.c();
>                case 'g':
>                case 'G':
>                    return DNATools.g();
>                case 't':
>                case 'T':
>                    return DNATools.t();
>                case 'n':
>                case 'N':
>                    return DNATools.n();
>                case '-':
>                    return DNATools.getDNA().getGapSymbol();
>                case 'w':
>                case 'W':
>                    //make the 'W' symbol
>                    Set symbolsThatMakeW = new HashSet();
>                    symbolsThatMakeW.add(DNATools.a());
>                    symbolsThatMakeW.add(DNATools.t());
>                    Symbol w = dna.getAmbiguity(symbolsThatMakeW);
>                    return w;
>                case 's':
>                case 'S':
>                    //make the 'S' symbol
>                    Set symbolsThatMakeS = new HashSet();
>                    symbolsThatMakeS.add(DNATools.c());
>                    symbolsThatMakeS.add(DNATools.g());
>                    Symbol s = dna.getAmbiguity(symbolsThatMakeS);
>                    return s;
> ... (and so on)
> #########################
>
> Is this the right way to do it? And if so, how can this code be  
> submitted to
> the official biojava source code?
>
>
> Best regards,
> Daniel Struck
> _________________________________________________________
> Mail sent using root eSolutions Webmailer - www.root.lu
>
>
> _______________________________________________
> Biojava-l mailing list  -  Biojava-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/biojava-l
>

----
Ben Berman, PhD
Research Associate, USC Epigenome Center
Harlyne J. Norris Research Tower
1450 Biggy St.
Room #G511, MC 9601
Los Angeles, CA 90033




More information about the Biojava-l mailing list