Genetics
view release on metacpan or search on metacpan
doc/Update.html view on Meta::CPAN
Argument : The Genetics::Object::Subject object to be updated.
Returns : 1 on success, undef otherwise.
Scope : Public
Comments : If Subject.kindredID is modified, the approprate updates are also
made to KindredSubject. In other words, the reciprocal
relationships Kindred->Subjects and Subject->Kindred are kept in
synch.</PRE>
<P>
<H2><A NAME="updatekindred">updateKindred</A></H2>
<PRE>
Function : Update a Genetics::Object::Kindred object in the database.
Argument : The Genetics::Object::Kindred object to be updated.
Returns : 1 on success, undef otherwise.
Scope : Public
Comments : If the set of Subjects contained in a Kindred is modified,
the approprate updates are also made to the Subject.kindredID
field of each of the Subjects. In other words, the reciprocal
relationships Kindred->Subjects and Subject->Kindred are kept
in synch. This only applies to primary Kindreds, of course.</PRE>
<P>
<H2><A NAME="updatemarker">updateMarker</A></H2>
<PRE>
Function : Update a Genetics::Object::Marker object in the database.
Argument : The Genetics::Object::Marker object to be updated.
Returns : 1 on success, undef otherwise.
Scope : Public</PRE>
<P>
<H2><A NAME="updatesnp">updateSNP</A></H2>
<PRE>
Function : Update a Genetics::Object::SNP object in the database.
Argument : The Genetics::Object::SNP object to be updated.
Returns : 1 on success, undef otherwise.
Scope : Public</PRE>
<P>
<H2><A NAME="updategenotype">updateGenotype</A></H2>
<PRE>
Function : Update a Genetics::Object::Genotype object in the database.
Argument : The Genetics::Object::Genotype object to be updated.
Returns : 1 on success, undef otherwise.
Scope : Public</PRE>
<P>
<H2><A NAME="updatestudyvariable">updateStudyVariable</A></H2>
<PRE>
Function : Update a Genetics::Object::StudyVariable object in the database.
Argument : The Genetics::Object::StudyVariable object to be updated.
Returns : 1 on success, undef otherwise.
Scope : Public
Comments : StudyVariable.format cannot be modified.</PRE>
<P>
<H2><A NAME="updatephenotype">updatePhenotype</A></H2>
<PRE>
Function : Update a Genetics::Object::Phenotype object in the database.
Argument : The Genetics::Object::Phenotype object to be updated.
Returns : 1 on success, undef otherwise.
Scope : Public
Comments :
</PRE>
<PRE>
=cut</PRE>
<P>sub updatePhenotype {
my($self, $pt) = @_ ;
my($id, $actualType, $sth, $active, $date, $svFormat, $valueFieldName, $aaListPtr) ;
my $dbh = $self->{dbh} ;
</P>
<PRE>
$DEBUG and carp " ->[updatePhenotype] $pt" ;</PRE>
<PRE>
$id = $pt->field("id") ;
( $actualType ) = $dbh->selectrow_array("select objType from Object
where id = $id") ;
if ( $actualType ne "Phenotype") {
carp " ->[updatePhenotype] Object with ID = $id is not a Phenotype!" ;
return(undef) ;
}
# Object
$self->_updateObjAssocData($pt) ;
# Phenotype
if ( defined($active = $pt->field("isActive")) ) {
$sth = $dbh->prepare( "update Phenotype
set isActive = ?
where ptID = ?" ) ;
$sth->execute($active, $id) ;
$sth->finish() ;
}
if ( defined($date = $pt->field("dateCollected")) ) {
$sth = $dbh->prepare( "update Phenotype
set dateCollected = ?
where ptID = ?" ) ;
if ($date eq "DELETE") {
$sth->execute(undef, $id) ;
} else {
$sth->execute($date, $id) ;
}
$sth->finish() ;
}
( $svFormat ) = $dbh->selectrow_array( "select format from StudyVariable, Phenotype
where ptID = $id
and Phenotype.svID = StudyVariable.studyVariableID" ) ;
$valueFieldName = lc($svFormat) . "Value" ;
$sth = $dbh->prepare( "update Phenotype
set $valueFieldName = ?
where ptID = ?" ) ;
$sth->execute($pt->field("value"), $id) ;
$sth->finish() ;
# Phenotype AssayAttributes
if ( defined ($aaListPtr = $pt->field("AssayAttrs")) ) {
$self->_updateAssayAttrs($aaListPtr, "Phenotype", $id) ;
}
</PRE>
<PRE>
$DEBUG and carp " ->[updatePhenotype] End." ;</PRE>
<PRE>
return(1) ;
}</PRE>
<P>
<H2><A NAME="updatefrequencysource">updateFrequencySource</A></H2>
<PRE>
Function : Update a Genetics::Object::FrequencySource object in the database.
( run in 3.386 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )