Microreact is a tool for open data visualization and sharing for genomic epidemiology.
It is possible to integrate Epicollect5 with Microreact using Google Spreadsheet as a bridge between the two platforms.
We are going to use the EC5 Demo Project MR as an example. The project must be public.
Using the Epicollect5 APi endpoints, we can get all the entries for that project using the following url: (Open in browser)
We are passing a few parametrs:
format=csvas we need the entries in csv format.
headers=false as we do not want the column headers. We are going to use custom headers to fit Microreact requirements.
page=1 to get paginated entries. There is a limit on how many entries you can load with a single
=IMPORTDATA() call in Google Sheet. (more on this below)
per_page=100 to specify how many entries per page. We just want 100 entries max.
For more info on those parameters read our API guide
We created a public viewable spreadsheet here.
The first thing to do is to leave the first row empty for the time being, and click on cell A2.
We are going to use the following formula in that cell:
passing the url described above. The url to get the entries for a public project is always the same, just the project slug will be different. For another project, we would just need to replace the
ec5-demo-project-mr slug with the new one. You can find each project slug in the API section of your project details page, or by just looking at the url in your browser on your project home page.
Now it is time to add the custom headers. Microreact requires a column
id to uniquely identify each row. With data coming from Epicollect5, that will always be the most left column.
We also need to specify
longitude colums if we want to view the data on a map. More info on Microreact headers
You can use a downloaded csv from Epicollect5 as a reference if you do not remember your headers. After adding them manually, we have:
Important: if you have Date or Time questions, you have to set the format for those columns, otherwise by default they get converted to numbers (Google trying to be smart here).
To do that, select the Date or Time columns, click on Format > Number and pick Date or Time.
Now the sheet is ready to be published. Go to File > Publish to the web...
It needs to be published as comma separated values (csv) and we need to grab the generated link to use on Microreact
To refresh the data set automatically (so when new entries are added to Epicollect5, they appear on the sheet) we can set an auto refresh to one minute or one hour. Go to File > Spreadsheet settings
On the calculation tab, select "On change and every minute" (or hour)
We are ready to head off to Microreact with the url we just generated:
Please notice the "output=csv". If your url does not have that, check your publish settings.
On the Microreact home page, click Upload:
Paste the project url where it says CSV file and click on "Continue (without tree)"
Enter some basic project details and click on "Create Project"
The project is generated!
The project is currently hosted at https://microreact.org/project/rJTVCyTE-