Genetics

 view release on metacpan or  search on metacpan

doc/Read.html  view on Meta::CPAN

  Argument  : The Object ID of the Genotype to be returned.
  Returns   : A Genetics::Object::Genotype object.
  Scope     : Public
  Comments  : "Light" version means that the object has only the name and id 
              fields from Object, and it does not contain any associated NameAlias, 
              Contact, DBXReference or Keyword data.  It also has a sub-set of 
              Genotype-specific fields.</PRE>
<P>
<H2><A NAME="getstudyvariable">getStudyVariable</A></H2>
<PRE>
  Function  : Get (read) a Genetics::Object::StudyVariable object from the database.
  Argument  : The Object ID of the StudyVariable to be returned.
  Returns   : A Genetics::Object::StudyVariable object.
  Scope     : Public</PRE>
<P>
<H2><A NAME="getministudyvariable">getMiniStudyVariable</A></H2>
<PRE>
  Function  : Get a &quot;light&quot; version of a Genetics::Object::StudyVariable object 
              from the database.
  Argument  : The Object ID of the StudyVariable to be returned.
  Returns   : A Genetics::Object::StudyVariable object.
  Scope     : Public
  Comments  : &quot;Light&quot; version means that the object has only the name and id 
              fields from Object, and it does not contain any associated NameAlias, 
              Contact, DBXReference or Keyword data.  It also has a sub-set of 
              StudyVariable-specific fields.
=cut</PRE>
<P>sub getMiniStudyVariable {
  my($self, $id) = @_ ;
  my($sv, %param, $sth, $sth1, $arrRef, $arrRef1, %init, %init1, $category, 
     $format, @codesList, @aseList, @lcList, $p11, $p12, $p22, $mp1, $mp2) ;
  my $dbh = $self-&gt;{dbh} ;
</P>
<PRE>

  $DEBUG and carp &quot; -&gt;[getMiniStudyVariable] $id&quot; ;</PRE>
<PRE>
  # StudyVariable data
  $sth = $dbh-&gt;prepare(&quot;select name, id, dateCreated, dateModified, comment, 
                               category, format, isXLinked, description 
                        from Object, StudyVariable 
                        where id = $id 
                        and id = studyVariableID&quot;) ;
  $sth-&gt;execute() ;
  $arrRef = $sth-&gt;fetchrow_arrayref() ;
  $sth-&gt;finish() ;
  defined $arrRef or return(undef) ;</PRE>
<PRE>
  $param{name} = $$arrRef[0] ;
  $param{id} = $$arrRef[1] ;
  $param{dateCreated} = $$arrRef[2] ;
  $param{dateModified} = $$arrRef[3] ;
  $param{comment} = $$arrRef[4] ;
  $category = $param{category} = $$arrRef[5] ;
  $format = $param{format} = $$arrRef[6] ;
  $param{isXLinked} = $$arrRef[7] ;
  defined $$arrRef[8] and $param{description} = $$arrRef[8] ;
  # CodeDerivation data
  if ($format eq &quot;Code&quot;) {
    if ($category eq &quot;StaticLiabilityClass&quot;) {
      $sth = $dbh-&gt;prepare(&quot;select codeDerivationID, code, description, formula 
                          from CodeDerivation 
                          where studyVariableID = $id&quot;) ;
      $sth-&gt;execute() ;
      $sth1 = $dbh-&gt;prepare(&quot;select pen11, pen12, pen22, malePen1, malePen2 
                             from StaticLCPenetrance 
                             where cdID = ?&quot;) ;
      while ($arrRef = $sth-&gt;fetchrow_arrayref()) {
        %init = () ;
        $sth1-&gt;execute($$arrRef[0]) ;
        ($p11, $p12, $p22, $mp1, $mp2) = $sth1-&gt;fetchrow_array() ;
        $init{code} = $$arrRef[1] ;
        $init{pen11} = $p11 ;
        $init{pen12} = $p12 ;
        $init{pen22} = $p22 ;
        defined $mp1 and $init{malePen1} = $mp1 ;
        defined $mp2 and $init{malePen2} = $mp2 ;
        defined $$arrRef[2] and $init{description} = $$arrRef[2] ;
        defined $$arrRef[3] and $init{formula} = $$arrRef[3] ;
        push(@codesList, { %init }) ;
      }
    } else {
      $sth = $dbh-&gt;prepare(&quot;select code, description, formula 
                            from CodeDerivation 
                            where studyVariableID = $id&quot;) ;
      $sth-&gt;execute() ;
      while ($arrRef = $sth-&gt;fetchrow_arrayref()) {
        %init = () ;
        $init{code} = $$arrRef[0] ;
        defined $$arrRef[1] and $init{description} = $$arrRef[1] ;
        defined $$arrRef[2] and $init{formula} = $$arrRef[2] ;
        push(@codesList, { %init }) ;
      }
    }
  }
  defined $codesList[0] and $param{Codes} = \@codesList ;
</PRE>
<PRE>

  if ($category =~ /AffectionStatus$/) {
    # AffectionStatus data
    $sth = $dbh-&gt;prepare(&quot;select name, diseaseAlleleFreq, pen11, pen12, 
                                 pen22, malePen1, malePen2, asDefID 
                          from AffectionStatusDefinition 
                          where studyVariableID = $id&quot;) ;
    $sth-&gt;execute() ;
    if ( defined ($arrRef = $sth-&gt;fetchrow_arrayref()) ) {
      %init = () ;
      $init{name} = $$arrRef[0] ;
      $init{diseaseAlleleFreq} = $$arrRef[1] ;
      $init{pen11} = $$arrRef[2] ;
      $init{pen12} = $$arrRef[3] ;
      $init{pen22} = $$arrRef[4] ;
      defined $$arrRef[5] and $init{malePen1} = $$arrRef[5] ;
      defined $$arrRef[6] and $init{malePen2} = $$arrRef[6] ;
      # Elements
      $sth1 = $dbh-&gt;prepare(&quot;select code, type, formula 
                             from AffectionStatusElement 
                             where asDefID = $$arrRef[7]&quot;) ;
      $sth1-&gt;execute() ;
      while ($arrRef1 = $sth1-&gt;fetchrow_arrayref()) {
        push(@aseList, {code =&gt; $$arrRef1[0],
                        type =&gt; $$arrRef1[1],
                        formula =&gt; $$arrRef1[2]}) ;
      }
      $init{AffStatElements} = \@aseList ;
      $param{AffStatDef} = { %init } ;
    }
  }</PRE>
<PRE>
  $sv = new Genetics::StudyVariable(%param) ;
</PRE>
<PRE>

  $DEBUG and carp &quot; -&gt;[getMiniStudyVariable] $sv&quot; ;</PRE>
<PRE>
  return($sv) ;
}</PRE>
<P>
<H2><A NAME="getphenotype">getPhenotype</A></H2>
<PRE>
  Function  : Get (read) a Genetics::Object::Phenotype object from the database.
  Argument  : The Object ID of the Phenotype to be returned.
  Returns   : A Genetics::Object::Phenotype object.
  Scope     : Public</PRE>
<P>
<H2><A NAME="getminiphenotype">getMiniPhenotype</A></H2>
<PRE>
  Function  : Get a &quot;light&quot; version of a Genetics::Object::Phenotype object from 
              the database.
  Argument  : The Object ID of the Phenotype to be returned.
  Returns   : A Genetics::Object::Phenotype object.
  Scope     : Public
  Comments  : &quot;Light&quot; version means that the object has only the name and id 
              fields from Object, and it does not contain any associated NameAlias, 
              Contact, DBXReference or Keyword data.  It also has a sub-set of 
              Phenotype-specific fields.</PRE>
<P>
<H2><A NAME="getfrequencysource">getFrequencySource</A></H2>
<PRE>
  Function  : Get (read) a Genetics::Object::FrequencySource object from the database.
  Argument  : The Object ID of the FrequencySource to be returned.
  Returns   : A Genetics::Object::FrequencySource object.
  Scope     : Public</PRE>
<P>
<H2><A NAME="getminifrequencysource">getMiniFrequencySource</A></H2>
<PRE>
  Function  : Get (read) a Genetics::Object::FrequencySource object from the database.
  Argument  : The Object ID of the FrequencySource to be returned.
  Returns   : A Genetics::Object::FrequencySource object.
  Scope     : Public</PRE>
<P>
<H2><A NAME="gethtmarkercollection">getHtMarkerCollection</A></H2>
<PRE>
  Function  : Get (read) a Genetics::Object::HtMarkerCollection object from the database.
  Argument  : The Object ID of the HtMarkerCollection to be returned.
  Returns   : A Genetics::Object::HtMarkerCollection object.
  Scope     : Public</PRE>
<P>
<H2><A NAME="gethaplotype">getHaplotype</A></H2>
<PRE>
  Function  : Get (read) a Genetics::Object::Haplotype object from the database.
  Argument  : The Object ID of the Haplotype to be returned.
  Returns   : A Genetics::Object::Haplotype object.



( run in 3.283 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )