Reproducing Rouse & Schieber (2015) from dandiset 000941¶
Paper. Rouse AG, Schieber MH (2015). Spatiotemporal distribution of location and object effects
in reach-to-grasp kinematics. J Neurophysiol 114:3268-3282.
doi:10.1152/jn.00686.2015. The claims file
(claims/000941/10.1152-jn.00686.2015.yaml) was written from the version of record (Methods,
Results, legends, Tables 1 and 2; the paper has no supplement).
Dandiset. DANDI:000941, "FALCON Benchmark M1-A", version 0.241029.1405. The paper cites no version of the dataset (it predates it), and this is the only published version, so it is the one pinned. The draft has the same 11 assets and was last modified within a second of the publication of this version.
What the dandiset holds. Monkey L only: trial tables, 16 channels of preprocessed EMG at 50 Hz and multiunit spike times, for four sessions (one of them the paper's session L20120928) split for the FALCON benchmark, and three later sessions with ten trials each. It holds no marker positions and no joint angles, the data every kinematic claim of the paper is about, and no data of monkeys X and Y. Only the trial table can be used here.
| Claim | Tested here |
|---|---|
| table2-trial-counts | counts shown; blocked, data missing (the dataset holds a part of the session's successful trials and no failed trials) |
| table2-movement-time | movement time shown; blocked, metadata insufficient (the dataset's onset is not shown to be the paper's, and its medians fall about 55 ms short of the authors' own in every session) |
| fig2-trial-count-coax-45 | count shown; blocked, data missing (a part of the session's trials) |
| fig2-joint-patterns, fig2-hand-opening-two-phases | blocked, data missing (no marker positions or joint angles) |
| fig4-armps-time-course, the fourteen Fig. 5 to Fig. 7 claims | blocked, data missing (no joint angles) |
| fig8a-lda-location, fig8b-lda-object, fig8-hand-shape-invariant-to-location | blocked, data missing (no joint angles) |
| fig9-hand-configuration-location, fig10-forearm-trajectory-object, elbow-point-trajectory-object | blocked, data missing (no marker positions) |
import time
import itertools
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from scipy import stats
import rouse
pd.set_option("display.width", 200)
pd.set_option("display.max_columns", 40)
pd.set_option("display.max_rows", 200)
started = time.time()
assets = rouse.assets()
print(f"dandiset {rouse.DANDISET_ID} version {rouse.DANDISET_VERSION}: {len(assets)} assets, "
f"{assets['size'].sum() / 1e6:.1f} MB")
print(assets[["path", "size", "split", "session"]].to_string())
files = {(r.split, r.session): rouse.open_file(r.url) for r in assets.itertuples()}
trials = {k: rouse.read_trials(f) for k, f in files.items()}
key = ("held-in-calib", rouse.PAPER_SESSION)
t = trials[key]
print(f"\nloaded the trial tables of every file in {time.time() - started:.0f} s")
dandiset 000941 version 0.241029.1405: 11 assets, 311.8 MB
path size split session
0 sub-MonkeyL-held-in-calib/sub-MonkeyL-held-in-calib_ses-20120924_behavior+ecephys.nwb 73077382 held-in-calib 20120924
1 sub-MonkeyL-held-in-calib/sub-MonkeyL-held-in-calib_ses-20120926_behavior+ecephys.nwb 80268327 held-in-calib 20120926
2 sub-MonkeyL-held-in-calib/sub-MonkeyL-held-in-calib_ses-20120927_behavior+ecephys.nwb 78481526 held-in-calib 20120927
3 sub-MonkeyL-held-in-calib/sub-MonkeyL-held-in-calib_ses-20120928_behavior+ecephys.nwb 68337100 held-in-calib 20120928
4 sub-MonkeyL-held-in-minival/sub-MonkeyL-held-in-minival_ses-20120924_behavior+ecephys.nwb 600470 held-in-minival 20120924
5 sub-MonkeyL-held-in-minival/sub-MonkeyL-held-in-minival_ses-20120926_behavior+ecephys.nwb 584940 held-in-minival 20120926
6 sub-MonkeyL-held-in-minival/sub-MonkeyL-held-in-minival_ses-20120927_behavior+ecephys.nwb 748719 held-in-minival 20120927
7 sub-MonkeyL-held-in-minival/sub-MonkeyL-held-in-minival_ses-20120928_behavior+ecephys.nwb 599583 held-in-minival 20120928
8 sub-MonkeyL-held-out-calib/sub-MonkeyL-held-out-calib_ses-20121004_behavior+ecephys.nwb 2605922 held-out-calib 20121004
9 sub-MonkeyL-held-out-calib/sub-MonkeyL-held-out-calib_ses-20121017_behavior+ecephys.nwb 2710214 held-out-calib 20121017
10 sub-MonkeyL-held-out-calib/sub-MonkeyL-held-out-calib_ses-20121024_behavior+ecephys.nwb 3778095 held-out-calib 20121024
loaded the trial tables of every file in 9 s
Data check¶
Each check of the metadata against the values is stated under its output.
f = files[key]
print("Everything the file of the paper's session holds (held-in-calib, 20120928):")
def show(name, obj):
import h5py
if name.startswith("specifications"):
return
if isinstance(obj, h5py.Dataset):
desc = obj.attrs.get("description", "")
unit = obj.attrs.get("unit", "")
print(f" {name} {obj.shape} {obj.dtype}" + (f" unit={unit}" if unit else "") + (f" -- {desc}" if desc else ""))
f.visititems(show)
summary = pd.DataFrame([{"split": k[0], "session": k[1], **rouse.file_summary(fh)} for k, fh in files.items()])
print("\nPer file:")
print(summary.drop(columns=["acquisition"]).to_string())
print("\nAcquisition groups in every file:", sorted(set(map(tuple, summary.acquisition))))
Everything the file of the paper's session holds (held-in-calib, 20120928): acquisition/eval_mask/data (160436,) bool unit=bool acquisition/eval_mask/timestamps (160436,) float64 unit=seconds
acquisition/preprocessed_emg/APL/data (160436,) float64 unit=mV acquisition/preprocessed_emg/APL/timestamps (160436,) float64 unit=seconds acquisition/preprocessed_emg/BCPs/data (160436,) float64 unit=mV acquisition/preprocessed_emg/BCPs/timestamps (160436,) float64 unit=seconds acquisition/preprocessed_emg/DLTa/data (160436,) float64 unit=mV acquisition/preprocessed_emg/DLTa/timestamps (160436,) float64 unit=seconds acquisition/preprocessed_emg/DLTp/data (160436,) float64 unit=mV acquisition/preprocessed_emg/DLTp/timestamps (160436,) float64 unit=seconds
acquisition/preprocessed_emg/ECRB/data (160436,) float64 unit=mV acquisition/preprocessed_emg/ECRB/timestamps (160436,) float64 unit=seconds acquisition/preprocessed_emg/ECU/data (160436,) float64 unit=mV acquisition/preprocessed_emg/ECU/timestamps (160436,) float64 unit=seconds acquisition/preprocessed_emg/EDC/data (160436,) float64 unit=mV acquisition/preprocessed_emg/EDC/timestamps (160436,) float64 unit=seconds
acquisition/preprocessed_emg/FCR/data (160436,) float64 unit=mV acquisition/preprocessed_emg/FCR/timestamps (160436,) float64 unit=seconds acquisition/preprocessed_emg/FCU/data (160436,) float64 unit=mV acquisition/preprocessed_emg/FCU/timestamps (160436,) float64 unit=seconds acquisition/preprocessed_emg/FDI/data (160436,) float64 unit=mV acquisition/preprocessed_emg/FDI/timestamps (160436,) float64 unit=seconds
acquisition/preprocessed_emg/FDPr/data (160436,) float64 unit=mV acquisition/preprocessed_emg/FDPr/timestamps (160436,) float64 unit=seconds acquisition/preprocessed_emg/FDPu/data (160436,) float64 unit=mV acquisition/preprocessed_emg/FDPu/timestamps (160436,) float64 unit=seconds acquisition/preprocessed_emg/Hypoth/data (160436,) float64 unit=mV acquisition/preprocessed_emg/Hypoth/timestamps (160436,) float64 unit=seconds acquisition/preprocessed_emg/PECmaj/data (160436,) float64 unit=mV acquisition/preprocessed_emg/PECmaj/timestamps (160436,) float64 unit=seconds acquisition/preprocessed_emg/TCPlat/data (160436,) float64 unit=mV acquisition/preprocessed_emg/TCPlat/timestamps (160436,) float64 unit=seconds acquisition/preprocessed_emg/Thenar/data (160436,) float64 unit=mV acquisition/preprocessed_emg/Thenar/timestamps (160436,) float64 unit=seconds file_create_date (1,) object general/experiment_description () object general/experimenter (1,) object general/extracellular_ephys/electrodes/filtering (64,) object -- description of hardware filtering, including the filter name and frequency cutoffs general/extracellular_ephys/electrodes/group (64,) object -- a reference to the ElectrodeGroup this electrode is a part of general/extracellular_ephys/electrodes/group_name (64,) object -- the name of the ElectrodeGroup this electrode is a part of general/extracellular_ephys/electrodes/id (64,) int64 general/extracellular_ephys/electrodes/imp (64,) float64 -- the impedance of the electrode, in ohms general/extracellular_ephys/electrodes/location (64,) object -- the location of channel within the subject e.g. brain region general/extracellular_ephys/electrodes/x (64,) float64 -- the x coordinate of the position (+x is posterior) general/extracellular_ephys/electrodes/y (64,) float64 -- the y coordinate of the position (+y is inferior) general/extracellular_ephys/electrodes/z (64,) float64 -- the z coordinate of the position (+z is right) general/institution () object general/lab () object general/subject/age () object general/subject/sex () object general/subject/species () object general/subject/subject_id () object identifier () object intervals/trials/condition_id (412,) int64 -- generic integer id across all loc/obj conditions intervals/trials/contact_time (412,) float64 -- timing of contact onset intervals/trials/gocue_time (412,) float64 -- timing of go cue intervals/trials/id (412,) int64 intervals/trials/move_onset_time (412,) float64 -- timing of move onset intervals/trials/number (412,) uint16 -- trial number in rouse dataset intervals/trials/obj_id (412,) int64 -- integer id for each object intervals/trials/result (412,) object -- outcome of trial (success/failure/abort) intervals/trials/reward_time (412,) float64 -- timing of reward intervals/trials/start_time (412,) float64 -- Start time of epoch, in seconds intervals/trials/stop_time (412,) float64 -- Stop time of epoch, in seconds intervals/trials/tgt_loc (412,) float64 -- location of target (angle) intervals/trials/tgt_obj (412,) object -- object to grasp at target session_description () object session_start_time () object timestamps_reference_time () object units/electrodes (64,) int64 -- the electrodes that each spike unit came from units/electrodes_index (64,) uint8 -- Index for VectorData 'electrodes' units/id (64,) int64 units/obs_intervals (64, 2) float64 -- the observation intervals for each unit units/obs_intervals_index (64,) uint8 -- Index for VectorData 'obs_intervals' units/spike_times (3183706,) float64 -- the spike times for each unit units/spike_times_index (64,) uint32 -- Index for VectorData 'spike_times'
Per file:
split session identifier session_start subject_id processing analysis stimulus n_units n_emg_samples
0 held-in-calib 20120924 L_20120924_held_in_calib 2012-09-24T00:00:00-05:00 MonkeyL_held_in_calib [] [] [] 64 182498
1 held-in-calib 20120926 L_20120926_held_in_calib 2012-09-26T00:00:00-05:00 MonkeyL_held_in_calib [] [] [] 64 172325
2 held-in-calib 20120927 L_20120927_held_in_calib 2012-09-27T00:00:00-05:00 MonkeyL_held_in_calib [] [] [] 64 177606
3 held-in-calib 20120928 L_20120928_held_in_calib 2012-09-28T00:00:00-05:00 MonkeyL_held_in_calib [] [] [] 64 160436
4 held-in-minival 20120924 L_20120924_held_in_minival 2012-09-24T00:00:00-05:00 MonkeyL_held_in_minival [] [] [] 64 806
5 held-in-minival 20120926 L_20120926_held_in_minival 2012-09-26T00:00:00-05:00 MonkeyL_held_in_minival [] [] [] 64 652
6 held-in-minival 20120927 L_20120927_held_in_minival 2012-09-27T00:00:00-05:00 MonkeyL_held_in_minival [] [] [] 64 1039
7 held-in-minival 20120928 L_20120928_held_in_minival 2012-09-28T00:00:00-05:00 MonkeyL_held_in_minival [] [] [] 64 727
8 held-out-calib 20121004 L_20121004_held_out_calib 2012-10-04T00:00:00-05:00 MonkeyL_held_out_calib [] [] [] 64 3442
9 held-out-calib 20121017 L_20121017_held_out_calib 2012-10-17T00:00:00-05:00 MonkeyL_held_out_calib [] [] [] 64 3342
10 held-out-calib 20121024 L_20121024_held_out_calib 2012-10-24T00:00:00-05:00 MonkeyL_held_out_calib [] [] [] 64 6671
Acquisition groups in every file: [('eval_mask', 'preprocessed_emg')]
The only data streams are preprocessed_emg (16 muscles, unit mV, 20 ms steps), eval_mask and the
spike times of 64 multiunit channels; processing, analysis and stimulus are empty in every
file. There are no marker positions, joint angles or any other kinematic series, so every claim of
the paper about joint angles, marker trajectories or the forearm and elbow points is blocked. Every
file's subject is monkey L (identifier and subject id per file above); the dandiset holds no data of
monkeys X and Y. Its description says data of another monkey are in dandiset 001209 (FALCON M1-B,
monkey X, a draft with no published version); the claims file does not name it, so it is not used.
print("Trial table columns, with their descriptions in the file:")
g = f["intervals/trials"]
for c in rouse.TRIAL_COLUMNS:
print(f" {c}: {g[c].attrs.get('description', '')}")
rows = []
for k, tt in trials.items():
n = tt.number.to_numpy()
rows.append({"split": k[0], "session": k[1], "trials": len(tt),
"results": dict(tt.result.value_counts()),
"number_min": n.min(), "number_max": n.max(),
"first_start_s": tt.start_time.min(), "last_stop_s": tt.stop_time.max()})
counts = pd.DataFrame(rows)
print("\nTrials per file:")
print(counts.to_string())
print("\nWhere trial number 127 sits in each file (neighbours in file order):")
for k, tt in trials.items():
n = tt.number.to_numpy()
for i in np.where(n == 127)[0]:
print(f" {k}: row {i}, numbers {n[max(0, i - 2):i + 3].tolist()}")
Trial table columns, with their descriptions in the file:
start_time: Start time of epoch, in seconds
stop_time: Stop time of epoch, in seconds
gocue_time: timing of go cue
move_onset_time: timing of move onset
contact_time: timing of contact onset
reward_time: timing of reward
result: outcome of trial (success/failure/abort)
number: trial number in rouse dataset
tgt_loc: location of target (angle)
tgt_obj: object to grasp at target
obj_id: integer id for each object
condition_id: generic integer id across all loc/obj conditions
Trials per file:
split session trials results number_min number_max first_start_s last_stop_s
0 held-in-calib 20120924 414 {'R': 414} 127 700 8.34 3644.82
1 held-in-calib 20120926 409 {'R': 409} 127 668 5.40 3441.12
2 held-in-calib 20120927 376 {'R': 376} 127 672 13.30 3549.72
3 held-in-calib 20120928 412 {'R': 412} 127 673 5.22 3203.76
4 held-in-minival 20120924 2 {'R': 2} 232 233 8.34 16.10
5 held-in-minival 20120926 2 {'R': 2} 191 192 5.40 13.04
6 held-in-minival 20120927 2 {'R': 2} 127 128 13.30 20.78
7 held-in-minival 20120928 2 {'R': 2} 201 202 5.22 14.52
8 held-out-calib 20121004 10 {'R': 10} 186 197 2.70 68.84
9 held-out-calib 20121017 10 {'R': 10} 115 124 12.70 66.84
10 held-out-calib 20121024 10 {'R': 10} 45 65 3.82 133.42
Where trial number 127 sits in each file (neighbours in file order):
('held-in-calib', '20120924'): row 22, numbers [253, 254, 127, 256, 257]
('held-in-calib', '20120926'): row 60, numbers [253, 254, 127, 256, 257]
('held-in-calib', '20120927'): row 0, numbers [127, 128, 129]
('held-in-calib', '20120927'): row 93, numbers [253, 254, 127, 256, 257]
('held-in-calib', '20120928'): row 49, numbers [253, 254, 127, 257, 258]
('held-in-minival', '20120927'): row 0, numbers [127, 128]
Every trial in every file has result R (rewarded): the files hold no failed trials, although the
column's description says it holds success, failure or abort. In the paper's session (held-in-calib,
20120928) the 412 trials carry numbers from 201 to 673, apart from one numbered 127, and span about
3,200 s. The paper's Table 2 gives this session 768 trials, 717 of them successful, over 1:26:11
(5,171 s). The trial with number 127 sits between 254 and 257 in the same session (and between 254
and 256 in two others), in time order, so its number is very likely 255 or 256, stored wrong; the
number 127 is the largest value of a signed 8-bit integer. Session 20120927 also has a true trial
127 at its start, so in that file the number does not identify a trial.
print("Session 20120928, held-in-calib: numbers in file order, gaps between successive numbers")
n = t.number.to_numpy().astype(int)
n_fixed = n.copy()
n_fixed[(n == 127) & (np.arange(len(n)) > 0)] = -1
order_ok = np.all(np.diff(t.start_time.to_numpy()) > 0)
print("start times increase through the file:", order_ok)
valid = n_fixed[n_fixed > 0]
span = valid.max() - valid.min() + 1
print(f"numbers {valid.min()} to {valid.max()}: {span} numbers, {len(valid)} present besides the one numbered 127, "
f"{span - len(valid) - 1} absent (counting 127 as one of 255 or 256)")
gaps = np.diff(valid)
print("absent numbers per gap:", pd.Series(gaps[gaps > 1] - 1).value_counts().sort_index().to_dict())
print("\nEvent times (s), session 20120928:")
ev = ["start_time", "gocue_time", "move_onset_time", "contact_time", "reward_time", "stop_time"]
print(t[ev].describe().round(3).to_string())
print("\nAll event times on a 20 ms grid:",
bool(np.all(np.abs(np.round(t[ev].to_numpy() / 0.02) - t[ev].to_numpy() / 0.02) < 1e-6)))
d = pd.DataFrame({
"cue minus start": t.gocue_time - t.start_time,
"onset minus cue": t.move_onset_time - t.gocue_time,
"contact minus onset": t.contact_time - t.move_onset_time,
"reward minus contact": t.reward_time - t.contact_time,
"stop minus reward": t.stop_time - t.reward_time})
print("\nIntervals between events (s):")
print(d.describe().round(3).to_string())
Session 20120928, held-in-calib: numbers in file order, gaps between successive numbers
start times increase through the file: True
numbers 201 to 673: 473 numbers, 411 present besides the one numbered 127, 61 absent (counting 127 as one of 255 or 256)
absent numbers per gap: {1: 2, 2: 16, 3: 3, 4: 1, 15: 1}
Event times (s), session 20120928:
start_time gocue_time move_onset_time contact_time reward_time stop_time
count 412.000 412.000 412.000 412.000 412.000 412.000
mean 1568.807 1569.807 1570.122 1570.337 1570.466 1571.466
std 939.060 939.060 939.059 939.059 939.067 939.067
min 5.220 6.220 6.500 6.740 6.900 7.900
25% 749.295 750.295 750.610 750.895 751.070 752.070
50% 1546.710 1547.710 1548.030 1548.220 1548.570 1549.570
75% 2357.710 2358.710 2358.990 2359.130 2359.195 2360.195
max 3200.780 3201.780 3202.080 3202.340 3202.760 3203.760
All event times on a 20 ms grid: True
Intervals between events (s):
cue minus start onset minus cue contact minus onset reward minus contact stop minus reward
count 412.0 412.000 412.000 412.000 412.0
mean 1.0 0.315 0.215 0.129 1.0
std 0.0 0.048 0.083 0.109 0.0
min 1.0 0.220 0.100 0.000 1.0
25% 1.0 0.280 0.160 0.080 1.0
50% 1.0 0.300 0.200 0.100 1.0
75% 1.0 0.340 0.240 0.140 1.0
max 1.0 0.800 0.740 0.920 1.0
All event times lie on a 20 ms grid, the step of the EMG, so each is known only to 20 ms; the paper
times movement from 200 Hz video (5 ms) and contact from strain gauges sampled at 1 kHz. Each trial
starts exactly 1 s before the go cue and stops exactly 1 s after the reward, so start_time and
stop_time are a window cut around the events, not the trial's own start and stop. The reward time
comes 0 to 0.92 s after contact (median 0.10 s), where the paper's task requires a 1,000 ms hold of
the manipulated object before the water reward; reward_time therefore cannot be the time of the
paper's reward, and the file does not define it.
The events are in the expected order in every trial (no interval is negative; reward minus contact is 0 in some trials).
print("Objects: tgt_obj against obj_id, session 20120928")
print(pd.crosstab(t.tgt_obj, t.obj_id).to_string())
print("\nRuns of tgt_obj in file order:", [(k, len(list(g))) for k, g in itertools.groupby(t.tgt_obj)])
names, offsets = rouse.infer_object_names(t)
print("\nOffsets of each obj_id on the apparatus (most frequent difference of location from obj_id",
offsets.obj_id.iloc[1], "between successive trials), and the names they imply:")
print(offsets.to_string(index=False))
t["object"] = t.obj_id.map(names)
t["orientation"] = t.tgt_loc - t.obj_id.map(dict(zip(offsets.obj_id, offsets.offset_deg)))
runs = [(k, len(list(g))) for k, g in itertools.groupby(t.orientation)]
print(f"\nApparatus orientation implied per trial (location minus offset): {len(runs)} runs in file order:")
print(runs)
print("\nTrials per object and location (columns: degrees; 157.5 is the leftmost location, 0 the rightmost):")
print(pd.crosstab(t.object, t.tgt_loc).to_string())
print("\ncondition_id is one to one with (obj_id, tgt_loc):",
bool((t.groupby("condition_id")[["obj_id", "tgt_loc"]].nunique() == 1).all().all()
and t.groupby(["obj_id", "tgt_loc"]).condition_id.nunique().eq(1).all()))
Objects: tgt_obj against obj_id, session 20120928
obj_id 1 2 3 4
tgt_obj
Button 59 47 20 33
Coaxial 44 26 30 35
Sphere 39 29 21 29
Runs of tgt_obj in file order: [('Sphere', 118), ('Button', 159), ('Coaxial', 135)]
Offsets of each obj_id on the apparatus (most frequent difference of location from obj_id 1 between successive trials), and the names they imply:
obj_id offset_deg name
2 45.0 perpendicular cylinder
1 0.0 coaxial cylinder
4 -45.0 button
3 -90.0 sphere
Apparatus orientation implied per trial (location minus offset): 15 runs in file order:
[(112.5, 40), (135.0, 28), (67.5, 30), (0.0, 18), (45.0, 28), (90.0, 40), (22.5, 20), (157.5, 28), (67.5, 26), (0.0, 19), (112.5, 38), (45.0, 27), (157.5, 29), (135.0, 29), (22.5, 12)]
Trials per object and location (columns: degrees; 157.5 is the leftmost location, 0 the rightmost):
tgt_loc 0.0 22.5 45.0 67.5 90.0 112.5 135.0 157.5
object
button 17 16 9 18 17 20 0 0
coaxial cylinder 19 16 19 20 10 20 20 18
perpendicular cylinder 0 0 18 16 19 20 10 19
sphere 11 21 20 19 0 0 0 0
condition_id is one to one with (obj_id, tgt_loc): True
tgt_obj ("object to grasp at target") takes three values (Sphere, Button, Coaxial) in three long
runs of 118, 159 and 135 trials, and each value occurs with all four obj_id codes and with every
location. It cannot be the object grasped: the paper's monkeys grasped four objects, presented in
blocks at each apparatus orientation. obj_id ("integer id for each object") has four codes, and
within each run of trials the location minus a fixed offset per code is constant, with offsets 45
degrees apart, as the paper's apparatus has them; the orientations implied fall in 15 runs of 12 to
40 trials, consistent with the paper's blocks at one apparatus orientation. Named in the clockwise
order of the Fig. 1 legend (perpendicular cylinder, coaxial cylinder, button, sphere, with 157.5
degrees leftmost), the codes are 2, 1, 4 and 3. The names agree with every constraint the legend
states: the coaxial cylinder is at all eight locations (the legend's frames show it at eight), the
sphere and button are never at the leftmost locations, and the perpendicular cylinder is not at the
rightmost ones; 4 + 6 + 6 + 8 = 24 combinations, as in the paper. The names are inferred from the
paper's legend and the structure of the trials; the files do not name the codes. condition_id
is one to one with object and location. The EMG check below supports obj_id as the grasped object.
print("Recordings deposited more than once: held-in-minival against held-in-calib, per session")
for s in sorted({k[1] for k in trials if k[0] == "held-in-minival"}):
mv, ca = trials[("held-in-minival", s)], trials[("held-in-calib", s)]
same = ca.merge(mv, on=["number", "start_time"], suffixes=("_c", "_m"))
cols_equal = all(np.allclose(same[c + "_c"], same[c + "_m"]) for c in ["gocue_time", "move_onset_time", "contact_time", "obj_id", "tgt_loc"])
ts_m, emg_m, _ = rouse.read_emg(files[("held-in-minival", s)])
gc = files[("held-in-calib", s)]["acquisition/preprocessed_emg"]
names_m = sorted(gc.keys())
emg_c = np.column_stack([gc[nm]["data"][:len(ts_m)] for nm in names_m])
ts_c = gc[names_m[0]]["timestamps"][:len(ts_m)]
st_m = rouse.read_spike_times(files[("held-in-minival", s)])
st_c = rouse.read_spike_times(files[("held-in-calib", s)])
n_same = sum(np.array_equal(a, b[b <= (a.max() if len(a) else -1)]) for a, b in zip(st_m, st_c))
ratio = emg_m / emg_c
r = np.corrcoef(emg_m.ravel(), emg_c.ravel())[0, 1]
print(f" {s}: minival trials {mv.number.tolist()} found in calib: {len(same)}; event times equal: {cols_equal}; "
f"EMG timestamps equal: {np.array_equal(ts_m, ts_c)}, values identical: {np.array_equal(emg_m, emg_c)}, "
f"correlation {r:.5f}, median ratio minival/calib per muscle {np.nanmin(np.nanmedian(ratio, 0)):.4f} to "
f"{np.nanmax(np.nanmedian(ratio, 0)):.4f}; channels with identical spike times: {n_same} of {len(st_m)}")
print("\nSessions in held-out-calib:", sorted(k[1] for k in trials if k[0] == "held-out-calib"),
"(none is the paper's session)")
Recordings deposited more than once: held-in-minival against held-in-calib, per session
20120924: minival trials [232, 233] found in calib: 2; event times equal: True; EMG timestamps equal: True, values identical: False, correlation 0.99982, median ratio minival/calib per muscle 1.0063 to 1.0156; channels with identical spike times: 64 of 64
20120926: minival trials [191, 192] found in calib: 2; event times equal: True; EMG timestamps equal: True, values identical: False, correlation 0.99998, median ratio minival/calib per muscle 0.9600 to 0.9605; channels with identical spike times: 64 of 64
20120927: minival trials [127, 128] found in calib: 2; event times equal: True; EMG timestamps equal: True, values identical: False, correlation 0.99999, median ratio minival/calib per muscle 0.9550 to 0.9562; channels with identical spike times: 64 of 64
20120928: minival trials [201, 202] found in calib: 2; event times equal: True; EMG timestamps equal: True, values identical: False, correlation 0.99988, median ratio minival/calib per muscle 1.0047 to 1.0068; channels with identical spike times: 64 of 64 Sessions in held-out-calib: ['20121004', '20121017', '20121024'] (none is the paper's session)
Each held-in-minival file repeats the first two trials of the held-in-calib file of the same
session, with the same event times and the same EMG timestamps; the spike times and EMG agree as
printed above (the EMG of the two files differs by a near-constant scale factor, so each file's EMG
was normalized on its own). They are the same recording deposited twice, as the dataset's
description says (minival is a subset of calib). Only the held-in-calib file of
20120928 is used below, and each trial is counted once.
ts, emg, muscles = rouse.read_emg(f)
spikes = rouse.read_spike_times(f)
print(f"EMG: {emg.shape[1]} muscles {muscles}, {emg.shape[0]} samples, step {np.median(np.diff(ts)) * 1000:.0f} ms, "
f"{ts[0]:.2f} to {ts[-1]:.2f} s, values {np.nanmin(emg):.3f} to {np.nanmax(emg):.3f} (unit mV in the file), "
f"NaN fraction {np.isnan(emg).mean():.4f}")
n_sp = np.array([len(s) for s in spikes])
print(f"Spikes: {len(spikes)} channels, {n_sp.sum()} spikes, per channel {n_sp.min()} to {n_sp.max()}, "
f"times {min(s.min() for s in spikes if len(s)):.2f} to {max(s.max() for s in spikes if len(s)):.2f} s")
# Clock check: decode the grasped object (obj_id) from activity in 100 ms windows at lags from contact.
# With a shared clock, accuracy should be near chance well before the cue and high around contact.
# Labels from the next trial (shifted by one trial) are the control.
y = t.obj_id.to_numpy()
y_shift = np.roll(y, -1)
rows = []
for lag in np.round(np.arange(-1.6, 0.61, 0.1), 2):
Xe = rouse.window_means(ts, emg, t.contact_time.to_numpy(), lag, lag + 0.1)
Xs = rouse.spike_counts(spikes, t.contact_time.to_numpy(), lag, lag + 0.1)
rows.append({"lag_from_contact_s": lag,
"emg_obj_id": rouse.decode_object(Xe, y), "emg_obj_id_next_trial": rouse.decode_object(Xe, y_shift),
"emg_tgt_obj": rouse.decode_object(Xe, t.tgt_obj.to_numpy()),
"spikes_obj_id": rouse.decode_object(Xs, y)})
clock = pd.DataFrame(rows)
chance = t.obj_id.value_counts(normalize=True).max()
print(f"\nCross-validated accuracy of decoding (chance as the largest class: obj_id {chance:.3f}, "
f"tgt_obj {t.tgt_obj.value_counts(normalize=True).max():.3f}); median cue to contact "
f"{(t.contact_time - t.gocue_time).median():.2f} s:")
print(clock.round(3).to_string(index=False))
EMG: 16 muscles ['APL', 'BCPs', 'DLTa', 'DLTp', 'ECRB', 'ECU', 'EDC', 'FCR', 'FCU', 'FDI', 'FDPr', 'FDPu', 'Hypoth', 'PECmaj', 'TCPlat', 'Thenar'], 160436 samples, step 20 ms, 0.00 to 3208.70 s, values -0.133 to 3.465 (unit mV in the file), NaN fraction 0.0000 Spikes: 64 channels, 3183706 spikes, per channel 1877 to 411528, times 0.00 to 3208.70 s
Cross-validated accuracy of decoding (chance as the largest class: obj_id 0.345, tgt_obj 0.386); median cue to contact 0.50 s:
lag_from_contact_s emg_obj_id emg_obj_id_next_trial emg_tgt_obj spikes_obj_id
-1.6 0.308 0.345 0.485 0.250
-1.5 0.330 0.291 0.427 0.313
-1.4 0.352 0.274 0.444 0.272
-1.3 0.286 0.299 0.461 0.294
-1.2 0.330 0.313 0.478 0.255
-1.1 0.299 0.286 0.461 0.315
-1.0 0.264 0.308 0.410 0.298
-0.9 0.354 0.306 0.442 0.301
-0.8 0.393 0.301 0.452 0.245
-0.7 0.476 0.345 0.425 0.318
-0.6 0.473 0.291 0.430 0.303
-0.5 0.529 0.318 0.439 0.418
-0.4 0.726 0.427 0.403 0.517
-0.3 0.871 0.398 0.451 0.752
-0.2 0.949 0.417 0.468 0.837
-0.1 0.990 0.449 0.401 0.896
0.0 0.990 0.439 0.417 0.881
0.1 0.981 0.432 0.374 0.903
0.2 0.961 0.432 0.418 0.820
0.3 0.944 0.420 0.454 0.799
0.4 0.913 0.430 0.449 0.781
0.5 0.930 0.437 0.417 0.787
0.6 0.918 0.435 0.444 0.745
fig, ax = plt.subplots(figsize=(7, 3.5))
for c, lab in [("emg_obj_id", "EMG, obj_id"), ("spikes_obj_id", "spikes, obj_id"),
("emg_obj_id_next_trial", "EMG, next trial's obj_id"), ("emg_tgt_obj", "EMG, tgt_obj")]:
ax.plot(clock.lag_from_contact_s + 0.05, clock[c], marker="o", ms=3, label=lab)
ax.axhline(chance, color="grey", ls=":", lw=1)
ax.axvline(0, color="k", lw=0.5)
ax.axvline(-(t.contact_time - t.gocue_time).median(), color="k", lw=0.5, ls="--")
ax.set_xlabel("window centre from contact (s); dashed: median cue")
ax.set_ylabel("decoding accuracy")
ax.set_ylim(0, 1.02)
ax.legend(fontsize=7)
print("All plotted values lie within the axes:", float(clock.iloc[:, 1:].min().min()), "to", float(clock.iloc[:, 1:].max().max()))
All plotted values lie within the axes: 0.2451954158095798 to 0.9903320599471055
The EMG and the spikes share the clock of the trial table: the object (obj_id) is decoded near
chance (0.26 to 0.35, against 0.345 for the largest class) from EMG at lags of a second or more
before contact, before the median go cue (0.5 s before contact), rises from about 0.7 s before
contact, and is decoded at 0.95 to 0.99 from 0.2 s before contact to 0.1 s after it (spikes 0.84 to
0.90), while the next trial's object is decoded at 0.40 to 0.45 at those lags. tgt_obj is decoded no better
around contact than a second before it, so it does not label what the hand did; this agrees with
reading obj_id as the grasped object. Only the trial table enters the claims below; the event
times themselves (onset and contact) could not be checked against kinematics, as the dataset has
none. The movement onset and contact times are consistent with the EMG (the object is decoded from
EMG in the window just before contact), which is consistent with, but does not show, the paper's
definitions.
table2-trial-counts¶
In the three sessions the monkeys performed 768, 824 and 745 trials (L, X, Y), of which 717, 788 and 688 were successful and 685, 752 and 637 were analyzed.
Criterion: counts per session from the trial records; analyzed trials are successful trials not
preceded by an error trial. Monkeys X and Y are not in the dataset. For monkey L the counts are
taken from the held-in-calib file of session 20120928 (the minival file repeats two of its trials).
n_success = int((t.result == "R").sum())
n_fail = int((t.result != "R").sum())
print(f"Session 20120928: {len(t)} trials in the file, {n_success} rewarded, {n_fail} failed or aborted")
print(f"Paper (Table 2): 768 total (tolerance 691 to 845), 717 successful (645 to 789), 685 analyzed (617 to 754)")
print(f"File spans {t.start_time.min():.0f} to {t.stop_time.max():.0f} s ({(t.stop_time.max() - t.start_time.min()) / 60:.1f} min); "
f"paper: session of 1:26:11 ({5171 / 60:.1f} min)")
print(f"Trial numbers {valid.min()} to {valid.max()}; numbers below {valid.min()} and above {valid.max()} are absent; "
f"{span - len(valid) - 1} numbers inside the span are absent")
prev_present = np.isin(n_fixed - 1, n_fixed[n_fixed > 0]) & (n_fixed > 0)
print(f"Variant, if every absent number inside the span were an error trial: "
f"total in the span {span}, successful {n_success}, successful with the preceding number present {int(prev_present.sum())}")
Session 20120928: 412 trials in the file, 412 rewarded, 0 failed or aborted Paper (Table 2): 768 total (tolerance 691 to 845), 717 successful (645 to 789), 685 analyzed (617 to 754) File spans 5 to 3204 s (53.3 min); paper: session of 1:26:11 (86.2 min) Trial numbers 201 to 673; numbers below 201 and above 673 are absent; 61 numbers inside the span are absent Variant, if every absent number inside the span were an error trial: total in the span 473, successful 412, successful with the preceding number present 387
Result: blocked, data missing. The file of session L20120928 holds 412 rewarded trials and no failed ones, numbered 201 to 673 and spanning about 53 of the session's 86 minutes, against 768 trials and 717 successes in the paper. The dataset holds only the part of the session released for the FALCON benchmark's calibration split, so none of the nine counts can be taken from it, and X and Y are not in it. The difference comes from the selection, not from the paper.
table2-movement-time¶
The median duration from movement onset to contact differs among the monkeys (255, 235 and 335 ms for L, X and Y; Kruskal-Wallis P < 0.001), giving 52, 48 and 68 normalized samples from M to C.
Criterion: movement time from onset to contact over the analyzed trials (a) or all successful
trials (b); the claims file says that onset times given by the dataset are used. The dataset gives
move_onset_time and contact_time, so the marker-speed onset is not recomputed (and could not be:
there are no markers). The number of samples from M to C, inclusive of both, at 200 Hz is
median / 5 ms + 1 (Results, paragraph 1: "inclusive of the first sample at movement onset and the
last sample at peripheral object contact"; 255 ms gives 52). Only monkey L is in the dataset.
Reading (b) uses the 412 successful trials in the file; reading (a) cannot be formed exactly, as the
error trials are absent, and is approximated by the trials whose preceding trial number is present.
The approximation treats every absent number as an error trial; many absent numbers are more
likely successful trials held back in FALCON splits not on DANDI, so (a) here drops more trials than
the paper's rule would.
mt = (t.contact_time - t.move_onset_time) * 1000
readings = {"(b) successful trials in the file": mt,
"(a) approx.: preceding number present": mt[prev_present]}
rows = []
for name, v in readings.items():
q = v.quantile([0.25, 0.5, 0.75])
rows.append({"reading": name, "n": len(v), "median_ms": q[0.5], "q25_ms": q[0.25], "q75_ms": q[0.75],
"samples_M_to_C": q[0.5] / (1000 / rouse.SAMPLE_HZ) + 1,
"median_within_229.5_280.5": 229.5 <= q[0.5] <= 280.5})
res = pd.DataFrame(rows)
print("Monkey L, session 20120928. Paper: median 255 ms (225, 295), 52 samples; tolerance 229.5 to 280.5 ms, 46.8 to 57.2 samples")
print(res.round(1).to_string(index=False))
print(f"\nMovement times range {mt.min():.0f} to {mt.max():.0f} ms; 20 ms steps, so each value is known to +-20 ms")
print("Fraction of trials with movement time >= 255 ms:", round(float((mt >= 255).mean()), 3))
print("\nMedian movement time by object (names inferred above) and by location, ms:")
print(t.assign(mt=mt).groupby("object").mt.agg(["median", "size"]).to_string())
print(t.assign(mt=mt).groupby("tgt_loc").mt.median().to_string())
half = t.start_time < t.start_time.median()
print(f"\nFirst half of the file: median {mt[half].median():.0f} ms; second half: {mt[~half].median():.0f} ms")
other = {s: round(((trials[('held-in-calib', s)].contact_time - trials[('held-in-calib', s)].move_onset_time) * 1000).median())
for s in sorted(k[1] for k in trials if k[0] == "held-in-calib")}
print("For reference, median movement time in the other monkey L sessions of the dataset (ms):", other)
print("\nKruskal-Wallis across monkeys: not run; monkeys X and Y are not in the dataset.")
Monkey L, session 20120928. Paper: median 255 ms (225, 295), 52 samples; tolerance 229.5 to 280.5 ms, 46.8 to 57.2 samples
reading n median_ms q25_ms q75_ms samples_M_to_C median_within_229.5_280.5
(b) successful trials in the file 412 200.0 160.0 240.0 41.0 False
(a) approx.: preceding number present 387 200.0 160.0 240.0 41.0 False
Movement times range 100 to 740 ms; 20 ms steps, so each value is known to +-20 ms
Fraction of trials with movement time >= 255 ms: 0.235
Median movement time by object (names inferred above) and by location, ms:
median size
object
button 280.0 97
coaxial cylinder 200.0 142
perpendicular cylinder 160.0 102
sphere 180.0 71
tgt_loc
0.0 300.0
22.5 240.0
45.0 200.0
67.5 200.0
90.0 180.0
112.5 180.0
135.0 160.0
157.5 160.0
First half of the file: median 200 ms; second half: 180 ms
For reference, median movement time in the other monkey L sessions of the dataset (ms): {'20120924': 180, '20120926': 200, '20120927': 180, '20120928': 200}
Kruskal-Wallis across monkeys: not run; monkeys X and Y are not in the dataset.
fig, ax = plt.subplots(figsize=(6, 3))
bins = np.arange(90, 760, 20)
ax.hist(mt, bins=bins, color="0.5")
ax.axvline(mt.median(), color="C0", label=f"median here {mt.median():.0f} ms")
ax.axvspan(229.5, 280.5, color="C1", alpha=0.25, label="paper 255 ms, tolerance")
ax.set_xlabel("contact minus move onset (ms)")
ax.set_ylabel("trials")
ax.legend(fontsize=7)
print(f"Plotted range {mt.min():.0f} to {mt.max():.0f} ms, all within the axes")
Plotted range 100 to 740 ms, all within the axes
Is the dataset's move_onset_time the paper's movement onset M?¶
The claims file uses the dataset's onset times when it gives them. The dataset does not define
move_onset_time, and its median movement time is 55 ms short of the paper's, so three checks
compare it with the same authors' later papers on the same monkey and sessions (in paper/):
Rouse & Schieber 2016, J Neurophysiol 115:3238, Table 2 (median movement time per session, with
L20120928 the 2015 paper's session), and Rouse & Schieber 2016, J Neurosci 36:10640, Methods ("For
monkey L, the minimum median times were as follows: I-M, 243 ms"; the onset "was identified from
motion-capture data as the monkey released the center object"). The 2015 paper's task software also
marked the release of the center object as an event marker (Methods, Behavioral Task), separate
from the motion-capture onset M. The third check
aligns the EMG on the dataset's onset.
# The dataset's onset against the paper's M: three checks the dataset's own trial table and EMG allow.
# Reference values, for the same monkey and sessions, from two later papers of the same authors in paper/:
# - Rouse & Schieber 2016, J Neurophysiol 115:3238 (doi:10.1152/jn.00008.2016), Table 2: median movement
# time (M to C) per EMG session of monkey L, with session 20120928 the one of the 2015 paper (*).
# - Rouse & Schieber 2016, J Neurosci 36:10640 (doi:10.1523/JNEUROSCI.1716-16.2016), Methods: for monkey L
# "the minimum median times were as follows: I-M, 243 ms; M-C, 228 ms", the minimum over its sessions,
# so each session's median I-M is at least 243 ms. Its onset "was identified from motion-capture data as
# the monkey released the center object".
emg_paper_mt = {"20120924": 238, "20120926": 255, "20120927": 232, "20120928": 253}
rows = []
for s in sorted(k[1] for k in trials if k[0] == "held-in-calib"):
tt = trials[("held-in-calib", s)]
rows.append({"session": s, "trials": len(tt),
"M_to_C_file_ms": round(((tt.contact_time - tt.move_onset_time) * 1000).median()),
"M_to_C_jn2016_Table2_ms": emg_paper_mt[s],
"cue_to_M_file_ms": round(((tt.move_onset_time - tt.gocue_time) * 1000).median()),
"cue_to_C_file_ms": round(((tt.contact_time - tt.gocue_time) * 1000).median())})
cmp_ = pd.DataFrame(rows)
cmp_["M_to_C_file_minus_paper_ms"] = cmp_.M_to_C_file_ms - cmp_.M_to_C_jn2016_Table2_ms
cmp_["cue_to_M_file_minus_243_ms"] = cmp_.cue_to_M_file_ms - 243
cmp_["cue_to_C_file_minus_(243+Table2)_ms"] = cmp_.cue_to_C_file_ms - (243 + cmp_.M_to_C_jn2016_Table2_ms)
print("1. Median movement time per session, file against Rouse & Schieber 2016 (J Neurophysiol) Table 2, and")
print("2. median cue to onset in the file against the minimum median I-M of monkey L (243 ms, J Neurosci 2016):")
print(cmp_.to_string(index=False))
print("Event times are on a 20 ms grid, so each file median is known to +-20 ms.")
# 3. Mean EMG aligned on the dataset's move_onset_time, in 20 ms bins, as the change from a baseline of
# 300 ms before the cue, divided by the baseline (standard choices for a check that feeds no number of a claim).
ts, emg, muscles = rouse.read_emg(f)
lags = np.round(np.arange(-0.5, 0.401, 0.02), 2)
base = np.nanmean(rouse.window_means(ts, emg, t.gocue_time.to_numpy(), -0.3, 0.0), axis=0)
def aligned(times):
return pd.DataFrame([(np.nanmean(rouse.window_means(ts, emg, times, L, L + 0.02), axis=0) - base) / base
for L in lags], index=lags, columns=muscles)
emg_on = aligned(t.move_onset_time.to_numpy())
emg_c = aligned(t.contact_time.to_numpy())
peak_norm = emg_on / emg_on.max()
grand = peak_norm.mean(axis=1)
def first_cross(series, level):
after = series[(series.index >= -0.3)]
hit = after[after >= level]
return float(hit.index[0]) * 1000 if len(hit) else np.nan
rise = pd.DataFrame({"peak_lag_ms": (emg_on.idxmax() * 1000).round(),
"first_25pct_of_peak_ms": [first_cross(peak_norm[m], 0.25) for m in muscles],
"first_50pct_of_peak_ms": [first_cross(peak_norm[m], 0.5) for m in muscles],
"peak_rel_change": emg_on.max().round(2)}, index=muscles)
print("\n3. EMG of session 20120928 aligned on the dataset's move_onset_time (bin start, ms; 0 = onset).")
print("Per muscle: lag of the peak, and the first bin from -300 ms on that reaches 25% and 50% of the peak:")
print(rise.to_string())
print(f"\nMean over the 16 muscles of the peak-normalized EMG: reaches 25% of its peak at "
f"{first_cross(grand / grand.max(), 0.25):.0f} ms and 50% at {first_cross(grand / grand.max(), 0.5):.0f} ms; "
f"peak at {grand.idxmax() * 1000:.0f} ms")
print("Muscles reaching 50% of their peak before the onset bin:",
int((rise.first_50pct_of_peak_ms < 0).sum()), "of", len(muscles), "; at or before -60 ms:",
int((rise.first_50pct_of_peak_ms <= -60).sum()))
print("Selected muscles, relative change from baseline by lag from onset:")
print(emg_on.loc[-0.2:0.1, ["DLTa", "BCPs", "TCPlat", "APL", "EDC", "FDPr"]].round(2).to_string())
1. Median movement time per session, file against Rouse & Schieber 2016 (J Neurophysiol) Table 2, and 2. median cue to onset in the file against the minimum median I-M of monkey L (243 ms, J Neurosci 2016): session trials M_to_C_file_ms M_to_C_jn2016_Table2_ms cue_to_M_file_ms cue_to_C_file_ms M_to_C_file_minus_paper_ms cue_to_M_file_minus_243_ms cue_to_C_file_minus_(243+Table2)_ms 20120924 414 180 238 320 500 -58 77 19 20120926 409 200 255 300 520 -55 57 22 20120927 376 180 232 300 500 -52 57 25 20120928 412 200 253 300 500 -53 57 4 Event times are on a 20 ms grid, so each file median is known to +-20 ms.
3. EMG of session 20120928 aligned on the dataset's move_onset_time (bin start, ms; 0 = onset).
Per muscle: lag of the peak, and the first bin from -300 ms on that reaches 25% and 50% of the peak:
peak_lag_ms first_25pct_of_peak_ms first_50pct_of_peak_ms peak_rel_change
APL 40.0 -40.0 -20.0 12.22
BCPs 0.0 -60.0 -40.0 7.84
DLTa 20.0 -60.0 -40.0 4.68
DLTp 140.0 40.0 80.0 1.03
ECRB 20.0 -40.0 -20.0 38.39
ECU 120.0 -120.0 -100.0 6.99
EDC 40.0 -40.0 -20.0 39.75
FCR 140.0 -120.0 -100.0 5.15
FCU 160.0 -100.0 100.0 6.32
FDI 140.0 0.0 60.0 20.96
FDPr 400.0 120.0 140.0 2.78
FDPu 160.0 100.0 120.0 0.83
Hypoth 140.0 -80.0 40.0 28.50
PECmaj 400.0 -20.0 220.0 1.65
TCPlat 100.0 -60.0 -40.0 4.41
Thenar 180.0 60.0 100.0 18.47
Mean over the 16 muscles of the peak-normalized EMG: reaches 25% of its peak at -80 ms and 50% at -20 ms; peak at 140 ms
Muscles reaching 50% of their peak before the onset bin: 8 of 16 ; at or before -60 ms: 2
Selected muscles, relative change from baseline by lag from onset:
DLTa BCPs TCPlat APL EDC FDPr
-0.20 -0.04 -0.02 -0.00 0.07 1.07 -0.08
-0.18 -0.03 -0.01 -0.00 0.06 1.24 -0.19
-0.16 -0.01 0.07 0.03 0.16 1.69 -0.31
-0.14 0.04 0.23 0.10 0.49 2.44 -0.45
-0.12 0.18 0.36 0.23 0.93 3.00 -0.48
-0.10 0.49 0.60 0.45 1.17 3.26 -0.49
-0.08 1.12 1.35 0.89 1.52 4.44 -0.47
-0.06 2.11 2.87 1.56 2.27 8.31 -0.47
-0.04 3.21 4.98 2.38 3.95 15.82 -0.46
-0.02 3.99 6.78 3.09 6.37 25.27 -0.40
0.00 4.55 7.84 3.50 9.05 34.11 -0.29
0.02 4.68 7.62 3.53 11.35 39.49 -0.18
0.04 4.46 6.57 3.66 12.22 39.75 -0.13
0.06 4.21 5.73 3.82 11.62 35.31 -0.12
0.08 3.89 5.38 4.27 10.58 30.44 0.03
0.10 3.50 5.32 4.41 9.22 24.93 0.48
fig, axs = plt.subplots(1, 2, figsize=(10, 3.5), sharey=True)
for ax, d, lab in [(axs[0], emg_on, "move_onset_time"), (axs[1], emg_c, "contact_time")]:
for m in ["DLTa", "BCPs", "TCPlat", "APL", "EDC", "FDPr"]:
ax.plot(d.index * 1000 + 10, d[m] / emg_on[m].max(), label=m, lw=1)
ax.axvline(0, color="k", lw=0.5)
ax.set_xlabel(f"ms from the dataset's {lab}")
axs[0].axvline(-55, color="k", lw=0.5, ls="--")
axs[0].set_ylabel("EMG change / peak after onset")
axs[0].legend(fontsize=7)
v = pd.concat([emg_on / emg_on.max(), emg_c / emg_on.max()])[["DLTa", "BCPs", "TCPlat", "APL", "EDC", "FDPr"]]
print(f"Plotted range {float(v.min().min()):.2f} to {float(v.max().max()):.2f}, all within the axes; "
"dashed line: 55 ms before the dataset's onset")
Plotted range -0.18 to 1.28, all within the axes; dashed line: 55 ms before the dataset's onset
The file's median movement time falls short of the authors' own median for the same session in
every one of the four sessions, by 52 to 58 ms, three times the 20 ms step of the event times. Its
median time from cue to onset is 300 to 320 ms, 57 to 77 ms longer than the shortest session median
of I-M the J Neurosci paper gives for monkey L (243 ms), so no session of the file has a median as
short as that. The median time from cue to contact, by contrast, is 500 to 520 ms, 4 to 25 ms above
243 ms plus the session's published movement time, as expected if contact is the same event, since
243 ms is the shortest of the session medians of I-M (medians do not add exactly, so this is a
consistency check, not a proof). Contact and cue thus agree with the papers and
the onset does not: the dataset's onset comes about 55 ms after the paper's M. In the EMG aligned on
the dataset's onset, the shoulder and elbow muscles DLTa, BCPs and TCPlat are at half their peak 40
ms before it (DLTa and BCPs peak 0 to 20 ms after it), and 8 of the 16 muscles reach half their peak
before it; this fits an onset later than the start of motion, but EMG leads motion under any definition, so
the EMG alone does not decide. Taken together, the dataset's move_onset_time is very likely a
later event than the paper's marker-speed onset M, such as the task software's center-release
event marker (2015 Methods, Behavioral Task). This rests on session medians on a 20 ms grid compared
with another paper's medians over a different set of trials (676 against 412), so it indicates, and
does not prove, a later event.
Result: blocked, metadata insufficient. Taken at face value, the median time from the
dataset's move_onset_time to contact_time in session L20120928 is 200 ms (quartiles 160 and 240
ms) over the 412 successful trials in the file, and 200 ms over the 387 trials whose preceding trial
number is present, outside the tolerance of 229.5 to 280.5 ms around the paper's 255 ms (41 samples
from M to C against 52). But the dataset does not define its onset, and the checks above show it is
not the paper's: in all four monkey L sessions the file's movement time is 52 to 58 ms shorter than
the authors' own median for the session (J Neurophysiol 2016, Table 2), its cue to onset is 57 to
77 ms longer than the shortest median I-M the authors report (243 ms), and its cue to contact agrees
within 4 to 25 ms. A movement time measured from a later event cannot test the paper's, and the
paper's onset cannot be recomputed without markers. The comparison among monkeys and its
Kruskal-Wallis test cannot be made, as X and Y are not in the dataset.
fig2-trial-count-coax-45¶
Monkey L successfully reached to, grasped and manipulated the coaxial cylinder at the 45 degree location in 28 trials of its session.
Criterion: analyzed (a) or all successful (b) trials of session L20120928 with that object and
location. The object is named from obj_id as in the data check (the files' tgt_obj is not the
object).
sel = (t.object == "coaxial cylinder") & (t.tgt_loc == 45.0)
print(f"Coaxial cylinder (obj_id {[k for k, v in names.items() if v == 'coaxial cylinder'][0]}) at 45 degrees: "
f"(b) {int(sel.sum())} successful trials in the file, (a) approx. {int((sel & prev_present).sum())} with the preceding number present")
print("Paper: 28 (tolerance 25.2 to 30.8)")
print("With the file's tgt_obj == 'Coaxial' at 45 degrees:", int(((t.tgt_obj == "Coaxial") & (t.tgt_loc == 45.0)).sum()))
print(f"Successful trials of the session in the file: {len(t)} of the paper's 717 ({len(t) / 717:.2f}); "
f"28 x {len(t) / 717:.2f} = {28 * len(t) / 717:.1f}")
Coaxial cylinder (obj_id 1) at 45 degrees: (b) 19 successful trials in the file, (a) approx. 16 with the preceding number present Paper: 28 (tolerance 25.2 to 30.8) With the file's tgt_obj == 'Coaxial' at 45 degrees: 19 Successful trials of the session in the file: 412 of the paper's 717 (0.57); 28 x 0.57 = 16.1
Result: blocked, data missing. The file holds 19 successful trials of the coaxial cylinder at 45 degrees (16 with the preceding trial number present), against 28 in the paper; it holds 412 of the 717 successful trials of the session (57%), and 57% of 28 is 16. The count cannot be taken from a part of the session.
Claims blocked for missing kinematic data¶
The other 23 claims (fig2-joint-patterns, fig2-hand-opening-two-phases, fig4-armps-time-course, fig5-location-proximal-object-distal, fig5-early-significance-concurrent, fig5-shoulderier-location, fig5-shoulder-object-effects, fig5-elbowflex-object, fig5-wrist-comparable, fig5-hand-object-predominates, fig5-location-early-object-late, fig5-interaction-small, fig6a-qm-30-90, fig6b-qx-small, fig7-mean-eta-30, fig7-mean-eta-90, fig7-time-course, fig8a-lda-location, fig8b-lda-object, fig8-hand-shape-invariant-to-location, fig9-hand-configuration-location, fig10-forearm-trajectory-object, elbow-point-trajectory-object) are all tests on the 22 joint angles or on marker positions, in three monkeys. The data check shows that no file holds a marker position, a joint angle or any other kinematic series, and that only monkey L is in the dataset. They are blocked, data missing.
import h5py
kin = []
for k, fh in files.items():
def look(name, obj):
if isinstance(obj, h5py.Dataset) and not name.startswith("specifications"):
if name.split("/")[0] in ("acquisition", "processing", "analysis", "stimulus"):
kin.append((k, name))
fh.visititems(look)
streams = sorted({n.split("/")[0] + "/" + n.split("/")[1] for _, n in kin})
print("Data series outside the trial table and units, over all 11 files:", streams)
print(f"Done in {time.time() - started:.0f} s")
Data series outside the trial table and units, over all 11 files: ['acquisition/eval_mask', 'acquisition/preprocessed_emg'] Done in 35 s
Summary¶
| Claim | Outcome |
|---|---|
| table2-trial-counts | blocked: data missing |
| table2-movement-time | blocked: metadata insufficient (the dataset's onset is about 55 ms later than the paper's) |
| fig2-trial-count-coax-45 | blocked: data missing |
| the other 23 claims (joint angles and marker positions) | blocked: data missing |
How the analysis differs from the paper's. Movement onset and contact are the dataset's own
event times, at 20 ms resolution, not the paper's onset from marker speed (5 ms steps) and contact
from strain gauges (1 kHz); the checks above indicate that the onset is very likely a later event, so the movement time is
shown but not compared. Only monkey L is in the dataset, and only 412 of the 717 successful
trials of its session. The objects are named from obj_id by the apparatus order of the paper's
Fig. 1 legend.
What was found about the dataset. It holds trial tables, EMG and multiunit spikes of monkey L,
and no kinematics, so it cannot support the paper it names first. The session L20120928 is there
only in part (trials 201 to 673, about 53 of 86 minutes, no failed trials). tgt_obj does not name
the grasped object; obj_id does, without names. Trial number 255 or 256 is stored as 127 in each
of the four calibration files. The minival files repeat the first two trials of the calibration
files. move_onset_time, contact_time and reward_time are not defined; move_onset_time gives
movement times about 55 ms shorter than the authors' own in each of four sessions, so it is very likely not the
paper's marker-speed onset; and reward_time comes a median 0.10 s after contact, where the paper's task requires a 1 s hold
before the reward.