[BioPython] writing down a string in fasta format

Edoardo Saccenti saccenti at cerm.unifi.it
Thu Feb 10 11:42:04 EST 2005


On Thursday 10 February 2005 17:04, Jonathan Taylor wrote:

I just fixed the problem:

seq ='ADQQRRRTTWREVBBJFODLOSKSSN.........'
width = 60
for p in xrange(0, len(seq), width):
    file.writelines("%s" % seq[p:p+width]+'\n')
file.close

just a look on the web..... :-)

> I believe you need to use Bio.SeqRecord as the input.  There really
> should be some docstrings in Bio.SeqIO.FASTA.FastaWriter though.
>
> Cheers.
> Jon.
>
> Edoardo Saccenti wrote:
> > Dear all,
> > I'hava a string of length L>>60 and I want write it down in Fasta format
> > I try to use FASTA.FastaWriter from BioSeq.IO but it does accept accept a
> > string as input.
> >
> > Any Idea??
> >
> > thanks
> > Edoardo
> > --
> > "Raffiniert ist der Herr Gott,
> >  aber boshaft ist Er nicht."
> >
> > ---
> > Dr. Edoardo Saccenti
> > FiorGen Pharmacogenomics Foundation
> > CERM Nuclear Magnetic Resonace Research Center
> > Scientific Pole - University of Florence
> > Via Luigi Sacconi n° 6
> > 50019 Sesto Fiorentino (FI)
> > tel: +39 055 4574193
> > fax: +39 055 4574253
> > saccenti at cerm.unifi.it
> > www.cerm.unifi.it
> >
> > _______________________________________________
> > BioPython mailing list  -  BioPython at biopython.org
> > http://biopython.org/mailman/listinfo/biopython
>
> _______________________________________________
> BioPython mailing list  -  BioPython at biopython.org
> http://biopython.org/mailman/listinfo/biopython

-- 
"Raffiniert ist der Herr Gott,
 aber boshaft ist Er nicht."

---
Dr. Edoardo Saccenti
FiorGen Pharmacogenomics Foundation
CERM Nuclear Magnetic Resonace Research Center
Scientific Pole - University of Florence
Via Luigi Sacconi n° 6
50019 Sesto Fiorentino (FI)
tel: +39 055 4574193
fax: +39 055 4574253
saccenti at cerm.unifi.it
www.cerm.unifi.it



More information about the BioPython mailing list