Insert.pm

- NAME
- SYNOPSIS
- DESCRIPTION
- LICENSE
- FEEDBACK
- AUTHOR - Steve Mathias
- DETAILS
- Imported Packages
- Inheritance
- Public Methods

- insertCluster
- insertSubject
- insertKindred
- setSubjectSubjectReferences
- setSubjectKindredReferences
- setKindredSubjectReferences
- insertMarker
- insertSNP
- insertGenotype
- insertStudyVariable
- insertPhenotype
- insertFrequencySource
- insertHtMarkerCollection
- insertHaplotype
- insertDNASample
- insertTissueSample
- insertMap

- Private methods

- _insertObjectData
- _insertAssayAttrs

# NAME

Genetics::API::DB::Insert

# SYNOPSIS

      use Genetics::API ;

      $api = new Genetics::API(DSN => {driver => "mysql",
                                       host => $Host,
                                       database => $Database},
                               user => $UserName,
                               password => $Password) ;

      $snp = new Genetics::SNP( %init ) ;

      $id = $api->insertSNP($snp) ;

# DESCRIPTION

The Genetics::API::DB packages provide an interface for the manipulation of Genperl objects in a relational database. This package contains the methods for saving new objects (i.e. objects that have not been previously saved to the database). To update objects that have already been saved in the database, see Genetics::API::DB::Update. A better name for this package would probably be Genetics::API::DB::Insert.

# LICENSE

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

# FEEDBACK

Currently, all feedback should be sent directly to the author.

# AUTHOR - Steve Mathias

Email: mathias@genomica.com

Phone: (720) 565-4029

Address: Genomica Corporation 1745 38th Street Boulder, CO 80301

# DETAILS

The rest of the documentation describes each of the object variables and methods. The names of internal variables and methods are preceded with an underscore (_).

# Imported Packages

     strict             Just to be anal
     vars               Global variables
     Carp               Error reporting

# Inheritance

     Exporter           Make methods available to importing packages

# Public Methods

## insertCluster

      Function  : Insert (create) a Genetics::Object::Cluster object to the database.
      Argument  : A Genetics::Object::Cluster object.
      Returns   : The id of the inserted object.
      Scope     : Public
      Comments  : Objects must be inserted before Clusters or this method will not be
                  able to set references to the Objects in a Cluster.

## insertSubject

      Function  : Insert (create) a Genetics::Object::Subject object to the database.
      Argument  : A Genetics::Object::Subject object.
      Returns   : The id of the inserted object.
      Scope     : Public

## insertKindred

      Function  : Insert (create) a Genetics::Object::Kindred object to the database.
      Argument  : A Genetics::Object::Kindred object.
      Returns   : The id of the inserted object.
      Scope     : Public
      Comments  : Subjects must be inserted before Kindreds or this method will not be
                  able to set references to the Subjects in a Kindred.

## setSubjectSubjectReferences

      Function  : Sets mother/father references between Subjects based on the
                  'Mother ImportID' and 'Father ImportID' Keywords associated
                  with the Subjects.
      Argument  : An array reference to a list of Subject IDs.
      Returns   : N/A
      Scope     : Public
      Comments  : The fields that are updated by this method are:
                       Subject.motherID
                       Subject.fatherID

## setSubjectKindredReferences

      Function  : Sets references between Subjects and Kindreds based on the
                  'Kindred ImportID' Keywords associated with the Subjects.
      Argument  : An array reference to a list of Subject IDs.
      Returns   : N/A
      Scope     : Public
      Comments  : A Subject can get its Kindred reference in two possible ways:
                  from Subject->field('Kindred') or
                  from Kindred->field('Subjects').  This method sets references
                  based on the former.  To set references based on the latter,
                  use setKindredSubjectReferences.

                  The fields that are updated by this method are:
                       Subject.kindredID
                       KindredSubject.kindredID
                       KindredSubject.SubjectID

## setKindredSubjectReferences

      Function  : Sets references between Subjects and Kindreds based on the
                  'Subjects ImportID' Keywords associated with the Kindreds.
      Argument  : An array reference to a list of Kindred IDs.
      Returns   : N/A
      Scope     : Public
      Comments  : A Subject can get its Kindred reference in two possible ways:
                  from Subject->field('Kindred') or
                  from Kindred->field('Subjects').  This method sets references
                  based on the latter.  To set references based on the former, use
                  setSubjectKindredReferences.

                  The fields that are updated by this method are:
                       Subject.kindredID
                       KindredSubject.kindredID
                       KindredSubject.SubjectID

## insertMarker

      Function  : Insert (create) a Genetics::Object::Marker object to the database.
      Argument  : A Genetics::Object::Marker object.
      Returns   : The id of the inserted object.
      Scope     : Public
      Comments  :

## insertSNP

      Function  : Insert (create) a Genetics::Object::SNP object to the database.
      Argument  : A Genetics::Object::SNP object.
      Returns   : The id of the inserted object.
      Scope     : Public
      Comments  :

## insertGenotype

      Function  : Insert (create) a Genetics::Object::Genotype object to the database.
      Argument  : A Genetics::Object::Genotype object.
      Returns   : The id of the inserted object.
      Scope     : Public
      Comments  :

## insertStudyVariable

      Function  : Insert (create) a Genetics::Object::StudyVariable object to the database.
      Argument  : A Genetics::Object::StudyVariable object.
      Returns   : The id of the inserted object.
      Scope     : Public
      Comments  :

## insertPhenotype

      Function  : Insert (create) a Genetics::Object::Phenotype object to the database.
      Argument  : A Genetics::Object::Phenotype object.
      Returns   : The id of the inserted object.
      Scope     : Public
      Comments  :

## insertFrequencySource

      Function  : Insert (create) a Genetics::Object::FrequencySource object to the database.
      Argument  : A Genetics::Object::FrequencySource object.
      Returns   : The id of the inserted object.
      Scope     : Public
      Comments  :

## insertHtMarkerCollection

      Function  : Insert (create) a Genetics::Object::HtMarkerCollection object to the database.
      Argument  : A Genetics::Object::HtMarkerCollection object.
      Returns   : The id of the inserted object.
      Scope     : Public
      Comments  :

## insertHaplotype

      Function  : Insert (create) a Genetics::Object::Haplotype object to the database.
      Argument  : A Genetics::Object::Haplotype object.
      Returns   : The id of the inserted object.
      Scope     : Public
      Comments  :

## insertDNASample

      Function  : Insert (create) a Genetics::Object::DNASample object to the database.
      Argument  : A Genetics::Object::DNASample object.
      Returns   : The id of the inserted object.
      Scope     : Public
      Comments  :

## insertTissueSample

      Function  : Insert (create) a Genetics::Object::TissueSample object to the database.
      Argument  : A Genetics::Object::TissueSample object.
      Returns   : The id of the inserted object.
      Scope     : Public
      Comments  :

## insertMap

      Function  : Insert (create) a Genetics::Object::Map object to the database.
      Argument  : A Genetics::Object::Map object.
      Returns   : The id of the inserted object.
      Scope     : Public
      Comments  :

# Private methods

## _insertObjectData

      Function  : Insert data common to all Genetics::Object objects to the database.
      Argument  : A GNOM-API object and a Genetics::Object object.
      Returns   : The Object.id of the row inserted into the Object table.
      Scope     : Private
      Called by : The various insertObjectSubClass methods.

## _insertAssayAttrs

      Function  : Insert AssayAttributes associated with a Genotype, AlleleCall or
                  Phenotype.
      Arguments : Array reference to the list of AssayAttributes, scalar
                  containing the type of object with which the AssayAttributes
                  are associated, and another scalar containing the id of that
                  object.
      Returns   : N/A
      Scope     : Private
      Called by :
      Comments  :