4 CXGN::Chado::FeatureLoc - a database wrapper class for the Chado featureloc table
8 The featureloc table is used to map features onto other features, for example, exons on genomic sequence, or domains on proteins. The meaning of the database fields in the featureloc table has been reverse engineered to mean the following:
12 =item featureloc_id: primary key
14 =item feature_id: the feature that is being mapped (let's called f1)
16 =item srcfeature_id: the feature we're mapping on (let's call it f2)
18 =item fmin: the start coordinate of f1 on f2
20 =item is_fmin_partial: is f2 truncated?
22 =item fmax: the end coordinate of f1 on f2
24 =item is_fmax_partial: is f2 truncated?
26 =item strand: either -1,-2,-3,1,2,3
28 =item phase: the phase for protein coding exons
30 =item residue_info: this is possibly used for snps (?)
40 Lukas Mueller <lam87@cornell.edu>
44 This class implements the following methods:
52 package CXGN
::Chado
::FeatureLoc
;
56 use base
"CXGN::DB::Object";
75 my $self = $class->SUPER::new
($dbh);
78 $self->set_featureloc_id($id);
100 my $query = "SELECT featureloc_id, feature_id, srcfeature_id, fmin, is_fmin_partial, famx, is_fmax_partial, strand, phase, residue_info, locgroup, rank FROM
101 featureloc WHERE featureloc_id=?";
102 my $sth = $self->get_dbh()->prepare($query);
103 $sth->execute($self->get_featureloc_id());
104 my ($featureloc_id, $feature_id, $srcfeature_id, $fmin, $is_fmin_partial, $fmax, $is_fmax_partial, $strand, $phase, $residue_info, $locgroup, $rank) = $sth->fetchrow_array();
105 $self->set_featureloc_id($featureloc_id);
106 $self->set_feature_id($feature_id);
107 $self->set_scrfeature_id($srcfeature_id);
108 $self->set_fmin($fmin);
109 $self->set_is_fmin_partial($is_fmin_partial);
110 $self->set_fmax($fmax);
111 $self->set_is_fmax_partial($is_fmax_partial);
112 $self->set_strand($strand);
113 $self->set_phase($phase);
114 $self->set_residue_info($residue_info);
115 $self->set_locgroup($locgroup);
116 $self->set_rank($rank);
133 if ($self->get_featureloc_id()) {
134 my $query = "UPDATE featureloc SET
135 feature_id=?, srcfeature_id=?, fmin=?, is_fmin_partial=?, fmax=?, is_fmax_partial=?, strand=?, phase=?, residue_info=?, locgroup=?, rank=? WHERE featureloc_id=?";
136 my $sth = $self->get_dbh()->prepare($query);
137 $sth->execute($self->get_feature_id(),
138 $self->get_srcfeature_id(),
140 $self->get_is_fmin_partial(),
142 $self->get_is_fmax_partial(),
145 $self->get_residue_info(),
146 $self->get_locgroup(),
148 $self->get_featureloc_id(),
150 return $self->get_featureloc_id();
153 my $query = "INSERT INTO featureloc (feature_id, srcfeature_id, fmin, is_fmin_partial, fmax, is_fmax_partial, strand, phase, residue_info, locgroup, rank) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
154 my $sth = $self->get_dbh()->prepare($query);
155 $sth->execute( $self->get_feature_id(),
156 $self->get_srcfeature_id(),
158 $self->get_is_fmin_partial(),
160 $self->get_is_fmax_partial(),
163 $self->get_residue_info(),
164 $self->get_locgroup(),
167 my $id = $self->get_currval("featureloc_featureloc_id_seq");
168 $self->set_featureloc_id($id);
173 =head2 accessors get_featureloc_id, set_featureloc_id
183 sub get_featureloc_id
{
185 return $self->{featureloc_id
};
188 sub set_featureloc_id
{
190 $self->{featureloc_id
} = shift;
193 =head2 accessors get_feature_id, set_feature_id
205 return $self->{feature_id
};
210 $self->{feature_id
} = shift;
213 =head2 accessors get_srcfeature_id, set_srcfeature_id
223 sub get_srcfeature_id
{
225 return $self->{srcfeature_id
};
228 sub set_srcfeature_id
{
230 $self->{srcfeature_id
} = shift;
233 =head2 accessors get_fmin, set_fmin
245 return $self->{fmin
};
250 $self->{fmin
} = shift;
253 =head2 accessors get_is_fmin_partial, set_is_fmin_partial
263 sub get_is_fmin_partial
{
265 if (!exists($self->{is_fmin_partial
}) || !defined($self->{is_fmin_partial
})) {
266 $self->{is_fmin_partial
}='f';
268 return $self->{is_fmin_partial
};
271 sub set_is_fmin_partial
{
273 $self->{is_fmin_partial
} = shift;
276 =head2 accessors get_fmax, set_fmax
288 return $self->{fmax
};
293 $self->{fmax
} = shift;
296 =head2 accessors get_is_fmax_partial, set_is_fmax_partial
306 sub get_is_fmax_partial
{
308 if (!exists($self->{is_fmax_partial
})||!defined($self->{is_fmax_partial
})) {
309 $self->{is_fmax_partial
}='f';
311 return $self->{is_fmax_partial
};
314 sub set_is_fmax_partial
{
316 $self->{is_fmax_partial
} = shift;
319 =head2 accessors get_strand, set_strand
331 return $self->{strand
};
336 $self->{strand
} = shift;
339 =head2 accessors get_phase, set_phase
351 return $self->{phase
};
356 $self->{phase
} = shift;
359 =head2 accessors get_residue_info, set_residue_info
369 sub get_residue_info
{
371 return $self->{residue_info
};
374 sub set_residue_info
{
376 $self->{residue_info
} = shift;
379 =head2 accessors get_locgroup, set_locgroup
391 if (!exists($self->{locgroup
}) || !defined($self->{locgroup
})) {
394 return $self->{locgroup
};
399 $self->{locgroup
} = shift;
402 =head2 accessors get_rank, set_rank
414 if (!exists($self->{rank
}) || !defined($self->{rank
})) {
417 return $self->{rank
};
422 $self->{rank
} = shift;