In article
<[email protected]>,
PeroMHC <[email protected]> wrote:
> Hi All, I have a simple problem that I hope somebody can help with. I
> have an input file (a fasta file) that I need to edit..
>
> Input file format
>
> >name 1
> tactcatacatac
> >name 2
> acggtggcat
> >name 3
> gggtaccacgtt
>
> I need to concatenate the sequences.. make them look like
>
> >concatenated
> tactcatacatacacggtggcatgggtaccacgtt
>
> thanks. Matt
Some quick ideas. First, try something along the lines of (not tested):
data=[]
for line in sys.stdin:
if line.startswith('>'):
continue
data.append(line.strip())
print ''.join(data)
Second, check out http://biopython.org/wiki/Main_Page. I'm sure somebody
has solved this problem before.
--
http://mail.python.org/mailman/listinfo/python-list