Skip to content
Snippets Groups Projects
Commit 1ade13b0 authored by Andreas Kusalananda Kähäri's avatar Andreas Kusalananda Kähäri
Browse files

Added another argument to fetch_by_region():

    Arg [7]    : boolean $no_fuzz
                 If true, do not use "fuzzy matching" (see below).

  This was done to allow the user to by-pass the fuzzy matching code.
  This will allow for some speed increases and to remove any ambiguity
  around the results from this method.

  Also inserted clarifying comment about stickleback DB ('groups' vs.
  'chromosomes') from Anne.
parent 9fc1080e
No related branches found
No related tags found
No related merge requests found
...@@ -135,6 +135,8 @@ sub new { ...@@ -135,6 +135,8 @@ sub new {
The orientation of the slice on the sequence region The orientation of the slice on the sequence region
Arg [6] : string $version (optional, default = default version) Arg [6] : string $version (optional, default = default version)
The version of the coordinate system to use (e.g. NCBI33) The version of the coordinate system to use (e.g. NCBI33)
Arg [7] : boolean $no_fuzz
If true, do not use "fuzzy matching" (see below).
Example : $slice = $slice_adaptor->fetch_by_region('chromosome', 'X'); Example : $slice = $slice_adaptor->fetch_by_region('chromosome', 'X');
$slice = $slice_adaptor->fetch_by_region('clone', 'AC008066.4'); $slice = $slice_adaptor->fetch_by_region('clone', 'AC008066.4');
Description: Retrieves a slice on the requested region. At a minimum the Description: Retrieves a slice on the requested region. At a minimum the
...@@ -156,6 +158,9 @@ sub new { ...@@ -156,6 +158,9 @@ sub new {
example fetch_by_region('clone', 'AC008066') will example fetch_by_region('clone', 'AC008066') will
retrieve the sequence_region with name 'AC008066.4'. retrieve the sequence_region with name 'AC008066.4'.
The fuzzy matching can be turned off by setting the
$no_fuzz argument to a true value.
If the requested seq_region is not found in the database undef If the requested seq_region is not found in the database undef
is returned. is returned.
...@@ -173,8 +178,9 @@ sub new { ...@@ -173,8 +178,9 @@ sub new {
# ARNE: This subroutine needs simplification!! # ARNE: This subroutine needs simplification!!
# #
sub fetch_by_region { sub fetch_by_region {
my ($self, $coord_system_name, $seq_region_name, my ( $self, $coord_system_name, $seq_region_name, $start, $end,
$start, $end, $strand, $version) = @_; $strand, $version, $no_fuzz )
= @_;
$start = 1 if (!defined($start)); $start = 1 if (!defined($start));
$strand = 1 if (!defined($strand)); $strand = 1 if (!defined($strand));
...@@ -188,6 +194,13 @@ sub fetch_by_region { ...@@ -188,6 +194,13 @@ sub fetch_by_region {
$cs = $csa->fetch_by_name($coord_system_name,$version); $cs = $csa->fetch_by_name($coord_system_name,$version);
## REMOVE THESE THREE LINES WHEN STICKLEBACK DB IS FIXED! ## REMOVE THESE THREE LINES WHEN STICKLEBACK DB IS FIXED!
## Anne/ap5 (2007-10-09):
# The problem was that the stickleback genebuild called the
# chromosomes 'groups', which meant they weren't being picked out by
# the karyotype drawing code. Apparently they are usually called
# 'groups' in the stickleback community, even though they really are
# chromosomes!
if( !$cs && $coord_system_name eq 'chromosome' ) { if( !$cs && $coord_system_name eq 'chromosome' ) {
$cs = $csa->fetch_by_name('group',$version); $cs = $csa->fetch_by_name('group',$version);
} }
...@@ -255,6 +268,8 @@ sub fetch_by_region { ...@@ -255,6 +268,8 @@ sub fetch_by_region {
if ($sth->rows() == 0) { if ($sth->rows() == 0) {
$sth->finish(); $sth->finish();
if ($no_fuzz) { return undef }
# do fuzzy matching, assuming that we are just missing a version on # do fuzzy matching, assuming that we are just missing a version on
# the end of the seq_region name # the end of the seq_region name
......
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