[BioPython] Looking for functions

Myriam Vezain Myriam.Vezain at loria.fr
Tue Apr 27 08:58:30 EDT 2004


Myriam Vezain a écrit :

> Hello,
>
> I am looking for several functions :
> - convert a swissprot file to a fasta file,
> - find EcoRI restriction sites in a fasta sequence.
>
> Can you help me to find those functions.
> I try this one :
>
> from Bio.SeqIO import FASTA
> from Bio.SwissProt import SProt
> from sys import *
>
> def convert_sp_fasta(infile,outfile):
>    """
>    convert a SwissProt file into a Fasta formatted file
>    """
>    in_h = open(infile)
>    sp = SProt.Iterator(in_h, SProt.SequenceParser())
>    out_h = FASTA.FastaWriter(outfile)
>    sequence = sp.next()
>    out_h.write(sequence)
>    in_h.close()
>    out_h.close()
>
> But it was not a succes.
>
> Thank you.
>
> Myriam.
>
>
>
>
>




More information about the BioPython mailing list