Bio::C...Schema(3pm)

πŸ’– Bio::Chado::Schema πŸ’–

okay bestie, gather round, because this is the Bio::Chado::Schema page (that's the Bio::C...Schema(3pm) one, the manual name got shortened but we all know her) and she is lowkey iconic. it's a standard DBIx::Class layer for the Chado database schema. no cap.


✨ NAME ✨

Bio::Chado::Schema β€” a standard DBIx::Class layer for the Chado database schema. that's it, that's the whole vibe. πŸŽ€


🌸 SYNOPSIS 🌸

so like, here's the moment you've been waiting for:

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";

look at her go. connecting, counting rows in the feature table, living her best life. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so this is a standard object-relational mapping layer for use with the GMOD Chado database schema. this layer is implemented with DBIx::Class, and it was generated with the help of the very fine DBIx::Class::Schema::Loader module. shoutout to DBIx::Class::Schema::Loader, she did that. πŸ‘‘

Chado is an open-source modular database schema for biological data. it's divided into several notional "modules", which are reflected in the namespace organization of this package. and here's the thing bestie, don't get it twisted: modules in the Chado context means sets of tables, they are not modules in the Perl sense. literally two different things. iykyk.


🌈 GETTING STARTED 🌈

want to learn how to use this DBIx::Class ORM layer? the best starting point is the DBIx::Class::Manual. go read her, she's giving tutorial energy. ✨


πŸŽ€ CHADO MODULES COVERED BY THIS PACKAGE πŸŽ€

these are all the Chado modules this package has got for you:

  • 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

look at that roster. a whole squad. 🫢


πŸ’œ CHADO VERSIONS πŸ’œ

basically? BCS has always followed the SVN HEAD of Chado, since it's on a much faster release cycle than Chado itself. she moves quick, okay.

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 BCS 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
lowkey save this little chart, it will save you a whole crisis someday. 😭

πŸ‘‘ SCHEMA OBJECT METHODS πŸ‘‘

get_cvterm( "$cv_name:$cvterm_name" ) OR get_cvterm( $cv_name, $cvterm_name )

a convenience method for finding single cvterms based on the text name of the CV and the term. (yes the heading above literally shows you both ways to call her, the colon-string version or the two-argument version. both slay.)

the cvterm objects found with this method are cached in the schema object itself. so you only use this function in the (relatively common) scenario where you just need convenient access to a handful of different cvterms. don't be out here hammering it for everything, that's not her moment. πŸ’…

get_cvterm_or_die

same as get_cvterm above, but she dies with a "not found" message if the cvterm is not found. this is convenient when you don't want to be bothered with checking the return value of "get_cvterm", which for me is most of the time. honestly? relatable. πŸ™ˆ


⭐ CLASS METHODS ⭐

plugin_add_relationship( 'ChadoModule::SourceName', 'reltype', @args )

sometimes application-specific plugins need to add relationships to the core BCS classes. and here's the tea: it can't just be done normally from inside the classes of the plugins. you need to use this method. periodt.

example: Bio::Chado::Schema::Result::MyApp::SpecialThing belongs_to the core BCS Organism::Organism, and you would like to be able to call "$organism->myapp_specialthings" on organisms to get their associated SpecialThings. iconic behaviour, honestly.

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 },
    );
);
ngl that nested paren situation is just how she is, we do not touch it, we do not "fix" it. we copy it exactly. πŸ’–

🌸 AUTHOR 🌸

Robert Buels, <rmb32@cornell.edu> β€” the main character who wrote her. πŸ‘‘


πŸ¦‹ CONTRIBUTORS πŸ¦‹

the besties who helped make her happen:

  • Naama Menda, <nm249@cornell.edu>
  • Aureliano Bombarely, <ab782@cornell.edu>
  • Jonathan "Duke" Leto, <jonathan@leto.net>

okay that's the whole page bestie, you ate that. 🫢✨

cute little sign-off for the record: this was perl v5.32.0, dated 2020-12-04, and the manual name is Bio::C...Schema(3pm). keep that in your notes, mwah. πŸ’‹πŸ’…
πŸ“¦ where this page comes from