[Biojava-l] regarding errors

Andy Yates ayates at ebi.ac.uk
Thu Apr 29 08:51:23 UTC 2010


I believe your problem is that you are attempting to transcribe the DNA to RNA twice. If you comment out the line:

//symL = RNATools.transcribe(symL);

Then you should find the code will work

Regards,

Andy

On 28 Apr 2010, at 17:22, indu pandey wrote:

> hi
> 
> When i m trying to run this code
> 
> package javaapplication10;
> import org.biojava.bio.symbol.*;
> import org.biojava.bio.seq.*;
> 
> public class TranscribeDNAtoRNA {
>   public static void main(String[] args) {
>      try {
>       //make a DNA SymbolList
>       SymbolList symL = DNATools.createDNA("ATGTAAGGCCAGTGT");
>       //transcribe it to RNA (after BioJava 1.4 this method is deprecated)
>       symL = RNATools.transcribe(symL);
>       //(after BioJava 1.4 use this method instead)
>       symL = DNATools.toRNA(symL);
>       //just to prove it worked
>       System.out.println(symL.seqString());
>      }
>      catch (IllegalSymbolException ex) {
>        //this will happen if you try and make the DNA seq using non IUB
> symbols
>         ex.printStackTrace();
>      }catch (IllegalAlphabetException ex) {
>       //this will happen if you try and transcribe a non DNA SymbolList
>         ex.printStackTrace();
>      }
>   }
> }
> 
> 
> i get following errors:.
> 
> *org.biojava.bio.symbol.IllegalAlphabetException: The source alphabet and
> translation table source alphabets don't match: RNA and DNA
>        at
> org.biojava.bio.symbol.TranslatedSymbolList.<init>(TranslatedSymbolList.java:75)
>        at
> org.biojava.bio.symbol.SymbolListViews.translate(SymbolListViews.java:125)
>        at org.biojava.bio.seq.DNATools.toRNA(DNATools.java:490)
>        at
> javaapplication10.TranscribeDNAtoRNA.main(TranscribeDNAtoRNA.java:23)
> *
> _______________________________________________
> Biojava-l mailing list  -  Biojava-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/biojava-l

-- 
Andrew Yates                   Ensembl Genomes Engineer
EMBL-EBI                       Tel: +44-(0)1223-492538
Wellcome Trust Genome Campus   Fax: +44-(0)1223-494468
Cambridge CB10 1SD, UK         http://www.ensemblgenomes.org/








More information about the Biojava-l mailing list