[Biopython] Read sequence from file
Horea Chrristian
h.chr at mail.ru
Fri Feb 27 12:26:14 UTC 2015
Then why not add an argument to control that behaviour?
Cheers?
On Fre, 2015-02-27 at 09:07 +0000, Peter Cock wrote:
> On Fri, Feb 27, 2015 at 4:42 AM, Horea Chrristian <h.chr at mail.ru> wrote:
> > Many thanks,
> >
> > from Bio.Seq import Seq
> > from Bio.Alphabet import generic_dna
> > with open("my_example.txt") as handle:
> > my_seq = Seq(handle.read().strip(), generic_dna)
> >
> > solves it just fine. I would want one sequence regardless the line breaks,
> > but that is not relly that important.
>
> Then try:
>
> my_seq = Seq("".join(handle.read().strip().split()), generic_dna)
>
> > What do you mean by "Right now" - will this likely change soon?
> >
> > Chhers,
>
> We could add a "raw" format to Bio.SeqIO if there was a clear
> motivating use-case or user demand. I'm a little wary because
> of ambiguities like if some people would expect multiple lines
> to be separate sequences or not.
>
> Regards,
>
> Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.open-bio.org/pipermail/biopython/attachments/20150227/244f242b/attachment.html>
More information about the Biopython
mailing list