Thursday, July 13, 2006

Parsing FASTA file

Yesterday when I parsed a FASTA file and wanted to input seq and seq_ac into a table in mysql,
an error report was up:
DBD::mysql::st execute failed: Got a packet bigger than 'max_allowed_packet' bytes at ./input_mysql.pl line 92, line 20105.
First thing to check suggested by Lalitha is whether the line break sign is missing, then the sequence is very huge exceeding the 'text' length limit in mysql db ~65000. A trick here is to search for Control+V
then Control+M. This will give you ^M in vi(not sure it's M or B). According to Lalitha, sometimes,
when you download a data file from web, the format of line break is not \n, but this funny ^M. You have
to replace these signs with \n.

However, it turned out to be my silly error this time. In my script to parse the sequences into a table,
I didn't clean up the sequence after I finished with one seq_ac (^>). So the sequence built up very long
and finally exceed the limit. I have made module to parse fasta, so that this silly error won't happen again.