Commit dd4fb292 authored by Arne Stabenau's avatar Arne Stabenau
Browse files

didnt use dnadb set in db now it does.

So it get sequence for sanger/estgenes (in theory)
parent 4dbd4d41
......@@ -71,12 +71,14 @@ sub fetch_by_contig_id_start_end_strand {
$self->throw( "Wrong parameters" );
}
my $query;
if( $end == -1 ) {
$sth = $self->prepare( "SELECT c.length, SUBSTRING( d.sequence, $start )
FROM dna d, contig c
WHERE d.dna_id = c.dna_id
AND c.contig_id = $contig_id" );
$query = "SELECT c.length, SUBSTRING( d.sequence, $start )
FROM dna d, contig c
WHERE d.dna_id = c.dna_id
AND c.contig_id = $contig_id";
} else {
my $length = $end - $start + 1;
......@@ -84,12 +86,19 @@ sub fetch_by_contig_id_start_end_strand {
$self->throw( "Wrong parameters" );
}
$sth = $self->prepare( "SELECT c.length, SUBSTRING( d.sequence, $start, $length )
FROM dna d, contig c
WHERE d.dna_id = c.dna_id
AND c.contig_id = $contig_id" );
$query = "SELECT c.length, SUBSTRING( d.sequence, $start, $length )
FROM dna d, contig c
WHERE d.dna_id = c.dna_id
AND c.contig_id = $contig_id";
}
if( defined $self->db()->dnadb() ) {
$sth = $self->db()->dnadb()->prepare( $query );
} else {
$sth = $self->prepare( $query );
}
$sth->execute();
if( my $aref = $sth->fetchrow_arrayref() ) {
......
Markdown is supported
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