Skip to content
Snippets Groups Projects
Commit 3df14185 authored by Graham McVicker's avatar Graham McVicker
Browse files

EMBL dumping changes - not tested

parent 06f271e0
No related branches found
No related tags found
No related merge requests found
...@@ -234,7 +234,7 @@ sub ac { ...@@ -234,7 +234,7 @@ sub ac {
sub id { sub id {
my $self = shift; my $self = shift;
return $self->ac; return $self->slice->name;
} }
...@@ -389,24 +389,23 @@ sub top_SeqFeatures { ...@@ -389,24 +389,23 @@ sub top_SeqFeatures {
#filter out features overlapping slice boundary #filter out features overlapping slice boundary
my @out = (); my @out = ();
my $slice_end = $self->slice->chr_end; my $slice_end = $self->slice->chr_end;
foreach my $f (@sfs) { while($f = shift @sfs) {
next if($f->start < 1 || $f->end > $slice_end); push(@out, $f) unless($f->start < 1 || $f->end > $slice_end);
push @out, $f;
} }
#transcripts and genes are allowed to overlap boundary #transcripts and genes are allowed to overlap boundary
unless($self->skip_SeqFeature('prediction')) { unless($self->skip_SeqFeature('prediction')) {
foreach my $pt (@{$self->slice->get_all_PredictionTranscripts}) { foreach my $pt (@{$self->slice->get_all_PredictionTranscripts}) {
push @sfs, new Bio::EnsEMBL::Utils::EMBL::TranscriptWrapper($pt); push @out, new Bio::EnsEMBL::Utils::EMBL::TranscriptWrapper($pt);
} }
} }
unless($self->skip_SeqFeature('gene')) { unless($self->skip_SeqFeature('gene')) {
foreach my $gene (@{$self->slice->get_all_Genes()}) { foreach my $gene (@{$self->slice->get_all_Genes()}) {
push @sfs, new Bio::EnsEMBL::Utils::EMBL::GeneWrapper($gene); push @out, new Bio::EnsEMBL::Utils::EMBL::GeneWrapper($gene);
} }
} }
return @sfs; return @out;
} }
......
...@@ -137,7 +137,15 @@ sub to_FTHelper { ...@@ -137,7 +137,15 @@ sub to_FTHelper {
my $ft = Bio::SeqIO::FTHelper->new(); my $ft = Bio::SeqIO::FTHelper->new();
$ft->loc($loc); $ft->loc($loc);
$ft->key('CDS');
my $exon_key;
if($trans->isa('Bio::EnsEMBL::PredictionTranscript')) {
$ft->key('CDS');
$exon_key = 'exon';
} else {
$ft->key('CDS_' . $trans->analysis->logic_name);
$exon_key = 'exon_' . $trans->analysis->logic_name;
}
$ft->add_field('translation', $trans->translate()->seq()); $ft->add_field('translation', $trans->translate()->seq());
if($trans->can('translation')) { if($trans->can('translation')) {
...@@ -148,12 +156,12 @@ sub to_FTHelper { ...@@ -148,12 +156,12 @@ sub to_FTHelper {
$ft->add_field('db_xref', $dbl->database().":".$dbl->primary_id()); $ft->add_field('db_xref', $dbl->database().":".$dbl->primary_id());
} }
push(@out, $ft); push(@out, $ft);
foreach my $exon (@{$trans->get_all_translateable_Exons()}) { foreach my $exon (@{$trans->get_all_translateable_Exons()}) {
my $ft = Bio::SeqIO::FTHelper->new(); my $ft = Bio::SeqIO::FTHelper->new();
$ft->loc(features2join_string([$exon])); $ft->loc(features2join_string([$exon]));
$ft->key("exon"); $ft->key($exon_key);
if( $self->strict_EMBL_dumping()) { if( $self->strict_EMBL_dumping()) {
$ft->add_field('db_xref', 'ENSEMBL:HUMAN-Exon-'.$exon->stable_id()); $ft->add_field('db_xref', 'ENSEMBL:HUMAN-Exon-'.$exon->stable_id());
......
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