[Biojava-l] Problem with RichSequence.IOTools.writeFasta method

Mutlu Dogruel md5 at sanger.ac.uk
Wed Oct 3 23:05:43 UTC 2007



Hi, try using import org.biojavax.Namespace instead of 
javax.xml.stream.events.Namespace;

Also, you should handle the illegal symbol 
exception that DNATools.createDNASequence may throw.

Cheers,
mutlu

On Wed, 3 Oct 2007, El Mabrouk M wrote:

> Hi!
>
> I have just started to learn biojava. I have written a small
> program that write a sequence in fasta file with the help of the biojavax method
>
> RichSequence.IOTools.writeFasta(seqOut, s1, ns);
> I have got the error "cannot find symbol".
> I'm using biojava 1.5, jdk 1.6 and netbeans.
> What can be done to fix this problem?
>
> This is what I tried:
>
> import org.biojava.bio.seq.*;
> import java.io.*;
> import org.biojava.bio.symbol.SymbolList;
> import org.biojavax.RichObjectFactory;
> import javax.xml.stream.events.Namespace;
> import org.biojavax.bio.seq.RichSequence;
>
> public class SeqFastaF {
>    public static void main(String[] args) {
>        SymbolList dna0 = DNATools.createDNASequence("atgctgaacaacggcatggcaacttacggacggactacgact", "dna_1");
>        Sequence s1 = DNATools.createDNASequence(dna0.seqString(), "dna_0");
>        try {
>            OutputStream seqOut = System.out;
>            Namespace ns = (Namespace) RichObjectFactory.getDefaultNamespace();
>            RichSequence.IOTools.writeFasta(seqOut,s1,ns);
>        } catch (IOException ex) {
>            //io error
>            ex.printStackTrace();
>        }
>    }
> }
>
> Error:
> cannot find symbol
> symbol  : method writeFasta(java.io.OutputStream,org.biojava.bio.seq.Sequence,javax.xml.stream.events.Namespace)
> location: class org.biojavax.bio.seq.RichSequence.IOTools
>
>
>
> ---------------------------------
> Be smarter than spam. See how smart SpamGuard is at giving junk email the boot with the All-new Yahoo! Mail
> _______________________________________________
> Biojava-l mailing list  -  Biojava-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/biojava-l
>


-- 
 The Wellcome Trust Sanger Institute is operated by Genome Research 
 Limited, a charity registered in England with number 1021457 and a 
 company registered in England with number 2742969, whose registered 
 office is 215 Euston Road, London, NW1 2BE. 



More information about the Biojava-l mailing list