Skip to content
Snippets Groups Projects
Commit 81be9bbb authored by Magali Ruffier's avatar Magali Ruffier
Browse files

Merge branch 'master' of https://github.com/Ensembl/ensembl

parents b0ec73eb 89db9c2f
No related branches found
No related tags found
No related merge requests found
## Requirements
- Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion;
- Review the [contributing guidelines](https://github.com/Ensembl/ensembl/blob/release/90/CONTRIBUTING.md#why-could-my-pull-request-be-rejected) for this repository; remember in particular:
- do not modify code without testing for regression
- provide simple unit tests to test the changes
- if you change the schema you must patch the test databases as well, see [Updating the schema](https://github.com/Ensembl/ensembl/blob/release/90/CONTRIBUTING.md#updating-the-schema)
- the PR must not fail unit testing
## Description
_One or more sentences describing in detail the proposed changes._
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut feugiat ligula vel enim congue, nec faucibus turpis ornare. Integer nulla massa, fermentum nec elit a, dapibus luctus ante. Vestibulum eleifend enim et consectetur convallis.
## Use case
_Describe the problem. Please provide an example representing the motivation behind the need for having these changes in place._
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas lobortis aliquet risus id dapibus. In vulputate porta justo. Vestibulum in arcu varius, laoreet urna a, egestas dui.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam ultrices egestas urna, vel mollis felis viverra iaculis. Phasellus ac nisi imperdiet ipsum viverra porta.
## Benefits
_If applicable, describe the advantages the changes will have._
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean eget diam quis leo faucibus sagittis. Sed dapibus, magna ut porttitor malesuada, lorem purus tincidunt magna, ut dignissim mi quam et elit.
## Possible Drawbacks
_If applicable, describe any possible undesirable consequence of the changes._
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras molestie tincidunt quam, id dapibus mauris consequat eu. Phasellus in neque quis purus laoreet malesuada in sit amet tellus.
## Testing
_Have you added/modified unit tests to test the changes?_
Yes.
_If so, do the tests pass/fail?_
Pass, of course.
_Have you run the entire test suite and no regression was detected?_
Yes.
......@@ -320,7 +320,12 @@ sub map_coordinates {
my $self_coord = $pair->{$from};
my $target_coord = $pair->{$to};
# if we haven't even reached the start, move on
if ( $self_coord->{'end'} < $orig_start ) { next;}
# if we have over run, break
if ( $self_coord->{'start'} > $end ) { last;}
#
# But not the case for haplotypes!! need to test for this case???
# so removing this till a better solution is found
......@@ -340,12 +345,6 @@ sub map_coordinates {
$last_target_coord = $target_coord->{'id'};
}
# if we haven't even reached the start, move on
if ( $self_coord->{'end'} < $orig_start ) { next;}
# if we have over run, break
if ( $self_coord->{'start'} > $end ) { last;}
if ( $start < $self_coord->{'start'} ) {
# gap detected
my $gap = Bio::EnsEMBL::Mapper::Gap->new( $start, $self_coord->{'start'} - 1, $rank );
......
......@@ -207,10 +207,13 @@ sub summary_as_hash {
my %summary;
$summary{'type'} = $self->analysis->db;
$summary{'id'} = $self->display_id;
$summary{'start'} = $self->start,
$summary{'end'} = $self->end,
$summary{'start'} = $self->start;
$summary{'end'} = $self->end;
$summary{'interpro'} = $self->interpro_ac;
$summary{'description'} = $self->idesc;
$summary{'hit_start'} = $self->hstart;
$summary{'hit_end'} = $self->hend;
return \%summary;
}
......
......@@ -47,7 +47,9 @@ my $ilabel = 'interpro label';
my $interpro_ac = 'interpro accession';
my $translation_id = 1234;
my $analysis = Bio::EnsEMBL::Analysis->new(-LOGIC_NAME => 'test');
my $analysis_db = 'test_db';
my $analysis = Bio::EnsEMBL::Analysis->new(-LOGIC_NAME => 'test', -DB => $analysis_db);
my $f = Bio::EnsEMBL::ProteinFeature->new
......@@ -94,6 +96,17 @@ ok($f->interpro_ac eq $interpro_ac);
# check that the strand is 0
ok($f->strand == 0);
# Test summary_as_hash
my $summary = $f->summary_as_hash();
ok($summary->{'type'} = $analysis_db);
ok($summary->{'id'} = $hseqname);
ok($summary->{'start'} = $start);
ok($summary->{'end'} = $end);
ok($summary->{'interpro'} = $interpro_ac);
ok($summary->{'description'} = $idesc);
ok($summary->{'hit_start'} = $hstart);
ok($summary->{'hit_end'} = $hend);
#
# Test setters
#
......
......@@ -40,7 +40,7 @@ my $pfs = $pfa->fetch_all_by_translation_id(21724);
print_features($pfs);
is(@$pfs, 15, "Found 15 features");
ok(@$pfs == 15);
sub print_features {
my $features = shift;
......@@ -68,7 +68,9 @@ my $hdes = "Hit description";
my $idesc = 'interpro description';
my $interpro_ac = 'interpro accession';
my $analysis = Bio::EnsEMBL::Analysis->new(-LOGIC_NAME => 'test');
my $analysis_db = 'test_db';
my $analysis = Bio::EnsEMBL::Analysis->new(-LOGIC_NAME => 'test', -DB => $analysis_db);
$multi->save('core', 'protein_feature', 'meta_coord');
......@@ -88,6 +90,17 @@ my $f = Bio::EnsEMBL::ProteinFeature->new
-IDESC => $idesc,
-INTERPRO_AC => $interpro_ac);
my $summary = $f->summary_as_hash();
is($summary->{'type'}, $analysis_db);
is($summary->{'id'}, $hseqname);
is($summary->{'start'}, $start);
is($summary->{'end'}, $end);
is($summary->{'interpro'}, $interpro_ac);
is($summary->{'description'}, $idesc);
is($summary->{'hit_start'}, $hstart);
is($summary->{'hit_end'}, $hend);
my $dbID = $pfa->store($f,21724);
ok($dbID, "New object created has dbID");
......@@ -106,13 +119,13 @@ is($f_by_dbID->hend, $hend);
is($f_by_dbID->hseqname, $hseqname);
is($f_by_dbID->hdescription, $hdes);
is($f_by_dbID->score, $score);
is(sprintf("%.6f", $f_by_dbID->percent_id), sprintf("%.6f", $percent_id), "Correct percent_id");
is(sprintf("%.6f", $f_by_dbID->p_value), sprintf("%.6f", $p_value), "Correct p_value");
is($f_by_dbID->percent_id, $percent_id);
is($f_by_dbID->p_value, $p_value);
$pfs = $pfa->fetch_all_by_translation_id(21724);
is(@$pfs, 16, "Found 16 features");
ok(@$pfs == 16);
my @pfs = grep{$_->hdescription() eq $hdes} @$pfs;
......
......@@ -55,7 +55,9 @@ fi
# The list of downstream dependent repos
dep_repos=("Ensembl%2Fensembl%2Dcompara"
"Ensembl%2Fensembl%2Dvariation"
"Ensembl%2Fensembl%2Dfuncgen"
"Ensembl%2Fensembl%2Dvep"
"Ensembl%2Fensembl%2Drest")
for dep_repo in "${dep_repos[@]}"; do
......
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