Perl Items API
In the intermine/perl directory we provide a Perl library for creating files in InterMine "Item XML" format. Files in this format can be loaded into an InterMine database by creating a "source".
Usage#
Most code using these modules will follow this pattern:
Make a model
Make a new InterMine item XML document:
Make an item:
Set some attributes
or references:
or collections:
It is also possible to combine creation and attribute setting in one command:
Repeat step 4 as necessary then call $document->write to write the items to the output.
FlyMine example#
Example using the FlyMine model:
Output:
Example#
In the InterMine scripts repository there is a longer example: intermine_items_example.pl
The script has three arguments:
- a string describing a
DataSet - a taxon id
- the path to a genomic model file
If you install XML::Writer, the script should run as:
Example command line: