MeSH::Parser::ASCII - parser for the MeSH ASCII format
use MeSH::Parser::ASCII; # instantiate the parser my $parser = MeSH::Parser::ASCII->new( meshfile => 'd2010.bin' ); # parse the file $parser->parse(); # loop through all the headings while ( my ( $id, $heading ) = each %{ $parser->heading } ) { print $id . ' - ' . $heading->{label} . "\n"; # list synonyms for my $synonym ( @{ $heading->{synonyms} } ) { print "\t$synonym\n"; } # list parents for my $parent ( @{ $heading->{parents} } ) { print "\t" . $parent->{label} . "\n"; } }
Parser for the MeSH ASCII format.
MeSH file in ASCII format
Parses the MeSH file and loads it into a hash ref.
Returns a hash ref collection of all the parsed headings. Each consists of a label, and id and synonyms if any were available.
Label is extracted from Mesh Heading field in Descriptor Data Elements, or Name of substance in Supplementary Concept Records, or Subheading in Qualifier Data Elements.
Synonyms are only parsed for Descriptor Data Elements (PRINT ENTRY and ENTRY entries)
Tomasz Adamusiak <tomasz@cpan.org>
Copyright (c) 2010 European Bioinformatics Institute. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under GPLv3.
This software is provided "as is" without warranty of any kind.
To install MeSH::Parser::ASCII, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MeSH::Parser::ASCII
CPAN shell
perl -MCPAN -e shell install MeSH::Parser::ASCII
For more information on module installation, please visit the detailed CPAN module installation guide.