/var/lib/mrs/parsers/gene.pm is in mrs 6.0.5+dfsg-3ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | package M6::Script::gene;
use strict;
use warnings;
our @ISA = "M6::Script";
sub new
{
my $invocant = shift;
my $self = new M6::Script(
firstdocline => ' <Entrezgene>',
lastdocline => ' </Entrezgene>',
@_
);
return bless $self, "M6::Script::gene";
}
sub parse
{
my ($self, $text) = @_;
if ($text =~ m|<Gene-track_geneid>(\d+)</Gene-track_geneid>|)
{
$self->set_attribute('id', $1);
$self->index_unique_string('id', $1);
}
my $title = '';
while ($text =~ m|<Prot-ref_name_E>(.+?)</Prot-ref_name_E>|g)
{
$title .= "; $1";
}
$self->set_attribute('title', $title) if length($title) > 0;
# index attribute values
while ($text =~ m|<\S+\s([^>]+)>|g)
{
my $attr = $1;
while ($attr =~ m/\S+?=('|")([^'"]+)\1/g)
{
$self->index_text('attr', $2);
}
}
# index content
while ($text =~ m|>([^<>]++)<|g)
{
$self->index_text('text', $1);
}
}
1;
|