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

πŸ’– NAME πŸ’–

Bio::Chado::Schema::Util β€” bestie, it's the utility functions shared by Bio::Chado::Schema objects 🫢


✨ SYNOPSIS ✨

okay so here's the vibe, a little taste of how you'd actually use it:

sub create_organismprops {
    my ($self, $props, $opts) = @_;

    # process opts
    $opts ||= {};
    $opts->{cv_name} = 'organism_property'
        unless defined $opts->{cv_name};

    return Bio::Chado::Schema::Util->create_props
        ( properties => $props,
          options    => $opts,
          row        => $self,
          prop_relation_name => 'organismprops',
        );
}

🌸 DESCRIPTION 🌸

These are the helper functions that a bunch of the schema classes are all sharing, like a group chat of utilities πŸ’…

Important Note: this package lives inside the Schema.pm file as a secondary package, and it does not have a file of its own. But don't stress β€” the use is literally the same. She's hiding in there, but she's fully functional 🧚

πŸ‘‘ PACKAGE METHODS πŸ‘‘

πŸŽ€ create_properties

Usage: *::Util->create_properties( row => $self,
                                   properties => { baz => 2, foo => 'bar' },
                                   options => { cv_name => autocreate => 0, ...},
                                   prop_relation_name => 'organismprops',
                                 );

Desc : Chado has a number of <thing>prop tables with a similar
       structure.  This utility function is used by a number of
       modules to create properties in these kinds of tables.

Args : row => the DBIC row object to create properties for,
       prop_relation_name => the DBIC relation name for the
                             properties table to operate on,
                             e.g. 'featureprops',
       properties => hashref of { propname => value, ...},
       options => options hashref as:
           {
             autocreate => 0,
                (optional) boolean, if passed, automatically create cv,
                cvterm, and dbxref rows if one cannot be found for the
                given featureprop name.  Default false.

             cv_name => cv.name to use for the given featureprops.
                        Defaults to 'feature_property',

             db_name => db.name to use for autocreated dbxrefs,
                        default 'null',

             allow_duplicate_values => default false.
                 If true, allow duplicate instances of the same cvterm
                 and value in the properties of the feature.  Duplicate
                 values will have different ranks.

             dbxref_accession_prefix => optional, default
                                        'autocreated:',
             definitions => optional hashref of:
                 { cvterm_name => definition,
                 }
              to load into the cvterm table when autocreating cvterms
           }
Ret  : hashref of { propname => new row object in property table }

let me break this icon down for you πŸ¦‹

  • row β€” the DBIC row object you're creating properties for. that's your main character, the row in question πŸ’…
  • prop_relation_name β€” the DBIC relation name for the properties table you wanna operate on, like 'featureprops' πŸ“
  • properties β€” a hashref of { propname => value, ...}, your actual data, slay
  • options β€” the options hashref, and it's giving very configurable:
    • autocreate β€” (optional) boolean. if you pass it, it'll automatically create cv, cvterm, and dbxref rows when one can't be found for the given featureprop name. default is false ✨
    • cv_name β€” the cv.name to use for the given featureprops. defaults to 'feature_property' πŸ’–
    • db_name β€” the db.name to use for autocreated dbxrefs, default 'null' 😭
    • allow_duplicate_values β€” default false. if true, you're allowed duplicate instances of the same cvterm and value in the properties of the feature. and lowkey important: duplicate values will have different ranks. periodt πŸ‘‘
    • dbxref_accession_prefix β€” optional, default 'autocreated:' 🌈
    • definitions β€” optional hashref of:
{ cvterm_name => definition,
}

to load into the cvterm table when autocreating cvterms 🧚

  • Returns: a hashref of { propname => new row object in property table } β€” so you get your shiny new rows back, no cap πŸ’œ

🌟 AUTHOR 🌟

  • Robert Buels, <rmb32@cornell.edu>
  • Naama Menda, <naama.menda@gmail.com>

and that's the whole page bestie, no crumbs left πŸ’… this little legend was served up by perl v5.32.0 on 2020-12-04, and the manual page is Bio::C...::Util(3pm) πŸŽ€ go forth and create those properties, you absolute icon πŸ¦‹β­

πŸ“¦ where this page comes from