[Biojava-l] fasta description line

Mark Schreiber markjschreiber at gmail.com
Tue Oct 31 09:37:24 UTC 2006


Hi -

If you are using biojava 1.5 beta (recommended) you should use
RichSequence.IOTools to write the fasta (strongly recommended).

With the new org.biojavax.bio.seq.io.FastaFormat object the
description line is constructed from:

richSequence.getIdentifier()
richSequence.getNamespace().getName();
richSequence.getAccession()
richSequence.getVersion()
richSequence.getName()
richSequence.getDescription()

- Mark


On 10/23/06, ThorstenInAnger <henrich at embl.de> wrote:
>
> Hi,
>
> I want to do something very simple:
>
> - get id and sequence from a database
> - create a sequence object
> - write it out as fasta format file (with a defined description line)
>
> this is my code:
>                                 rs = stmt.executeQuery(query);
>                             Feature.Template templ = new Feature.Template();
>
>                             //fill in the template
>                             Annotation an = new SimpleAnnotation();
>                             templ.location = Location.empty;
>
>                                 while (rs.next()) {
>                                         mepdId = rs.getInt(1);
>                                         mepdName = rs.getString(2);
>                                         seq = rs.getString(3);
>                                         seqObj =  DNATools.createDNASequence(seq, mepdName);
>                                     an.setProperty(FastaFormat.PROPERTY_DESCRIPTIONLINE, "my description
> here");
>                                     templ.annotation = an;
>                                         seqObj.createFeature(templ);
>                                         SeqIOTools.writeFasta(fastaFos, seqObj);
>                                         //db.addSequence(seqObj);
>                                 }
>
> It works fine, but there is no description line in the resulting file!
> How can I change the fasta description line?
>
> Also I am using deprecated methods, but could not find out what to use
> instead:
> FastaFormat.PROPERTY_DESCRIPTIONLINE
> SeqIOTools.writeFasta
> All tutorials I found are using the deprecated.
>
> Cheers,
>
> Thorsten
>
> --
> View this message in context: http://www.nabble.com/fasta-description-line-tf2493269.html#a6950970
> Sent from the BioJava mailing list archive at Nabble.com.
>
> _______________________________________________
> 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