SYNOPSIS

  use Bio::Chado::Schema;

  my $chado = Bio::Chado::Schema->connect( $dsn, $user, $password );

  print "number of rows in feature table: ",
        $chado->resultset('Sequence::Feature')->count,
        "\n";

DESCRIPTION

This is a standard object-relational mapping layer for use with the \s-1GMOD\s0 Chado database schema. This layer is implemented with DBIx::Class, generated with the help of the very fine DBIx::Class::Schema::Loader module.

Chado is an open-source modular database schema for biological data. It is divided into several notional \*(L"modules\*(R", which are reflected in the namespace organization of this package. Note that modules in the Chado context refers to sets of tables, they are not modules in the Perl sense.

GETTING STARTED

To learn how to use this DBIx::Class \s-1ORM\s0 layer, a good starting point is the DBIx::Class::Manual.

CHADO MODULES COVERED BY THIS PACKAGE

Bio::Chado::Schema::CellLine

Bio::Chado::Schema::Companalysis

Bio::Chado::Schema::Composite

Bio::Chado::Schema::Contact

Bio::Chado::Schema::Cv

Bio::Chado::Schema::Expression

Bio::Chado::Schema::General

Bio::Chado::Schema::Genetic

Bio::Chado::Schema::Library

Bio::Chado::Schema::Mage

Bio::Chado::Schema::Map

Bio::Chado::Schema::NaturalDiversity

Bio::Chado::Schema::Organism

Bio::Chado::Schema::Phenotype

Bio::Chado::Schema::Phylogeny

Bio::Chado::Schema::Project

Bio::Chado::Schema::Pub

Bio::Chado::Schema::Sequence

Bio::Chado::Schema::Stock

CHADO VERSIONS

Basically, \s-1BCS\s0 has always followed the \s-1SVN\s0 \s-1HEAD\s0 of Chado, since it's on a much faster release cycle than Chado itself.

Most users will not experience incompatibilities using the most recent versions of Bio::Chado::Schema with older Chado installations. However, if you encounter problems using Bio::Chado::Schema with an older Chado schema, you may want to try downgrading to an earlier version of Bio::Chado::Schema. The following rough equivalencies hold between \s-1BCS\s0 and Chado versions:

Chado 1.2 -- BCS 0.09000 Chado 1.11 -- BCS 0.05801 Chado 1.1 -- BCS 0.05801 older -- BCS 0.03100

SCHEMA OBJECT METHODS

Convenience method to for finding single cvterms based on the text name of the \s-1CV\s0 and the term. The cvterm objects found with this method are cached in the schema object itself. Thus, you only use this function in the (relatively common) scenario in which you just need convenient access to a handful of different cvterms.

get_cvterm_or_die

Same as get_cvterm above, but dies with a \*(L"not found\*(R" message if the cvterm is not found. This is convenient when you don't want to be bothered with checking the return value of \*(C`get_cvterm\*(C', which for me is most of the time.

CLASS METHODS

Sometimes application-specific plugins need to add relationships to the core \s-1BCS\s0 classes. It can't just be done normally from inside the classes of the plugins, you need to use this method.

Example: Bio::Chado::Schema::Result::MyApp::SpecialThing belongs_to the core \s-1BCS\s0 Organism::Organism, and you would like to be able to call \*(C`$organism->myapp_specialthings\*(C' on organisms to get their associated SpecialThings.

package Bio::Chado::Schema::MyApp::Result::SpecialThing;

# ( do table and column definitions and so forth here )

Bio::Chado::Schema->plugin_add_relationship( 'Organism::Organism', 'has_many', ( "myapp_specialthings", "Bio::Chado::Schema::MyApp::Result::Foo", { "foreign.organism_id" => "self.organism_id" }, { cascade_copy => 0, cascade_delete => 0 }, ); );

AUTHOR

Robert Buels, <[email protected]>

CONTRIBUTORS

Naama Menda, <[email protected]>

Aureliano Bombarely, <[email protected]>

Jonathan \*(L"Duke\*(R" Leto, <[email protected]>