The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Bio::Chado::Schema

SYNOPSIS

  use lib qw(t/lib);
  use Bio::Chado::Schema::Test;
  use Test::More;

  my $schema = Bio::Chado::Schema::Test->init_schema();

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 module provides the basic utilities to write tests against Bio::Chado::Schema.

DESCRIPTION

This is a standard object-relational mapping layer for use with the GMOD 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 "modules", 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.

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

NAME

Bio::Chado::Schema - A standard DBIx::Class layer for the Chado database schema.

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

CONTRIBUTORS

Aureliano Bombarely, <ab782@cornell.edu>

Naama Menda, <nm249@cornell.edu>

Jonathan "Duke" Leto, <jonathan@leto.net>

AUTHOR

Robert Buels, <rmb32@cornell.edu>

COPYRIGHT & LICENSE

Copyright 2009 Boyce Thompson Institute for Plant Research

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

NAME

Bio::Chado::Schema::Test - Library to be used by Bio::Chado::Schema test scripts.

METHODS

init_schema

  my $schema = Bio::Chado::Schema::Test->init_schema(
    deploy            => 1,
    populate          => 1,
    storage_type      => '::DBI::Replicated',
    storage_type_args => {
      balancer_type=>'DBIx::Class::Storage::DBI::Replicated::Balancer::Random'
    },
  );

This method removes the test SQLite database in t/var/BCS.db and then creates a new, empty database.

This method will call deploy_schema() by default, unless the deploy flag is set to 0.

This method will call populate_schema() if the populate argument is set to a true value.

deploy_schema

  Bio::Chado::Schema::Test->deploy_schema( $schema );

This method does one of two things to the schema. It can either call the experimental $schema->deploy() if the BCSTEST_SQLT_DEPLOY environment variable is set, otherwise the default is to read in the t/lib/sqlite.sql file and execute the SQL within. Either way you end up with a fresh set of tables for testing.

populate_schema

  Bio::Chado::Schema::Test->populate_schema( $schema );

After you deploy your schema you can use this method to populate the tables with test data.

AUTHOR

Robert Buels <rbuels@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2009 by Robert Buels.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.