View on
Rutger Vos > Bio-Phylo > Bio::Phylo::Parsers::Dwca



Annotate this POD


View/Report Bugs


Bio::Phylo::Parsers::Dwca - Parser used by Bio::Phylo::IO, no serviceable parts inside


This module parses standard Darwin Core Archive files as produced by GBIF (see: The end result is a Bio::Phylo::Taxa object that has as many taxon objects in it as there are distinct dwc:scientificNames in the archive. For example, if the archive is for a single species there will thus be only one taxon object in the produced result. Each taxon object is annotated with as many dwc:Occurrence records, instantiated as Bio::Phylo::NeXML::Meta annotations, as there are occurrences for that species in the archive. In turn, nested in each of these annotations are the predicates and objects for that record.

Using this module, the contents of a Darwin Core Archive can be easily accessed and, for example, prepared as input for MAXENT. Here is an example to show how this is done:

        use Bio::Phylo::IO 'parse';
        use Bio::Phylo::Util::CONSTANT ':objecttypes';

        # a set of fossil occurrences of th feral horse, Equus ferus Boddaert, 1785
        # this corresponds with data set doi:10.15468/dl.yyyhyn
        my $url = '';

        # like every Bio::Phylo::IO module, we can parse directly from a web location
        my $proj = parse(
                '-format' => 'dwca',
                '-url'    => $url,
                '-as_project' => 1,

        # write a CSV file with MAXENT header
        print "Species,Latitude,Longitude\n";
        for my $t ( @{ $proj->get_items(_TAXON_) } ) {
                my $name = $t->get_name;
                for my $m ( @{ $t->get_meta } ) {
                        my $lat = $m->get_meta_object('dwc:decimalLatitude');
                        my $lon = $m->get_meta_object('dwc:decimalLongitude');
                        print "\"$name\",$lat,$lon\n";


There is a mailing list at!forum/bio-phylo for any user or developer questions and discussions.


The dwca parser is called by the Bio::Phylo::IO object. Look there to learn how to parse data in general


Also see the manual: Bio::Phylo::Manual and


If you use Bio::Phylo in published research, please cite it:

Rutger A Vos, Jason Caravas, Klaas Hartmann, Mark A Jensen and Chase Miller, 2011. Bio::Phylo - phyloinformatic analysis using Perl. BMC Bioinformatics 12:63.

syntax highlighting: