Check your data before submitting it to PhysioNet
Problems such as a missing signal file, an email address left in a spreadsheet, or an age that should have been de-identified are easy to miss and can hold up the review of a submission. Two new commands can find them on your own computer before you submit: wfdb check checks WFDB records, and physionet preflight checks a whole dataset. Install or upgrade both packages with:
pip install --upgrade wfdb physionet
The examples below use wfdb 5.11.0 and physionet 0.10.0.
Check WFDB records. Run wfdb check on a record or a folder of records. It checks each header and .wfdb archive, confirms that the signal and segment files a header refers to exist and are large enough, compares the segments of multi-segment records, and reads the first frame of each signal. Here, one header refers to a signal file that was never copied:
$ wfdb check my-dataset
/home/me/my-dataset/records/101.dat: missing_signal: Referenced signal file is missing
The command prints No WFDB problems found when all is well, and exits with status 1 when it finds a problem, so you can use it in scripts and automated tests. To save time on large datasets, it does not read every sample or annotation file. The same checks are available in Python:
import wfdb
for issue in wfdb.check_dataset("my-dataset"):
print(issue.path, issue.code, issue.message)
Check a whole dataset. physionet preflight looks at everything in a dataset folder, not only WFDB records. Its checks fall into five groups:
- Filesystem: file names with spaces or special characters, proprietary formats, hidden files, version control folders, and files with identical contents.
- Documentation: missing documentation, such as a
README.md. - Integrity: the structure of CSV files, and the WFDB checks above. These run when
wfdbis installed. - Quality: missing values, outliers, and inconsistent data types.
- Privacy: patterns such as email addresses and phone numbers, ages above 89, dates that may be real, and files such as private keys.
On the same folder, it finds the missing signal file and two privacy problems in a table of participants:
$ physionet preflight my-dataset
...
✗ Integrity (1 error)
✗ records/101.dat - Referenced signal file is missing
✓ Privacy (2 warnings)
⚠ participants.csv - Potential private information detected in column 'contact' (pattern: email address)
⚠ participants.csv - Ages exceeding HIPAA limit of 89 found in column 'age'
Summary:
==================================================
1 error, 2 warnings
Errors need to be fixed before you submit. Warnings point to things you should review: a date may already be shifted, for example, and two identical files may be intentional. Use --level warning to hide information messages, or --checks to run only some groups, such as --checks integrity,privacy. Like wfdb check, the command exits with status 1 when it finds an error.
Include the report with your submission. Each run saves a report as PHYSIONET_PREFLIGHT_REPORT.md in the dataset folder. Please include it when you submit, so reviewers can see what was checked. Automated checks cannot find every problem, and they do not replace your own review of the data, particularly for de-identification.
Both packages are open source. Questions, bug reports, and ideas for new checks are welcome on the issue trackers for wfdb and physionet.
Read more: Checking WFDB records and physionet preflight