[Biophp-dev] seqdb and seq classes in genephp
biophp-dev@bioinformatics.org
biophp-dev@bioinformatics.org
Fri, 25 Apr 2003 7:19:59 PST
Strange to answer myself, but I made a small start towards a 'parse'
class and it seems to work real well. I enclose a tar.gz file with the
code so that you can have a look (don't know if it makes it through teh
mailing list, not a good idea to include a file, but....) It also
includes a test.php file and the genbank entry for one of the genes I
worked on.
I now think it is best to develop the parse.inc.php file into a parse
class, which could look like:
class parse
function parse ($seqfile) //constructor
function autodetect () // figures out what seqfiletype this file is,
called from th constructor
function fetch ()//returns $seq object,sets file pointer to next entry in
file (if available)
function next () // forwards file pointer to next entry
function previous () // sets file pointer to previous entry
$seqfiletype //
and then a bunch of
function parse_genbank ()
function parse_swissprot()
function parse_ANSI ()
etc...
I was very happy that I managed to parse my genbank file! If Serge
thinks this is a good idea,I'll continue working on it.
The SQL stuff could be made self-contained in a similar fashion. I would
strongly advice though to stop using the direct MySQL calls but instead
immediately start using a database abstraction layer like adodb (my
favorite, I can help out with this one) or PEAR (might finally be usable).
Best,
Nico