|
Posted by Amy Lee on May 10, 2008, 11:04 am
Please log in for more thread options On Sat, 10 May 2008 12:11:30 +0000, Jürgen Exner wrote:
>>My most work is to process DNA so I save DNA sequences as a format called
>>FastA as you've seen before. And you could call my file dna.fasta, the
>>content is
>>
>>>seq1
>>ACGGTC
>>ACTG
>>>seq2
>>CGATCC
>>ACCTC
>>>seq3
>>......
>
> From your previous description I thought those were 3 separte files.
> Obviously I was wrong.
>
>>The "seq1" "seq2" "seq3" and "seqx" is the names of these sequences. I can
>>say, it's a mark. And under "seqx" it's DNA sequences. My point is quite
>>simple, I wanna extract every sequences as a file saved. I mean I can
>>extract sequences for dna.fasta and make a single file for every sequences.
>
> So you want to split the file at each ">seq*" marker.
>
> Well, then why not just loop (while (<>)) through the input file and
> whenever you encounter such a marker (m//) close() the current output
> file and open() a new one?
>
> jue
Yes, you are right, and the codes is right for my work.
Thank you again~
Amy
|