Commit 2269713d authored by Kieron Taylor's avatar Kieron Taylor 😠
Browse files

[ENSCORESW-827] Switch to a consistently lower case ID field

parent ca44dc2f
......@@ -1447,7 +1447,7 @@ sub get_nearest_Gene {
sub summary_as_hash {
my $self = shift;
my %summary;
$summary{'ID'} = $self->display_id;
$summary{'id'} = $self->display_id;
$summary{'start'} = $self->seq_region_start;
$summary{'end'} = $self->seq_region_end;
$summary{'strand'} = $self->strand;
......
......@@ -185,7 +185,7 @@ sub summary_as_hash {
my $self = shift;
my %summary;
$summary{'type'} = $self->analysis->db;
$summary{'ID'} = $self->display_id;
$summary{'id'} = $self->display_id;
$summary{'start'} = $self->start,
$summary{'end'} = $self->end,
$summary{'interpro'} = $self->interpro_ac;
......
......@@ -1233,7 +1233,7 @@ sub get_all_DAS_Features{
sub summary_as_hash {
my $self = shift;
my %summary;
$summary{'ID'} = $self->display_id;
$summary{'id'} = $self->display_id;
$summary{'genomic_start'} = $self->genomic_start;
$summary{'genomic_end'} = $self->genomic_end;
my $transcript = $self->transcript;
......
......@@ -123,7 +123,7 @@ sub print_feature {
# Column 3 - feature, the ontology term for the kind of feature this row is
my $so_term = eval { $so_mapper->to_name($feature); };
$@ and throw sprintf "Unable to map feature %s to SO term.\n$@", $summary{ID};
$@ and throw sprintf "Unable to map feature %s to SO term.\n$@", $summary{id};
if ($so_term eq 'protein_coding_gene') {
# Special treatment for protein_coding_gene, as more commonly expected term is 'gene'
$so_term = 'gene';
......@@ -189,13 +189,13 @@ sub print_feature {
delete $summary{'score'};
delete $summary{'source'};
# Slice the hash for specific keys in GFF-friendly order
my @ordered_keys = grep { exists $summary{$_} } qw(ID Name Alias Parent Target Gap Derives_from Note Dbxref Ontology_term Is_circular);
my @ordered_keys = grep { exists $summary{$_} } qw(id Name Alias Parent Target Gap Derives_from Note Dbxref Ontology_term Is_circular);
my @ordered_values = @summary{@ordered_keys};
while (my $key = shift @ordered_keys) {
my $value = shift @ordered_values;
delete $summary{$key};
if ($value && $value ne '') {
if ($key eq 'ID') {
if ($key eq 'id') {
if ($feature->isa('Bio::EnsEMBL::Transcript')) {
$value = 'transcript:' . $value;
} elsif ($feature->isa('Bio::EnsEMBL::Gene')) {
......
......@@ -69,13 +69,13 @@ my %feature_conversion = ( 'Bio::EnsEMBL::Gene' => 'Gene',
# Hash for selecting the correct attributes of unseen features for crude summary. This hash is
# for fallback behaviour, slicing summary hashes for a limited set of values.
my %printables = (
'Bio::EnsEMBL::Gene' => ['ID','biotype','start','end'],
'Bio::EnsEMBL::Transcript' => ['ID','start','end'],
'Bio::EnsEMBL::Translation' => ['ID'],
'Bio::EnsEMBL::Variation::VariationFeature' => ['ID','start','end','strand','seq_region_name'],
'Bio::EnsEMBL::Variation::StructuralVariationFeature' => ['ID','start','end','strand','seq_region_name'],
'Bio::EnsEMBL::Funcgen::RegulatoryFeature' => ['ID','start','end','strand'],
'Bio::EnsEMBL::Compara::ConstrainedElement' => ['ID','start','end','strand','seq_region_name'],
'Bio::EnsEMBL::Gene' => ['id','biotype','start','end'],
'Bio::EnsEMBL::Transcript' => ['id','start','end'],
'Bio::EnsEMBL::Translation' => ['id'],
'Bio::EnsEMBL::Variation::VariationFeature' => ['id','start','end','strand','seq_region_name'],
'Bio::EnsEMBL::Variation::StructuralVariationFeature' => ['id','start','end','strand','seq_region_name'],
'Bio::EnsEMBL::Funcgen::RegulatoryFeature' => ['id','start','end','strand'],
'Bio::EnsEMBL::Compara::ConstrainedElement' => ['id','start','end','strand','seq_region_name'],
);
=head2 print_feature
......@@ -131,32 +131,32 @@ sub print_feature_list {
if ($feature_count == 100) {last;}
# Begin the feature-specific formatting code
if ($feature_type eq "Bio::EnsEMBL::Gene") {
print $fh "\tGene ".$feature_count.": ".$attributes{'external_name'}.",".$attributes{'ID'}."\n";
print $fh "\tGene ".$feature_count.": ".$attributes{'external_name'}.",".$attributes{'id'}."\n";
print $fh "\tBiotype: ".$attributes{'biotype'}."\n";
print $fh "\tLocation: ".$attributes{'start'}."-".$attributes{'end'}." bp\n\n";
print $fh "\tTranscripts and proteins\n";
foreach my $transcript (@{$feature->get_all_Transcripts}) {
my %tr_summary = %{$transcript->summary_as_hash};
print $fh "\t\t ".$tr_summary{'ID'};
print $fh "\t\t ".$tr_summary{'id'};
my $translation = $transcript->translation;
if (defined $translation) {
my %pr_summary = %{$translation->summary_as_hash};
print $fh " - ".$pr_summary{'ID'}."\n\n";
print $fh " - ".$pr_summary{'id'}."\n\n";
}
else {print $fh " - no protein\n\n";}
}
print $fh "\n";
}
elsif ($feature_type eq "Bio::EnsEMBL::Funcgen::RegulatoryFeature") {
print $fh "\t".$attributes{'ID'}."\n";
print $fh "\t".$attributes{'id'}."\n";
}
elsif ($feature_type eq "Bio::EnsEMBL::Compara::ConstrainedElement") {
print $fh "\t".$attributes{'start'}."-".$attributes{'end'}."\n";
}
elsif ( $feature_type eq "Bio::EnsEMBL::Variation::StructuralVariationFeature"
or $feature_type eq "Bio::EnsEMBL::Variation::VariationFeature") {
print $fh "\tID: ".$attributes{'ID'}." Position: ".
print $fh "\tID: ".$attributes{'id'}." Position: ".
$attributes{'start'}."-".$attributes{'end'}." on strand ".$attributes{'strand'}." \n";
}
else {
......
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