Commit 03dc7d28 authored by Laura Clarke's avatar Laura Clarke
Browse files

made sure seqname was maintained in alignfeatures and corrected an error message in SliceAdaptor
parent 826b4044
......@@ -125,12 +125,13 @@ sub new {
throw("CIGAR_STRING or FEATURES argument is required - not both.");
} elsif (defined($features)) {
$self->_parse_features($features);
} elsif (defined($cigar_string)) {
$self->{'cigar_string'} = $cigar_string;
} else {
throw("CIGAR_STRING or FEATURES argument is required");
}
return $self;
}
......@@ -427,7 +428,7 @@ sub _parse_features {
my $percent = $f[0]->percent_id;
my $analysis = $f[0]->analysis;
my $pvalue = $f[0]->p_value();
my $seqname = $f[0]->seqname;
# implicit strand 1 for peptide sequences
$strand ||= 1;
$hstrand ||= 1;
......@@ -501,7 +502,10 @@ sub _parse_features {
throw("Inconsistant p_values in feature arraw [$pvalue " .
$f->p_value() . "]");
}
if($seqname && $seqname ne $f->seqname){
throw("Inconsistent seqname in feature array [$seqname - ".
$f->seqname . "]");
}
my $start1 = $f->start; #source sequence alignment start
my $start2 = $f->hstart(); #hit sequence alignment start
......@@ -652,6 +656,7 @@ sub _parse_features {
$self->{'start'} = $f1start;
$self->{'end'} = $f1end;
$self->{'seqname'} = $seqname;
$self->{'strand'} = $strand;
$self->{'score'} = $score;
$self->{'percent_id'} = $percent;
......
......@@ -159,13 +159,13 @@ sub fetch_by_region {
my $sth = $self->prepare("SELECT seq_region_id, length " .
"FROM seq_region " .
"WHERE name = ? AND coord_system_id = ?");
#force seq_region_name cast to string so mysql cannot treat as int
$sth->execute("$seq_region_name", $coord_system->dbID());
if($sth->rows() == 0) {
$sth->finish();
#do fuzzy matching, assuming that we are just missing a version on
#the end of the seq_region name
......@@ -269,12 +269,11 @@ sub fetch_by_name {
if(@array != 6) {
throw("Malformed slice name [$name]. Format is " .
"coord_system:version:start:end:strand");
"coord_system:version:name:start:end:strand");
}
my ($cs_name, $cs_version, $seq_region, $start, $end, $strand) = @array;
return $self->fetch_by_region($cs_name,$seq_region, $start,
$end, $strand, $cs_version);
}
......
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