Newer
Older
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
package uk.ac.sanger.artemis.util;
import uk.ac.sanger.artemis.io.ChadoCanonicalGene;
import uk.ac.sanger.artemis.io.DocumentEntry;
import uk.ac.sanger.artemis.io.PartialSequence;
import uk.ac.sanger.artemis.io.ReadFormatException;
import uk.ac.sanger.artemis.chado.FeatureForUpdatingResidues;
import uk.ac.sanger.artemis.chado.IBatisDAO;
import uk.ac.sanger.artemis.chado.JdbcDAO;
import uk.ac.sanger.artemis.chado.GmodDAO;
import uk.ac.sanger.artemis.chado.ChadoTransaction;
import uk.ac.sanger.artemis.components.database.DatabaseEntrySource;
import uk.ac.sanger.artemis.components.genebuilder.GeneUtils;
import org.gmod.schema.sequence.Feature;
import org.gmod.schema.sequence.FeatureProp;
import org.gmod.schema.sequence.FeatureLoc;
import org.gmod.schema.sequence.FeatureRelationship;
import org.gmod.schema.sequence.FeatureSynonym;
import org.gmod.schema.sequence.FeatureCvTerm;
import org.gmod.schema.sequence.FeatureCvTermProp;
import org.gmod.schema.cv.Cv;
import org.gmod.schema.general.DbXRef;
import org.gmod.schema.pub.PubDbXRef;
import org.gmod.schema.pub.Pub;
import org.postgresql.largeobject.LargeObjectManager;
import com.ibatis.common.jdbc.SimpleDataSource;
import java.util.Collections;
import java.util.Comparator;
* Objects of this class are Documents created from a relational database.
*/
public class DatabaseDocument extends Document
/** source feature_id */
private String srcFeatureId = "1";
/** database schema */
private String schema = "public";
private static Hashtable cvterms;
private InputStreamProgressListener progress_listener;
/** JDBC DAO */
private JdbcDAO jdbcDAO = null;
/** iBatis DAO */
/** entries to split into - each is given a name and the features within the entry */
{
{ {"repeats"} , {"repeat_region", "direct_repeat"} },
{ {"EST"} , {"EST_match", "match_part"} },
{ {"contig+gap"}, {"contig", "gap"}}
};
private List schema_list;
private boolean gene_builder;
// include children in reading from the database
private boolean readChildren = true;
private Hashtable idFeatureStore;
private boolean lazyFeatureLoad = true;
public static String EXONMODEL = "exon-model";
public static String TRANSCRIPT = "mRNA";
public static boolean CHADO_INFER_CDS = false;
/** list of controlled_curation CV names */
private static Vector cvControledCuratioNames;
// controlled vocabulary
/** controlled_curation controlled vocabulary */
/** controlled vocabulary */
public static String RILEY_TAG_CVNAME = "RILEY";
private static org.apache.log4j.Logger logger4j =
org.apache.log4j.Logger.getLogger(DatabaseDocument.class);
*
* Create a new Document from a database.
*
* @param location
* This should be a URL string giving:
* jdbc:postgresql://host:port/datbase_name?user=username
*
*/
public DatabaseDocument(String location, JPasswordField pfield)
if(location.indexOf('=') > -1)
this.schema = location.substring( location.indexOf('=')+ 1);
if(System.getProperty("ibatis") != null ||
System.getProperty("jdbc") == null)
Loading
Loading full blame...