SOP - Routine SARS-CoV-2 sequencing data administration
Mateusz Jundzill, Riccardo Spott, Mara Lohde, Martin Hölzer, Adrian Viehweger, Christian Brandt
Abstract
This is a step-by-step standard operating protocol (SOP) for data administration using the MongoDB database for routine SARS-CoV-2 sequencing.
The collapsed note blocks contain command-line solutions that are usually faster but require more advanced IT knowledge.
Additionally, we have enclosed a Github repository with a code and script approach to automate multiple data administration procedures.
Please note that since these codes are specifically made to be used with the SARS-CoV-2 internal database, they will require adjustments to work with other databases. In this protocol, we have focused on using the MongoDB Compass GUI, but there are other solutions available. We recommend choosing the most suited solution for your needs.
Steps
Creating New Entries
Sample arrives from external or internal partner.
Sample entry creation. Fill the template CSV file with the given information and import it through MongoDB Compass.
Example of a template CSV:
A | B | C | D | E |
---|---|---|---|---|
Sample_ID | Isolation_Date | Longitude | Latitude | ... |
A12345 | 230101 | 11.586111 | 50.927223 | ... |
B12345 | 230101 | 11.586111 | 50.927223 | ... |
... | ... | ... | ... | ... |
Longitude and latitude data can later be used for visualizing MongoDB Chart maps.

Select Import File and choose a file for data upload. Pick CSV in the Select Input FileType option.
If the file is in proper format, a table with the headline Specify Fields and Types should appear, providing an overview of the imported data and allowing you to specify key types. Confirm by selecting Import.

Sequencing preparation
Select samples for laboratory work. Access database using MongoDB Compass and search for samples that have an empty Status field.
Search query example:
{Status:""}
```<img src="https://static.yanyin.tech/literature_test/protocol_io_true/protocols.io.kxygx91zzg8j/1_1.png" alt="Search field in MongoDB Compass." loading="lazy" title="Search field in MongoDB Compass."/>
Fill _the Status_ field with a short personal identifier and a sample barcode number.
Example:
RS1_BC01
(Optional) Export the sample list as a CSV file. Search for the desired samples using MongoDB Compass and then export the results to a CSV file.
The exported CSV can also be used to update entries at a later step (see step 6).
Example of a queary that searches for a status that contais 'BC' (barcode).
{Status:{$regex: 'BC'}}

Command line export approach:
Print out the sample for the laboratory work.
Sample analysis
(Optional) Analyze the results your experiment and update the list prepared in with any data that you want to store in the database.
Database entry update
Update MongoDB database with new results. There are three available solutions:
- Manually update entries in MongoDB Compass.
Switch to the optimal data view in the application (table-like or JSON-like), depending on how many entries you need to view. Then, turn on the edit mode and in case you would like to add a new key-value pair select the small plus sign. This will create a new key-value pair that you can modify. To modify an existing value, double-click on value you wish to modify. Confirm your changes by choosing Update .
- Pure CSV solution. Export the list of analyzed samples by querying the common Status field fragment e.g. BC (Barcode):
{Status:{$regex: 'BC'}}
Update the exported CSV with new information and change the status of failed sequencing runs to fail . Then, delete the preexisting database entry and import the updated CSV file using MongoDB Compass.
Check data integrity. This could be performed in multiple ways:
-
Go to the MongoDB Compass Schema tab, select Analyze Schema and check your data for any discrepancies (such as numerical values out of bonds, repeated values, unusual data formats, etc.)
-
Prepare MongoDB Charts data overview that works in a similar but customized way as MongoDB Compass Schema.
-
Use sanity scripts similar to the 'field_mod_exec.sh' script provided in the Github repository The script can also create a new field based on the given information. Please note that the provided scripts require modification and adjustments to work with databases other than the internal Routine SARS-CoV-2 sequencing database.
Prepare a report file
Prepare report file for external partners. Prepare results for the report by searching the database for the desired data, such as by Analysis Date or any other required field Then export the list with selected fields to a CSV file via MongoDB Compass.
Example to filter data by date of analysis:
{"Analysing_Date": <date of analysis>}