Commit 219a8f2f authored by Andreas Kusalananda Kähäri's avatar Andreas Kusalananda Kähäri
Browse files

Merge from branch-featurecollection-dev:

In all the feature adaptors, use either _create_feature() or
_create_feature_fast() from BaseFeatureAdaptor in _objs_from_sth() to
create features.
parent 282ea98d
......@@ -448,15 +448,19 @@ sub _objs_from_sth {
$slice = $dest_slice;
}
push @features, Bio::EnsEMBL::DensityFeature->new
(-dbID => $density_feature_id,
-adaptor => $self,
-start => $seq_region_start,
-end => $seq_region_end,
-seq_region => $slice,
-density_value => $density_value,
-density_type => $density_type);
push( @features,
$self->_create_feature( 'Bio::EnsEMBL::DensityFeature', {
-dbID => $density_feature_id,
-adaptor => $self,
-start => $seq_region_start,
-end => $seq_region_end,
-seq_region => $slice,
-density_value => $density_value,
-density_type => $density_type
} ) );
}
return \@features;
}
......
......@@ -344,25 +344,29 @@ sub _objs_from_sth {
$slice = $dest_slice;
}
#finally, create the new dna align feature
push @features, Bio::EnsEMBL::DnaDnaAlignFeature->new_fast
( { 'slice' => $slice,
'start' => $seq_region_start,
'end' => $seq_region_end,
'strand' => $seq_region_strand,
'hseqname' => $hit_name,
'hstart' => $hit_start,
'hend' => $hit_end,
'hstrand' => $hit_strand,
'score' => $score,
'p_value' => $evalue,
'percent_id' => $perc_ident,
'cigar_string' => $cigar_line,
'analysis' => $analysis,
'adaptor' => $self,
'dbID' => $dna_align_feature_id,
'external_db_id'=> $external_db_id,
'hcoverage' => $hcoverage } );
# Finally, create the new DnaAlignFeature.
push( @features,
$self->_create_feature_fast(
'Bio::EnsEMBL::DnaDnaAlignFeature', {
'slice' => $slice,
'start' => $seq_region_start,
'end' => $seq_region_end,
'strand' => $seq_region_strand,
'hseqname' => $hit_name,
'hstart' => $hit_start,
'hend' => $hit_end,
'hstrand' => $hit_strand,
'score' => $score,
'p_value' => $evalue,
'percent_id' => $perc_ident,
'cigar_string' => $cigar_line,
'analysis' => $analysis,
'adaptor' => $self,
'dbID' => $dna_align_feature_id,
'external_db_id' => $external_db_id,
'hcoverage' => $hcoverage
} ) );
}
return \@features;
......
......@@ -616,29 +616,31 @@ sub _objs_from_sth {
$slice = $dest_slice;
}
#finally, create the new repeat feature
push @exons, Bio::EnsEMBL::Exon->new(
'-start' => $seq_region_start,
'-end' => $seq_region_end,
'-strand' => $seq_region_strand,
'-adaptor' => $self,
'-slice' => $slice,
'-dbID' => $exon_id,
'-stable_id' => $stable_id,
'-version' => $version,
'-created_date' => $created_date || undef,
'-modified_date' => $modified_date || undef,
'-phase' => $phase,
'-end_phase' => $end_phase,
'-is_current' => $is_current
);
# Finally, create the new exon.
push( @exons,
$self->_create_feature( 'Bio::EnsEMBL::Exon', {
'-start' => $seq_region_start,
'-end' => $seq_region_end,
'-strand' => $seq_region_strand,
'-adaptor' => $self,
'-slice' => $slice,
'-dbID' => $exon_id,
'-stable_id' => $stable_id,
'-version' => $version,
'-created_date' => $created_date
|| undef,
'-modified_date' => $modified_date
|| undef,
'-phase' => $phase,
'-end_phase' => $end_phase,
'-is_current' => $is_current
} ) );
}
return \@exons;
}
=head1 DEPRECATED METHODS
=cut
......
......@@ -1449,29 +1449,33 @@ sub _objs_from_sth {
$display_xref->status( $external_status );
}
#finally, create the new gene
push @genes, Bio::EnsEMBL::Gene->new(
'-analysis' => $analysis,
'-biotype' => $biotype,
'-start' => $seq_region_start,
'-end' => $seq_region_end,
'-strand' => $seq_region_strand,
'-adaptor' => $self,
'-slice' => $slice,
'-dbID' => $gene_id,
'-stable_id' => $stable_id,
'-version' => $version,
'-created_date' => $created_date || undef,
'-modified_date' => $modified_date || undef,
'-description' => $gene_description,
'-external_name' => $external_name,
'-external_db' => $external_db,
'-external_status' => $external_status,
'-display_xref' => $display_xref,
'-status' => $status,
'-source' => $source,
'-is_current' => $is_current
);
# Finally, create the new Gene.
push( @genes,
$self->_create_feature(
'Bio::EnsEMBL::Gene', {
'-analysis' => $analysis,
'-biotype' => $biotype,
'-start' => $seq_region_start,
'-end' => $seq_region_end,
'-strand' => $seq_region_strand,
'-adaptor' => $self,
'-slice' => $slice,
'-dbID' => $gene_id,
'-stable_id' => $stable_id,
'-version' => $version,
'-created_date' => $created_date || undef,
'-modified_date' => $modified_date
|| undef,
'-description' => $gene_description,
'-external_name' => $external_name,
'-external_db' => $external_db,
'-external_status' => $external_status,
'-display_xref' => $display_xref,
'-status' => $status,
'-source' => $source,
'-is_current' => $is_current
} ) );
}
return \@genes;
......
......@@ -116,18 +116,21 @@ sub _objs_from_sth {
$sth->bind_columns(\$karyotype_id, \$seq_region_id, \$seq_region_start,
\$seq_region_end, \$band, \$stain);
while($sth->fetch()) {
while ( $sth->fetch() ) {
my $slice = $slice_cache{$seq_region_id} ||=
$slice_adaptor->fetch_by_seq_region_id($seq_region_id);
push @features, Bio::EnsEMBL::KaryotypeBand->new
(-START => $seq_region_start,
-END => $seq_region_end,
-SLICE => $slice,
-ADAPTOR => $self,
-DBID => $karyotype_id,
-NAME => $band,
-STAIN => $stain);
push( @features,
$self->_create_feature( 'Bio::EnsEMBL::KaryotypeBand', {
-START => $seq_region_start,
-END => $seq_region_end,
-SLICE => $slice,
-ADAPTOR => $self,
-DBID => $karyotype_id,
-NAME => $band,
-STAIN => $stain
} ) );
}
return \@features;
......
......@@ -475,14 +475,17 @@ sub _objs_from_sth {
$seen_attribs->{"$attrib_type_code:$attrib_value"} = 1;
}
$feat = Bio::EnsEMBL::MiscFeature->new_fast
({'start' => $seq_region_start,
'end' => $seq_region_end,
'strand' => $seq_region_strand,
'slice' => $slice,
'adaptor' => $self,
'dbID' => $misc_feature_id,
'attributes' => $feat_attribs });
$feat =
$self->_create_feature_fast( 'Bio::EnsEMBL::MiscFeature', {
'start' => $seq_region_start,
'end' => $seq_region_end,
'strand' => $seq_region_strand,
'slice' => $slice,
'adaptor' => $self,
'dbID' => $misc_feature_id,
'attributes' => $feat_attribs
} );
push @features, $feat;
if ($misc_set_id) {
......
......@@ -424,17 +424,20 @@ sub _objs_from_sth {
$slice = $dest_slice;
}
#finally, create the new PredictionExon
push @exons, Bio::EnsEMBL::PredictionExon->new
( '-start' => $seq_region_start,
'-end' => $seq_region_end,
'-strand' => $seq_region_strand,
'-adaptor' => $self,
'-slice' => $slice,
'-dbID' => $prediction_exon_id,
'-phase' => $start_phase,
'-score' => $score,
'-p_value' => $p_value);
# Finally, create the new PredictionExon.
push( @exons,
$self->_create_feature( 'Bio::EnsEMBL::PredictionExon', {
'-start' => $seq_region_start,
'-end' => $seq_region_end,
'-strand' => $seq_region_strand,
'-adaptor' => $self,
'-slice' => $slice,
'-dbID' => $prediction_exon_id,
'-phase' => $start_phase,
'-score' => $score,
'-p_value' => $p_value
} ) );
}
return \@exons;
......
......@@ -382,16 +382,19 @@ sub _objs_from_sth {
$slice = $dest_slice;
}
#finally, create the new repeat feature
push @ptranscripts, Bio::EnsEMBL::PredictionTranscript->new
( '-start' => $seq_region_start,
'-end' => $seq_region_end,
'-strand' => $seq_region_strand,
'-adaptor' => $self,
'-slice' => $slice,
'-analysis' => $analysis,
'-dbID' => $prediction_transcript_id,
'-display_label' => $display_label);
# Finally, create the new PredictionTranscript.
push( @ptranscripts,
$self->_create_feature('Bio::EnsEMBL::PredictionTranscript', {
'-start' => $seq_region_start,
'-end' => $seq_region_end,
'-strand' => $seq_region_strand,
'-adaptor' => $self,
'-slice' => $slice,
'-analysis' => $analysis,
'-dbID' => $prediction_transcript_id,
'-display_label' => $display_label
} ) );
}
return \@ptranscripts;
......
......@@ -294,25 +294,31 @@ sub _objs_from_sth {
$slice = $dest_slice;
}
#finally, create the new dna align feature
push @features, Bio::EnsEMBL::DnaPepAlignFeature->new_fast
( { 'slice' => $slice,
'start' => $seq_region_start,
'end' => $seq_region_end,
'strand' => $seq_region_strand,
'hseqname' => $hit_name,
'hstart' => $hit_start,
'hend' => $hit_end,
'hstrand' => 1, #dna_pep_align features are always hstrand 1
'score' => $score,
'p_value' => $evalue,
'percent_id' => $perc_ident,
'cigar_string' => $cigar_line,
'analysis' => $analysis,
'adaptor' => $self,
'dbID' => $protein_align_feature_id,
'external_db_id'=> $external_db_id,
'hcoverage' => $hcoverage } );
# Finally, create the new ProteinAlignFeature.
push(
@features,
$self->_create_feature_fast(
'Bio::EnsEMBL::DnaPepAlignFeature', {
'slice' => $slice,
'start' => $seq_region_start,
'end' => $seq_region_end,
'strand' => $seq_region_strand,
'hseqname' => $hit_name,
'hstart' => $hit_start,
'hend' => $hit_end,
'hstrand' => 1, # dna_pep_align features
# are always hstrand 1
'score' => $score,
'p_value' => $evalue,
'percent_id' => $perc_ident,
'cigar_string' => $cigar_line,
'analysis' => $analysis,
'adaptor' => $self,
'dbID' => $protein_align_feature_id,
'external_db_id' => $external_db_id,
'hcoverage' => $hcoverage
} ) );
}
return \@features;
......
......@@ -303,19 +303,21 @@ sub _objs_from_sth {
$slice = $dest_slice;
}
#finally, create the new repeat feature
push @features, Bio::EnsEMBL::RepeatFeature->new_fast
( { 'analysis' => $analysis,
'start' => $seq_region_start,
'end' => $seq_region_end,
'strand' => $seq_region_strand,
'score' => $score,
'hstart' => $repeat_start,
'hend' => $repeat_end,
'repeat_consensus' => $rc,
'adaptor' => $self,
'slice' => $slice,
'dbID' => $repeat_feature_id } );
# Finally, create the new RepeatFeature.
push( @features,
$self->_create_feature_fast( 'Bio::EnsEMBL::RepeatFeature', {
'dbID' => $repeat_feature_id,
'analysis' => $analysis,
'start' => $seq_region_start,
'end' => $seq_region_end,
'strand' => $seq_region_strand,
'score' => $score,
'hstart' => $repeat_start,
'hend' => $repeat_end,
'repeat_consensus' => $rc,
'adaptor' => $self,
'slice' => $slice
} ) );
}
......
......@@ -290,16 +290,20 @@ sub _objs_from_sth {
$slice = $dest_slice;
}
push @features, Bio::EnsEMBL::SimpleFeature->new_fast(
{'start' => $seq_region_start,
'end' => $seq_region_end,
'strand' => $seq_region_strand,
'slice' => $slice,
'analysis' => $analysis,
'adaptor' => $self,
'dbID' => $simple_feature_id,
'display_label' => $display_label,
'score' => $score});
push( @features,
$self->_create_feature_fast(
'Bio::EnsEMBL::SimpleFeature', {
'start' => $seq_region_start,
'end' => $seq_region_end,
'strand' => $seq_region_strand,
'slice' => $slice,
'analysis' => $analysis,
'adaptor' => $self,
'dbID' => $simple_feature_id,
'display_label' => $display_label,
'score' => $score
} ) );
}
return \@features;
......
......@@ -1284,29 +1284,32 @@ sub _objs_from_sth {
}
#finally, create the new transcript
push @transcripts, Bio::EnsEMBL::Transcript->new(
'-analysis' => $analysis,
'-start' => $seq_region_start,
'-end' => $seq_region_end,
'-strand' => $seq_region_strand,
'-adaptor' => $self,
'-slice' => $slice,
'-dbID' => $transcript_id,
'-stable_id' => $stable_id,
'-version' => $version,
'-created_date' => $created_date || undef,
'-modified_date' => $modified_date || undef,
'-external_name' => $xref_display_label,
'-external_db' => $external_db,
'-external_status' => $external_status,
'-external_display_name' => $external_db_name,
'-display_xref' => $display_xref,
'-description' => $description,
'-biotype' => $biotype,
'-status' => $status,
'-is_current' => $is_current
);
# Finally, create the new Transcript.
push( @transcripts,
$self->_create_feature(
'Bio::EnsEMBL::Transcript', {
'-analysis' => $analysis,
'-start' => $seq_region_start,
'-end' => $seq_region_end,
'-strand' => $seq_region_strand,
'-adaptor' => $self,
'-slice' => $slice,
'-dbID' => $transcript_id,
'-stable_id' => $stable_id,
'-version' => $version,
'-created_date' => $created_date || undef,
'-modified_date' => $modified_date || undef,
'-external_name' => $xref_display_label,
'-external_db' => $external_db,
'-external_status' => $external_status,
'-external_display_name' => $external_db_name,
'-display_xref' => $display_xref,
'-description' => $description,
'-biotype' => $biotype,
'-status' => $status,
'-is_current' => $is_current
} ) );
}
return \@transcripts;
......
......@@ -193,20 +193,25 @@ sub _objs_from_sth {
my $analysis = $analysis_adaptor->fetch_by_dbID($analysis_id);
#print "$identifier\n";
push @features, Bio::EnsEMBL::UnmappedObject->new
(-unmapped_object_id => $unmapped_object_id,
-unmapped_reason_id => $unmapped_reason_id,
-type => $type,
-analysis => $analysis,
-external_db_id => $external_db_id,
-identifier => $identifier,
-query_score => $query_score,
-target_score => $target_score,
-ensembl_id => $ensembl_id,
-ensembl_object_type => $ensembl_object_type,
-summary => $summary,
-full_desc => $full_desc,
-adaptor => $self);
push( @features,
$self->_create_feature(
'Bio::EnsEMBL::UnmappedObject', {
-unmapped_object_id => $unmapped_object_id,
-unmapped_reason_id => $unmapped_reason_id,
-type => $type,
-analysis => $analysis,
-external_db_id => $external_db_id,
-identifier => $identifier,
-query_score => $query_score,
-target_score => $target_score,
-ensembl_id => $ensembl_id,
-ensembl_object_type => $ensembl_object_type,
-summary => $summary,
-full_desc => $full_desc,
-adaptor => $self
} ) );
}
return \@features;
}
......
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