[Biojava-l] Biojava uses which BioSQL shema version ?

Alexandre Dionne Laporte adionne at warnex.ca
Tue Jun 1 12:10:04 EDT 2004


Hi and thanks for for the reply,

I have reloaded the biosql-db schema to mysql and I have inserted one sequence form a Genbank format with the 'load_seqdatabase.pl' perl script.

When I try to fetch this entry for the first time with Biojava1.4pre1 I get this error :

---------------------------------------------------------------------------------
*** Importing a core ontology -- hope this is okay
*** Importing terms
org.biojava.bio.BioException: Error accessing ontologies
        at org.biojava.bio.seq.db.biosql.BioSQLSequenceDB.initDb(BioSQLSequenceDB.java:238)
        at org.biojava.bio.seq.db.biosql.BioSQLSequenceDB.<init>(BioSQLSequenceDB.java:193)
        at ca.warnex.sab.util.helpers.biosqlTest.main(biosqlTest.java:49)
Caused by: java.sql.SQLException: General error,  message from server: "Table 'bioseqdb.term_relationship_term' doesn't exist"
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1977)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1163)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1272)
        at com.mysql.jdbc.Connection.execSQL(Connection.java:2236)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1741)
        at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1588)
        at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:205)
        at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:205)
        at org.biojava.bio.seq.db.biosql.OntologySQL.persistTriple(OntologySQL.java:616)
        at org.biojava.bio.seq.db.biosql.OntologySQL.processTerm(OntologySQL.java:262)
        at org.biojava.bio.seq.db.biosql.OntologySQL.processTerm(OntologySQL.java:251)
        at org.biojava.bio.seq.db.biosql.OntologySQL.addCore(OntologySQL.java:218)
        at org.biojava.bio.seq.db.biosql.OntologySQL.<init>(OntologySQL.java:396)
        at org.biojava.bio.seq.db.biosql.OntologySQL.getOntologySQL(OntologySQL.java:71)
        at org.biojava.bio.seq.db.biosql.BioSQLSequenceDB.initDb(BioSQLSequenceDB.java:236)
        ... 2 more
--------------------------------------------------------------------------------

which added a row with '__core_ontology' in the table 'ontology';

When I try to fetch the entry for a second time, I get:

------------------------------------------------------------------------------------------
Exception in thread "main" org.biojava.bio.BioError: Invalid term id 4
        at org.biojava.bio.seq.db.biosql.OntologySQL.termForID(OntologySQL.java:691)
        at org.biojava.bio.seq.db.biosql.BioSQLSequenceDB.getOntologyTerm(BioSQLSequenceDB.java:951)
        at org.biojava.bio.seq.db.biosql.FeaturesSQL.retrieveFeatures(FeaturesSQL.java:155)
        at org.biojava.bio.seq.db.biosql.BioSQLAllFeatures.getFeatures(BioSQLAllFeatures.java:145)
        at org.biojava.bio.seq.db.biosql.BioSQLAllFeatures.features(BioSQLAllFeatures.java:73)
        at org.biojava.bio.seq.db.biosql.BioSQLSequence.features(BioSQLSequence.java:237)
        at ca.warnex.sab.util.helpers.biosqlTest.main(biosqlTest.java:62)
------------------------------------------------------------------------------------------

The fourth Ontology row is the one with '__core_ontology' in its name.

Any Ideas???
Are you sure the biosql-db schema (biosqldb-mysql.sql v. 1.38) is the wright one to use ?

Alexandre D.L.


-----Original Message-----
From:	Simon Foote [mailto:simon.foote at nrc-cnrc.gc.ca]
Sent:	Tue 6/1/2004 9:05 AM
To:	Alexandre Dionne Laporte
Cc:	biojava-l at biojava.org
Subject:	Re: [Biojava-l] Biojava uses which BioSQL shema version ?
Hi Alexandre,

That version of biosql schema should work fine with the biojava snapshot 
you have.
To load a Genbank file into the database, the following code should do 
the trick with the various variables set and error handling code added:

BioSQLSequenceDB bsd = new BioSQLSequenceDB(driver, url, user, password, 
biodatabase, create);
BufferedReader br = new BufferedReader(new FileReader(inFile));
SequenceIterator si = SeqIOTools.readGenbank(br);
Sequence seq = (Sequence) si.nextSequence();
bsd.addBioEntry(seq);

To write it in Genbank format you can use the getSequence() and 
appropriate writeSequence() method for the format you want.

Cheers,
Simon

Alexandre Dionne Laporte wrote:

>Hi,
>
>First of all, here are the softwares I use:
>
>1) Biojava snapshot 'biojava-20040528'
>2) latest biosql shema : biosqldb-mysql.sql v. 1.38
>3) Some of Bioperl 1.4 and bioperl-db projects
>
>
>I would like to store entries from a Genbank file from the NCBI to the
>BioSQL schema using biojava. That I can do with the 'load_seqdatabase.pl'
>script found in bioperl-db without any problem. 
>
>In a same way, I would like to retreive sequences with the Biojava package
>and dump it in Genbank file format, as I can do with 'bioentry2flat.pl'
>script.
>
>My question is : Which version of biosqldb should I use with the biojava
>snapshot ?
>
>Thanks,
>
>Alexandre D.L.
>
>_______________________________________________
>Biojava-l mailing list  -  Biojava-l at biojava.org
>http://biojava.org/mailman/listinfo/biojava-l
>  
>

-- 
Bioinformatics Programmer
Pathogen Genomics
Institute for Biological Sciences
National Research Council of Canada
[T] 613-990-0561  [F] 613-952-9092
simon.foote at nrc-cnrc.gc.ca







More information about the Biojava-l mailing list