Skip to content
Snippets Groups Projects
Commit a03738a6 authored by Ian Longden's avatar Ian Longden
Browse files

added is_ref to see if gene is the reference gene

parent cada933e
No related branches found
No related tags found
No related merge requests found
......@@ -942,6 +942,23 @@ sub fetch_all_alt_alleles {
return [];
}
sub is_ref{
my ( $self, $gene_id) = @_;
my $is_not_ref;
# easier to find if it is not an alt_Allele do this and then negate it.
my $sth = $self->prepare("select count(1) from alt_allele where gene_id = $gene_id and is_ref = 0");
$sth->execute();
$sth->bind_columns(\$is_not_ref);
$sth->fetch;
if(defined($is_not_ref) and $is_not_ref){
return 0;
}
return 1;
}
=head2 store_alt_alleles
......
......@@ -1468,6 +1468,27 @@ sub load {
}
}
=head2 is_ref
Description: getter setter for the gene attribute is_ref
Arg [1] : (optional) 1 or 0
return : boolean
=cut
sub is_reference{
my ( $self, $is_ref) = @_;
if(defined($is_ref)){
$self->{'is_ref'} = $is_ref;
}
else{
$self->{'is_ref'} = $self->adaptor->is_ref($self->dbID);
}
return $self->{'is_ref'};
}
=head2 summary_as_hash
Example : $gene_summary = $gene->summary_as_hash();
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment