berndporr / ECG-GUDB

API for transparently accessing the Glasgow University ECG database (GUDB)
http://researchdata.gla.ac.uk/716/
Other
13 stars 4 forks source link

[Question] understanding R-Peak annotations: possible errors? #1

Open danibene opened 1 year ago

danibene commented 1 year ago

Hello!

First of all, thank you very much for making this database available to the public; I'm finding it really useful for my work.

I've noticed a couple of unusual patterns in the interbeat intervals that seem to result from missing or misplaced R-Peak annotations. Here is an example: image

image

Was this peak left out intentionally (because of how much noise there is)? If so, does there happen to be any existing documentation of unreliable parts of the data?

Just in case I'm missing something in terms of loading the data, the relevant code snippet I'm using to get the R-Peak annotations is:

import pandas as pd
import ecg_gudb_database

dfs_ecg = []
dfs_rpeaks = []

for participant in range(25):
    for i, experiment in enumerate(ecg_gudb_database.GUDb.experiments):

        ecg_class = ecg_gudb_database.GUDb(participant, experiment)

        if ecg_class.anno_cs_exists:
            anno = pd.DataFrame({"Rpeaks": ecg_class.anno_cs})
            anno["Sampling_Rate"] = 250

Happy to provide more details if you'd like!

berndporr commented 1 year ago

There is clearly nothing to annotate except you'd imagine one? Certainly no R-peak there isn't it?

danibene commented 1 year ago

@berndporr thank you for your quick response!

Yes, I don't think the location of the R-Peak is clear in that example, but since there's so much noise and there's a sudden shift in the BPM, I'd probably want to exclude this part of the data from analysis.

Here is another example from the same participant, where I think the missing R-Peak location is likely somewhere around where I highlighted in yellow:

image

If you don't have any documentation of unreliable parts of the data, would you mind me uploading an extended version of the annotations with my own additions (e.g. to Zenodo) once I've completed them?

berndporr commented 1 year ago

I'd very much appreciate it you could upload an extended version and then reference the original one. The chest strap and Einthoven have usually a constant time shift because recorded with two different bluetooth devices but that's constant. One could probably create a pretty reliable annotation by combining both of them.

danibene commented 1 year ago

@berndporr

I thought the easiest way to approach this would be to fork your repository such that the original loading functions could be used, with the "url" parameter set to https://danibene.github.io/ECG-GUDB/experiment_data to download my annotations instead of the originals.

I also included a new file "annotation_cs_quality.tsv" (when applicable) with my subjective judgment of the signal quality where I noticed anomalies, e.g. "bad" or "unsure".

I'd very much appreciate it you could upload an extended version and then reference the original one.

I added the citation to a Zenodo record of the repository, wasn't sure if this was what you had in mind: https://zenodo.org/record/6979905

The chest strap and Einthoven have usually a constant time shift because recorded with two different bluetooth devices but that's constant. One could probably create a pretty reliable annotation by combining both of them.

That's a good idea! I'm not currently planning on systematically correcting the annotations, so for now, I just added the corrections to anomalies I happened to notice while plotting the data for my analysis.

Let me know if you'd like me to clarify/change anything.