This page presents the basic functions to access all of the data stored in mangal.

Naming conventions

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.

Paging matters!

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.datasetsFunction
datasets(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.

source
Mangal.datasetFunction
dataset(id::Int64)

Returns the object of type MangalDataset whose identifier is id.

source
dataset(name::AbstractString)

Return a single dataset by its name.

source

Networks

Mangal.networksFunction
networks(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.

source
networks(dataset::MangalDataset, query::Pair...)

Returns networks that are part of a MangalDataset. Allows additional query parameters.

source
Mangal.networkFunction
network(id::Int64)

Returns the object of type MangalNetwork whose identifier is id.

source
network(name::AbstractString)

Returns a network of a given name.

source

Interactions

Mangal.interactionsFunction
interactions(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.

source
interactions(from::MangalNode, ::Colon, query::Pair...)

Returns interactions established by the species given as its first argument.

source
interactions(::Colon, to::MangalNode, query::Pair...)

Returns interactions established to the species given as its second argument.

source
interactions(with::MangalNode, query::Pair...)

Returns interactions established around the species given as its first argument.

source
interactions(from::MangalNode, to::MangalNode, query::Pair...)

Returns interactions between two nodes.

source
interactions(n::MangalNetwork, query::Pair...)

Returns interactions within a network.

source
Mangal.interactionFunction
interaction(id::Int64)

Returns the object of type MangalInteraction whose identifier is id.

source

Nodes

Mangal.nodesFunction
nodes(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.

source
nodes(network::MangalNetwork, query::Pair...)

Returns the nodes that are part of a MangalNetwork, with an additional optional query.

source
nodes(taxon::MangalReferenceTaxon, query::Pair...)

Returns the nodes that are instance of a MangalReferenceTaxon, with an additional query.

source
Mangal.nodeFunction
node(id::Int64)

Returns the object of type MangalNode whose identifier is id.

source

Reference taxon

Mangal.backbonesFunction
backbones(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.

source
Mangal.backboneFunction
backbone(id::Int64)

Returns the object of type MangalReferenceTaxon whose identifier is id.

source
backbone(name::AbstractString)

Returns the backbone entry for a taxon, matched by exact name.

source

References

Mangal.referencesFunction
references(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.

source
Mangal.referenceFunction
reference(id::Int64)

Returns the object of type MangalReference whose identifier is id.

source
reference(d::MangalDataset)

Returns the MangalReference associated to a MangalDataset. This is a convenience function that returns the reference field of the dataset.

source