/usr/share/doc/libswiss-perl/examples/example.pl is in libswiss-perl 1.67-1.
This file is owned by root:root, with mode 0o755.
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 | #!/usr/bin/env perl
use SWISS::Entry;
use SWISS::KW;
# Read an entire record at a time
local $/ = "\n//\n";
while (<>){
# Read the entry
$entry = SWISS::Entry->fromText($_);
# Print the primary accession number of each entry.
print $entry->AC, "\n";
# If the entry has a SWISS-2DPAGE crossreference
if ($entry->DRs->get('SWISS-2DPAGE')) {
# Add the pseudo-keyword 'Gelelectrophoresis'
my $kw = new SWISS::KW;
$kw->text('Gelelectrophoresis');
$entry->KWs->add($kw);
};
# Print all keywords
foreach my $kw ($entry->KWs->elements) {
print $kw->text, ", ";
}
print "\n";
# Print number and Comments for all references
# (courtesy of Dan Bolser)
foreach my $ref ($entry->Refs->elements){
my $rn = $ref->RN; # Reference Number
print "RN:\t$rn\n";
my $rc = $ref->RC; # Reference Comment(s)
foreach my $type (keys %$rc){ # Comment type
foreach (@{$rc->{$type}}){ # Comment text
print join( "\t", "RC:", $type, $_->text), "\n";
}
}
}
print "\n\n";
}
|