{"action":"created","issue":{"url":"https://api.github.com/repos/jayfmil/RAM_ECoG/issues/1","repository_url":"https://api.github.com/repos/jayfmil/RAM_ECoG","labels_url":"https://api.github.com/repos/jayfmil/RAM_ECoG/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/jayfmil/RAM_ECoG/issues/1/comments","events_url":"https://api.github.com/repos/jayfmil/RAM_ECoG/issues/1/events","html_url":"https://github.com/jayfmil/RAM_ECoG/issues/1","id":348055110,"node_id":"MDU6SXNzdWUzNDgwNTUxMTA=","number":1,"title":"multiple TH patients run into issues with loading EEG data ","user":{"login":"seqasim","id":15975112,"node_id":"MDQ6VXNlcjE1OTc1MTEy","avatar_url":"https://avatars3.githubusercontent.com/u/15975112?v=4","gravatar_id":"","url":"https://api.github.com/users/seqasim","html_url":"https://github.com/seqasim","followers_url":"https://api.github.com/users/seqasim/followers","following_url":"https://api.github.com/users/seqasim/following{/other_user}","gists_url":"https://api.github.com/users/seqasim/gists{/gist_id}","starred_url":"https://api.github.com/users/seqasim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seqasim/subscriptions","organizations_url":"https://api.github.com/users/seqasim/orgs","repos_url":"https://api.github.com/users/seqasim/repos","events_url":"https://api.github.com/users/seqasim/events{/privacy}","received_events_url":"https://api.github.com/users/seqasim/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-08-06T19:37:27Z","updated_at":"2018-08-06T20:15:44Z","closed_at":null,"author_association":"NONE","body":"Hey, I keep getting the following error with patients when trying to load and save their **monopolar** EEG data. These include R1182C, and R1189M. Have you had this problem? It's a KeyError that seems to imply that these patients don't have \"contact\" information. \r\n\r\n```\r\nKeyError                                  Traceback (most recent call last)\r\n<ipython-input-7-4fac8ab55b38> in <module>()\r\n      2 for x in TH1_subjs:\r\n      3     subj = SubjectEEGData(task='RAM_TH1', subject=x)\r\n----> 4     subj.load_data()\r\n      5     subj.save_data()\r\n\r\n/home1/salman.qasim/Salman_Python_Scripts/RAM_ECoG/miller_ecog_tools/SubjectLevel/subject_data.py in load_data(self)\r\n    171         Call super's load data, and then additionally cast data to float32 to take up less space.\r\n    172         \"\"\"\r\n--> 173         super(SubjectEEGData, self).load_data()\r\n    174         if self.subject is not None:\r\n    175             self.subject_data.data = self.subject_data.data.astype('float32')\r\n\r\n/home1/salman.qasim/Salman_Python_Scripts/RAM_ECoG/miller_ecog_tools/SubjectLevel/subject_data.py in load_data(self)\r\n     61         # otherwise compute\r\n     62         if self.subject_data is None:\r\n---> 63             self.subject_data = self.compute_data()\r\n     64 \r\n     65     def unload_data(self):\r\n\r\n/home1/salman.qasim/Salman_Python_Scripts/RAM_ECoG/miller_ecog_tools/SubjectLevel/subject_data.py in compute_data(self)\r\n    210                                                  mean_over_time=self.mean_over_time,\r\n    211                                                  use_mirror_buf=self.use_mirror_buf,\r\n--> 212                                                  loop_over_chans=True)\r\n    213         return subject_data\r\n    214 \r\n\r\n/home1/salman.qasim/Salman_Python_Scripts/RAM_ECoG/miller_ecog_tools/RAM_helpers.py in compute_power(events, freqs, wave_num, rel_start_ms, rel_stop_ms, buf_ms, elec_scheme, noise_freq, resample_freq, mean_over_time, log_power, loop_over_chans, cluster_pool, use_mirror_buf, time_bins)\r\n    427             pow_list = cluster_pool.map(_parallel_compute_power, arg_list)\r\n    428         else:\r\n--> 429             pow_list = list(map(_parallel_compute_power, tqdm(arg_list, disable=True if len(arg_list) == 1 else False)))\r\n    430 \r\n    431         # This is the stupidest thing in the world. I should just be able to do concat(pow_list, dim='channels') or\r\n\r\n/home1/salman.qasim/Salman_Python_Scripts/RAM_ECoG/miller_ecog_tools/RAM_helpers.py in _parallel_compute_power(arg_list)\r\n    465     # first load eeg\r\n    466     eeg = load_eeg(events, rel_start_ms, rel_stop_ms, buf_ms=buf_ms, elec_scheme=elec_scheme,\r\n--> 467                    noise_freq=noise_freq, resample_freq=resample_freq, use_mirror_buf=use_mirror_buf)\r\n    468 \r\n    469     # then compute power\r\n\r\n/home1/salman.qasim/Salman_Python_Scripts/RAM_ECoG/miller_ecog_tools/RAM_helpers.py in load_eeg(events, rel_start_ms, rel_stop_ms, buf_ms, elec_scheme, noise_freq, resample_freq, pass_band, use_mirror_buf, demean)\r\n    241     # Should auto convert to PTSA? Any reason not to?\r\n    242     eeg = CMLReader(subject=events.iloc[0].subject).load_eeg(events, rel_start=actual_start, rel_stop=actual_stop,\r\n--> 243                                                         scheme=elec_scheme).to_ptsa()\r\n    244     if demean:\r\n    245         eeg = eeg.baseline_corrected([rel_start_ms, rel_stop_ms])\r\n\r\n/home1/salman.qasim/.conda/envs/py3_env/lib/python3.6/site-packages/cmlreaders/cmlreader.py in load_eeg(self, events, rel_start, rel_stop, scheme)\r\n    266             })\r\n    267 \r\n--> 268         return self.load('eeg', **kwargs)\r\n    269 \r\n    270     @classmethod\r\n\r\n/home1/salman.qasim/.conda/envs/py3_env/lib/python3.6/site-packages/cmlreaders/cmlreader.py in load(self, data_type, **kwargs)\r\n    213             )\r\n    214 \r\n--> 215         return cls.load(**kwargs)\r\n    216 \r\n    217     def load_eeg(self, events: Optional[pd.DataFrame] = None,\r\n\r\n/home1/salman.qasim/.conda/envs/py3_env/lib/python3.6/site-packages/cmlreaders/readers/eeg.py in load(self, **kwargs)\r\n    475 \r\n    476         events = self._eegfile_absolute(events.copy())\r\n--> 477         return self.as_timeseries(events, kwargs[\"rel_start\"], kwargs[\"rel_stop\"])\r\n    478 \r\n    479     def as_dataframe(self):\r\n\r\n/home1/salman.qasim/.conda/envs/py3_env/lib/python3.6/site-packages/cmlreaders/readers/eeg.py in as_timeseries(self, events, rel_start, rel_stop)\r\n    563 \r\n    564             if self.scheme is not None:\r\n--> 565                 data, labels = reader.rereference(data, contacts)\r\n    566                 channels = labels\r\n    567             else:\r\n\r\n/home1/salman.qasim/.conda/envs/py3_env/lib/python3.6/site-packages/cmlreaders/readers/eeg.py in rereference(self, data, contacts)\r\n    201             return reref, self.scheme[\"label\"].tolist()\r\n    202         else:\r\n--> 203             channels = [contact_to_index[c] for c in self.scheme[\"contact\"]]\r\n    204             subset = np.array(\r\n    205                 [data[i, channels, :] for i in range(data.shape[0])]\r\n\r\n/home1/salman.qasim/.conda/envs/py3_env/lib/python3.6/site-packages/cmlreaders/readers/eeg.py in <listcomp>(.0)\r\n    201             return reref, self.scheme[\"label\"].tolist()\r\n    202         else:\r\n--> 203             channels = [contact_to_index[c] for c in self.scheme[\"contact\"]]\r\n    204             subset = np.array(\r\n    205                 [data[i, channels, :] for i in range(data.shape[0])]\r\n\r\nKeyError: 1\r\n```"},"comment":{"url":"https://api.github.com/repos/jayfmil/RAM_ECoG/issues/comments/410839270","html_url":"https://github.com/jayfmil/RAM_ECoG/issues/1#issuecomment-410839270","issue_url":"https://api.github.com/repos/jayfmil/RAM_ECoG/issues/1","id":410839270,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMDgzOTI3MA==","user":{"login":"jayfmil","id":238252,"node_id":"MDQ6VXNlcjIzODI1Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/238252?v=4","gravatar_id":"","url":"https://api.github.com/users/jayfmil","html_url":"https://github.com/jayfmil","followers_url":"https://api.github.com/users/jayfmil/followers","following_url":"https://api.github.com/users/jayfmil/following{/other_user}","gists_url":"https://api.github.com/users/jayfmil/gists{/gist_id}","starred_url":"https://api.github.com/users/jayfmil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jayfmil/subscriptions","organizations_url":"https://api.github.com/users/jayfmil/orgs","repos_url":"https://api.github.com/users/jayfmil/repos","events_url":"https://api.github.com/users/jayfmil/events{/privacy}","received_events_url":"https://api.github.com/users/jayfmil/received_events","type":"User","site_admin":false},"created_at":"2018-08-06T20:15:44Z","updated_at":"2018-08-06T20:15:44Z","author_association":"OWNER","body":"Yeah there is definitely something weird with that subject. Thee eeg files that the events point to don't exist, at least not in that location.\r\n\r\n`/protocols/r1/subjects/R1189M/experiments/TH1/sessions/0/ephys/current_processed/noreref/R1189M_TH1_0_28Jul16_1918`\r\n\r\n"}}
{"actor":{"display_login":"jayfmil"}}