This page presents the basic functions to access all of the data stored in mangal.
Functions whose name is plural (e.g networks
) will return a Vector
of their type. Functions whose name is singular (e.g. network
) return a single object. All functions returning a Vector
can accept Pair
object for querying.
In addition to the search by name (when available) and ID (for all objects), most of the functions have methods to work on other types of objects. For example, networks
has a function taking a MangalDataset
as an object, which will retrieve the networks belonging to this dataset.
The server returns (by default) 200 objects for a given query, and this number can be increased up to 1000. This may not be sufficient to retrieve the entire information, for example in networks with more than 200 nodes. Not paying attention to paging when using these functions directly (as opposed to within the EcologicalNetworks
wrappers) means that you are at risk of not working with the entire dataset.
A note on queries
The Mangal API is built on epilogue
– this offers sorting and filtering functionalities. These operations are referred to as "queries" across the package. All queries are passed as pairs. For example, filtering interactions that are of the mutualist type, and sorting them by id
, is done with:
interactions("type" => "mutualism", "sort" => "id")
For datasets
Mangal.datasets
— Functiondatasets(query::Pair...)
This function will return objects of type MangalDataset according to the query parameters.
To get the latest MangalDataset records, this function can be called with no arguments.
Mangal.dataset
— Functiondataset(id::Int64)
Returns the object of type MangalDataset whose identifier is id
.
dataset(name::AbstractString)
Return a single dataset by its name.
Networks
Mangal.networks
— Functionnetworks(query::Pair...)
This function will return objects of type MangalNetwork according to the query parameters. To accelerate future queries, the objects returned will be cached.
To get the latest MangalNetwork records, this function can be called with no arguments.
networks(dataset::MangalDataset, query::Pair...)
Returns networks that are part of a MangalDataset
. Allows additional query parameters.
Mangal.network
— Functionnetwork(id::Int64)
Returns the object of type MangalNetwork whose identifier is id
.
network(name::AbstractString)
Returns a network of a given name.
Interactions
Mangal.interactions
— Functioninteractions(query::Pair...)
This function will return objects of type MangalInteraction according to the query parameters.
To get the latest MangalInteraction records, this function can be called with no arguments.
interactions(from::MangalNode, ::Colon, query::Pair...)
Returns interactions established by the species given as its first argument.
interactions(::Colon, to::MangalNode, query::Pair...)
Returns interactions established to the species given as its second argument.
interactions(with::MangalNode, query::Pair...)
Returns interactions established around the species given as its first argument.
interactions(from::MangalNode, to::MangalNode, query::Pair...)
Returns interactions between two nodes.
interactions(n::MangalNetwork, query::Pair...)
Returns interactions within a network.
Mangal.interaction
— Functioninteraction(id::Int64)
Returns the object of type MangalInteraction whose identifier is id
.
Nodes
Mangal.nodes
— Functionnodes(query::Pair...)
This function will return objects of type MangalNode according to the query parameters. To accelerate future queries, the objects returned will be cached.
To get the latest MangalNode records, this function can be called with no arguments.
nodes(network::MangalNetwork, query::Pair...)
Returns the nodes that are part of a MangalNetwork
, with an additional optional query.
nodes(taxon::MangalReferenceTaxon, query::Pair...)
Returns the nodes that are instance of a MangalReferenceTaxon
, with an additional query.
Mangal.node
— Functionnode(id::Int64)
Returns the object of type MangalNode whose identifier is id
.
Reference taxon
Mangal.backbones
— Functionbackbones(query::Pair...)
This function will return objects of type MangalReferenceTaxon according to the query parameters. To accelerate future queries, the objects returned will be cached.
To get the latest MangalReferenceTaxon records, this function can be called with no arguments.
Mangal.backbone
— Functionbackbone(id::Int64)
Returns the object of type MangalReferenceTaxon whose identifier is id
.
backbone(name::AbstractString)
Returns the backbone entry for a taxon, matched by exact name.
References
Mangal.references
— Functionreferences(query::Pair...)
This function will return objects of type MangalReference according to the query parameters.
To get the latest MangalReference records, this function can be called with no arguments.
Mangal.reference
— Functionreference(id::Int64)
Returns the object of type MangalReference whose identifier is id
.
reference(d::MangalDataset)
Returns the MangalReference
associated to a MangalDataset
. This is a convenience function that returns the reference
field of the dataset.