Access cohort metadata through the malariagen_data Python API
A new function has been added to the the malariagen_data Python API allowing users to access cohort sample metadata including cohort size, country code, taxon, administrative units name, ISO code, geoBoundaries shape ID and representative latitude and longitude points. Below are some examples for data from the Anopheles gambiae complex accessed via the Ag3 API.
import malariagen_data
ag3 = malariagen_data.Ag3()
The cohort sets that can be accessed include "admin1_month", "admin1_quarter", "admin1_year", "admin2_month", "admin2_quarter", "admin2_year". Below are the cohort sets for "admin1_month".
ag3.cohorts('admin1_month')
As with the sample metadata function, the resulting cohort table can be filtered to individual requirements. For example, below the table is filtered to show cohorts of An. gambiae from Burkina Faso with at least ten individuals.
df_cohorts = ag3.cohorts('admin1_year')
df_cohorts.query('country == "Burkina Faso" and taxon == "gambiae" and cohort_size > 10')
The cohorts function is also avaliable for use with the Anopheles funestus data release Af1(). For questions on usage please send a request to support@malariagen.net.