{"action":"created","comment":{"url":"https://api.github.com/repos/taborlab/FlowCal/pulls/comments/56117299","id":56117299,"diff_hunk":"@@ -450,150 +498,231 @@ def process_samples_table(samples_table,\n                            for h in report_headers_all]\n \n     # Iterate through table\n+    # We will look for a ExcelUIException on each iteration. If an exception\n+    # is caught, it will be stored in beads_samples.\n     for sample_id, sample_row in samples_table.iterrows():\n-\n-        ###\n-        # Instrument Data\n-        ###\n-        # Get the appropriate row in the instrument table\n-        instruments_row = instruments_table.loc[sample_row['Instrument ID']]\n-        # Scatter channels: Foward Scatter, Side Scatter\n-        sc_channels = [instruments_row['Forward Scatter Channel'],\n-                       instruments_row['Side Scatter Channel'],\n-                       ]\n-        # Fluorescence channels is a comma-separated list\n-        fl_channels = instruments_row['Fluorescence Channels'].split(',')\n-        fl_channels = [s.strip() for s in fl_channels]\n-\n-        ###\n-        # Sample Data\n-        ###\n-        if verbose:\n-            print(\"\\nSample ID {}...\".format(sample_id))\n-            print(\"Loading file \\\"{}\\\"...\".format(sample_row['File Path']))\n-\n-        filename = os.path.join(base_dir, sample_row['File Path'])\n-        sample = FlowCal.io.FCSData(filename)\n-\n-        ###\n-        # Transform\n-        ###\n-        if verbose:\n-            print(\"Performing data transformation...\")\n-        # Transform FSC/SSC to linear scale\n-        sample = FlowCal.transform.to_rfi(sample, sc_channels)\n-\n-        # Parse fluorescence channels in which to transform\n-        report_channels = []\n-        report_units = []\n-        for fl_channel in fl_channels:\n-            if fl_channel in report_channels_all:\n-                # Get header from channel name\n-                report_header = report_headers_all[report_channels_all.index(\n-                    fl_channel)]\n-                # Extract text. If empty, ignore.\n-                units_str = sample_row[report_header]\n-                if pd.isnull(units_str):\n-                    continue\n-                # Decide what transformation to perform\n-                units = units_str.strip()\n-                if units.lower() == 'channel':\n-                    units_label = \"Channel Number\"\n-                elif units.lower() == 'rfi':\n-                    units_label = \"Relative Fluorescence Intensity, RFI\"\n-                    sample = FlowCal.transform.to_rfi(sample, fl_channel)\n-                elif units.lower() == 'a.u.' or units.lower() == 'au':\n-                    units_label = \"Arbitrary Units, a.u.\"\n-                    sample = FlowCal.transform.to_rfi(sample, fl_channel)\n-                elif units.lower() == 'mef':\n-                    units_label = \"Molecules of Equivalent Fluorophore, MEF\"\n-                    sample = mef_transform_fxns[sample_row['Beads ID']](\n-                        sample,\n-                        fl_channel)\n-                else:\n-                    raise ValueError(\"units {} not recognized for sample {}\".\n-                        format(units, sample_id))\n-\n-                # Register that reporting in this channel must be done\n-                report_channels.append(fl_channel)\n-                report_units.append(units_label)\n-\n-        ###\n-        # Gate\n-        ###\n-        if verbose:\n-            print(\"Performing gating...\")\n-        # Remove first and last events. Transients in fluidics can make the\n-        # first few and last events slightly different from the rest.\n-        sample_gated = FlowCal.gate.start_end(sample,\n-                                              num_start=250,\n-                                              num_end=100)\n-        # Remove saturating events in forward/side scatter, and fluorescent\n-        # channels to report. The value of a saturating event is taken\n-        # automatically from `sample_gated.domain`.\n-        sample_gated = FlowCal.gate.high_low(sample_gated,\n-                                             sc_channels + report_channels)\n-        # Density gating\n-        sample_gated, __, gate_contour = FlowCal.gate.density2d(\n-            data=sample_gated,\n-            channels=sc_channels,\n-            gate_fraction=sample_row['Gate Fraction'],\n-            full_output=True)\n-\n-        # Accumulate\n-        samples.append(sample_gated)\n-\n-        # Plot forward/side scatter density plot and fluorescence histograms\n-        if plot:\n+        try:\n+            ###\n+            # Instrument Data\n+            ###\n+            # Get the appropriate row in the instrument table\n+            instruments_row = instruments_table.loc[sample_row['Instrument ID']]\n+            # Scatter channels: Foward Scatter, Side Scatter\n+            sc_channels = [instruments_row['Forward Scatter Channel'],\n+                           instruments_row['Side Scatter Channel'],\n+                           ]\n+            # Fluorescence channels is a comma-separated list\n+            fl_channels = instruments_row['Fluorescence Channels'].split(',')\n+            fl_channels = [s.strip() for s in fl_channels]\n+\n+            ###\n+            # Sample Data\n+            ###\n+            if verbose:\n+                print(\"\\nSample ID {}...\".format(sample_id))\n+                print(\"Loading file \\\"{}\\\"...\".format(sample_row['File Path']))\n+\n+            # Attempt to open file\n+            filename = os.path.join(base_dir, sample_row['File Path'])\n+            try:\n+                sample = FlowCal.io.FCSData(filename)\n+            except:\n+                raise ExcelUIException(\"file \\\"{}\\\" not found\".format(\n+                    sample_row['File Path']))\n+            # Check that the number of events is greater than 500\n+            if sample.shape[0] < 500:\n+                raise ExcelUIException(\"number of events is lower than 500\")","path":"FlowCal/excel_ui.py","position":512,"original_position":512,"commit_id":"011244f96ea8c7b71624505192fa9821bf128735","original_commit_id":"011244f96ea8c7b71624505192fa9821bf128735","user":{"login":"JS3xton","id":2179825,"avatar_url":"https://avatars.githubusercontent.com/u/2179825?v=3","gravatar_id":"","url":"https://api.github.com/users/JS3xton","html_url":"https://github.com/JS3xton","followers_url":"https://api.github.com/users/JS3xton/followers","following_url":"https://api.github.com/users/JS3xton/following{/other_user}","gists_url":"https://api.github.com/users/JS3xton/gists{/gist_id}","starred_url":"https://api.github.com/users/JS3xton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JS3xton/subscriptions","organizations_url":"https://api.github.com/users/JS3xton/orgs","repos_url":"https://api.github.com/users/JS3xton/repos","events_url":"https://api.github.com/users/JS3xton/events{/privacy}","received_events_url":"https://api.github.com/users/JS3xton/received_events","type":"User","site_admin":false},"body":"same as above. where'd this hardcoded 500 come from?","created_at":"2016-03-15T05:41:28Z","updated_at":"2016-03-15T05:41:28Z","html_url":"https://github.com/taborlab/FlowCal/pull/194#discussion_r56117299","pull_request_url":"https://api.github.com/repos/taborlab/FlowCal/pulls/194","_links":{"self":{"href":"https://api.github.com/repos/taborlab/FlowCal/pulls/comments/56117299"},"html":{"href":"https://github.com/taborlab/FlowCal/pull/194#discussion_r56117299"},"pull_request":{"href":"https://api.github.com/repos/taborlab/FlowCal/pulls/194"}}},"pull_request":{"url":"https://api.github.com/repos/taborlab/FlowCal/pulls/194","id":62680740,"html_url":"https://github.com/taborlab/FlowCal/pull/194","diff_url":"https://github.com/taborlab/FlowCal/pull/194.diff","patch_url":"https://github.com/taborlab/FlowCal/pull/194.patch","issue_url":"https://api.github.com/repos/taborlab/FlowCal/issues/194","number":194,"state":"open","locked":false,"title":"Excel ui exceptions","user":{"login":"castillohair","id":1529481,"avatar_url":"https://avatars.githubusercontent.com/u/1529481?v=3","gravatar_id":"","url":"https://api.github.com/users/castillohair","html_url":"https://github.com/castillohair","followers_url":"https://api.github.com/users/castillohair/followers","following_url":"https://api.github.com/users/castillohair/following{/other_user}","gists_url":"https://api.github.com/users/castillohair/gists{/gist_id}","starred_url":"https://api.github.com/users/castillohair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/castillohair/subscriptions","organizations_url":"https://api.github.com/users/castillohair/orgs","repos_url":"https://api.github.com/users/castillohair/repos","events_url":"https://api.github.com/users/castillohair/events{/privacy}","received_events_url":"https://api.github.com/users/castillohair/received_events","type":"User","site_admin":false},"body":"Addresses #184, #126, #99, #98, #65, and #38, and probably some more. It would potentially handle #130, although we now want to support linear amplifiers.\r\n\r\nIntroduces handling of (some) exceptions without crashing. Examples of things that are now covered are:\r\n- missing file path\r\n- MEF transformation requested in a channel for which a standard curve does not exist\r\n- low number of events\r\n- acquisition settings of beads and samples are different\r\n\r\nInstead of crashing, the Excel UI now aborts execution of the current sample and prints the error to both the console (if verbose mode is on) and the Excel output file, column \"Successful?\".\r\n\r\nThis has the interesting side effect that some of our example files are no longer valid, since some beads and samples have not been acquired at the same detector voltage.","created_at":"2016-03-13T19:41:19Z","updated_at":"2016-03-15T05:41:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d5c421ccb89831e251f7336ab8ea93f0281c339f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/taborlab/FlowCal/pulls/194/commits","review_comments_url":"https://api.github.com/repos/taborlab/FlowCal/pulls/194/comments","review_comment_url":"https://api.github.com/repos/taborlab/FlowCal/pulls/comments{/number}","comments_url":"https://api.github.com/repos/taborlab/FlowCal/issues/194/comments","statuses_url":"https://api.github.com/repos/taborlab/FlowCal/statuses/011244f96ea8c7b71624505192fa9821bf128735","head":{"label":"taborlab:excel-ui-exceptions","ref":"excel-ui-exceptions","sha":"011244f96ea8c7b71624505192fa9821bf128735","user":{"login":"taborlab","id":6797549,"avatar_url":"https://avatars.githubusercontent.com/u/6797549?v=3","gravatar_id":"","url":"https://api.github.com/users/taborlab","html_url":"https://github.com/taborlab","followers_url":"https://api.github.com/users/taborlab/followers","following_url":"https://api.github.com/users/taborlab/following{/other_user}","gists_url":"https://api.github.com/users/taborlab/gists{/gist_id}","starred_url":"https://api.github.com/users/taborlab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taborlab/subscriptions","organizations_url":"https://api.github.com/users/taborlab/orgs","repos_url":"https://api.github.com/users/taborlab/repos","events_url":"https://api.github.com/users/taborlab/events{/privacy}","received_events_url":"https://api.github.com/users/taborlab/received_events","type":"Organization","site_admin":false},"repo":{"id":38354829,"name":"FlowCal","full_name":"taborlab/FlowCal","owner":{"login":"taborlab","id":6797549,"avatar_url":"https://avatars.githubusercontent.com/u/6797549?v=3","gravatar_id":"","url":"https://api.github.com/users/taborlab","html_url":"https://github.com/taborlab","followers_url":"https://api.github.com/users/taborlab/followers","following_url":"https://api.github.com/users/taborlab/following{/other_user}","gists_url":"https://api.github.com/users/taborlab/gists{/gist_id}","starred_url":"https://api.github.com/users/taborlab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taborlab/subscriptions","organizations_url":"https://api.github.com/users/taborlab/orgs","repos_url":"https://api.github.com/users/taborlab/repos","events_url":"https://api.github.com/users/taborlab/events{/privacy}","received_events_url":"https://api.github.com/users/taborlab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/taborlab/FlowCal","description":"Python Flow Cytometry Calibration Library","fork":false,"url":"https://api.github.com/repos/taborlab/FlowCal","forks_url":"https://api.github.com/repos/taborlab/FlowCal/forks","keys_url":"https://api.github.com/repos/taborlab/FlowCal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/taborlab/FlowCal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/taborlab/FlowCal/teams","hooks_url":"https://api.github.com/repos/taborlab/FlowCal/hooks","issue_events_url":"https://api.github.com/repos/taborlab/FlowCal/issues/events{/number}","events_url":"https://api.github.com/repos/taborlab/FlowCal/events","assignees_url":"https://api.github.com/repos/taborlab/FlowCal/assignees{/user}","branches_url":"https://api.github.com/repos/taborlab/FlowCal/branches{/branch}","tags_url":"https://api.github.com/repos/taborlab/FlowCal/tags","blobs_url":"https://api.github.com/repos/taborlab/FlowCal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/taborlab/FlowCal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/taborlab/FlowCal/git/refs{/sha}","trees_url":"https://api.github.com/repos/taborlab/FlowCal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/taborlab/FlowCal/statuses/{sha}","languages_url":"https://api.github.com/repos/taborlab/FlowCal/languages","stargazers_url":"https://api.github.com/repos/taborlab/FlowCal/stargazers","contributors_url":"https://api.github.com/repos/taborlab/FlowCal/contributors","subscribers_url":"https://api.github.com/repos/taborlab/FlowCal/subscribers","subscription_url":"https://api.github.com/repos/taborlab/FlowCal/subscription","commits_url":"https://api.github.com/repos/taborlab/FlowCal/commits{/sha}","git_commits_url":"https://api.github.com/repos/taborlab/FlowCal/git/commits{/sha}","comments_url":"https://api.github.com/repos/taborlab/FlowCal/comments{/number}","issue_comment_url":"https://api.github.com/repos/taborlab/FlowCal/issues/comments{/number}","contents_url":"https://api.github.com/repos/taborlab/FlowCal/contents/{+path}","compare_url":"https://api.github.com/repos/taborlab/FlowCal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/taborlab/FlowCal/merges","archive_url":"https://api.github.com/repos/taborlab/FlowCal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/taborlab/FlowCal/downloads","issues_url":"https://api.github.com/repos/taborlab/FlowCal/issues{/number}","pulls_url":"https://api.github.com/repos/taborlab/FlowCal/pulls{/number}","milestones_url":"https://api.github.com/repos/taborlab/FlowCal/milestones{/number}","notifications_url":"https://api.github.com/repos/taborlab/FlowCal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/taborlab/FlowCal/labels{/name}","releases_url":"https://api.github.com/repos/taborlab/FlowCal/releases{/id}","deployments_url":"https://api.github.com/repos/taborlab/FlowCal/deployments","created_at":"2015-07-01T06:50:32Z","updated_at":"2016-02-18T01:14:13Z","pushed_at":"2016-03-13T19:41:20Z","git_url":"git://github.com/taborlab/FlowCal.git","ssh_url":"git@github.com:taborlab/FlowCal.git","clone_url":"https://github.com/taborlab/FlowCal.git","svn_url":"https://github.com/taborlab/FlowCal","homepage":"","size":9899,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":28,"forks":1,"open_issues":28,"watchers":3,"default_branch":"master"}},"base":{"label":"taborlab:develop","ref":"develop","sha":"2a8605f998b45ce2fae322b7b93261f4937e48c5","user":{"login":"taborlab","id":6797549,"avatar_url":"https://avatars.githubusercontent.com/u/6797549?v=3","gravatar_id":"","url":"https://api.github.com/users/taborlab","html_url":"https://github.com/taborlab","followers_url":"https://api.github.com/users/taborlab/followers","following_url":"https://api.github.com/users/taborlab/following{/other_user}","gists_url":"https://api.github.com/users/taborlab/gists{/gist_id}","starred_url":"https://api.github.com/users/taborlab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taborlab/subscriptions","organizations_url":"https://api.github.com/users/taborlab/orgs","repos_url":"https://api.github.com/users/taborlab/repos","events_url":"https://api.github.com/users/taborlab/events{/privacy}","received_events_url":"https://api.github.com/users/taborlab/received_events","type":"Organization","site_admin":false},"repo":{"id":38354829,"name":"FlowCal","full_name":"taborlab/FlowCal","owner":{"login":"taborlab","id":6797549,"avatar_url":"https://avatars.githubusercontent.com/u/6797549?v=3","gravatar_id":"","url":"https://api.github.com/users/taborlab","html_url":"https://github.com/taborlab","followers_url":"https://api.github.com/users/taborlab/followers","following_url":"https://api.github.com/users/taborlab/following{/other_user}","gists_url":"https://api.github.com/users/taborlab/gists{/gist_id}","starred_url":"https://api.github.com/users/taborlab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taborlab/subscriptions","organizations_url":"https://api.github.com/users/taborlab/orgs","repos_url":"https://api.github.com/users/taborlab/repos","events_url":"https://api.github.com/users/taborlab/events{/privacy}","received_events_url":"https://api.github.com/users/taborlab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/taborlab/FlowCal","description":"Python Flow Cytometry Calibration Library","fork":false,"url":"https://api.github.com/repos/taborlab/FlowCal","forks_url":"https://api.github.com/repos/taborlab/FlowCal/forks","keys_url":"https://api.github.com/repos/taborlab/FlowCal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/taborlab/FlowCal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/taborlab/FlowCal/teams","hooks_url":"https://api.github.com/repos/taborlab/FlowCal/hooks","issue_events_url":"https://api.github.com/repos/taborlab/FlowCal/issues/events{/number}","events_url":"https://api.github.com/repos/taborlab/FlowCal/events","assignees_url":"https://api.github.com/repos/taborlab/FlowCal/assignees{/user}","branches_url":"https://api.github.com/repos/taborlab/FlowCal/branches{/branch}","tags_url":"https://api.github.com/repos/taborlab/FlowCal/tags","blobs_url":"https://api.github.com/repos/taborlab/FlowCal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/taborlab/FlowCal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/taborlab/FlowCal/git/refs{/sha}","trees_url":"https://api.github.com/repos/taborlab/FlowCal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/taborlab/FlowCal/statuses/{sha}","languages_url":"https://api.github.com/repos/taborlab/FlowCal/languages","stargazers_url":"https://api.github.com/repos/taborlab/FlowCal/stargazers","contributors_url":"https://api.github.com/repos/taborlab/FlowCal/contributors","subscribers_url":"https://api.github.com/repos/taborlab/FlowCal/subscribers","subscription_url":"https://api.github.com/repos/taborlab/FlowCal/subscription","commits_url":"https://api.github.com/repos/taborlab/FlowCal/commits{/sha}","git_commits_url":"https://api.github.com/repos/taborlab/FlowCal/git/commits{/sha}","comments_url":"https://api.github.com/repos/taborlab/FlowCal/comments{/number}","issue_comment_url":"https://api.github.com/repos/taborlab/FlowCal/issues/comments{/number}","contents_url":"https://api.github.com/repos/taborlab/FlowCal/contents/{+path}","compare_url":"https://api.github.com/repos/taborlab/FlowCal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/taborlab/FlowCal/merges","archive_url":"https://api.github.com/repos/taborlab/FlowCal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/taborlab/FlowCal/downloads","issues_url":"https://api.github.com/repos/taborlab/FlowCal/issues{/number}","pulls_url":"https://api.github.com/repos/taborlab/FlowCal/pulls{/number}","milestones_url":"https://api.github.com/repos/taborlab/FlowCal/milestones{/number}","notifications_url":"https://api.github.com/repos/taborlab/FlowCal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/taborlab/FlowCal/labels{/name}","releases_url":"https://api.github.com/repos/taborlab/FlowCal/releases{/id}","deployments_url":"https://api.github.com/repos/taborlab/FlowCal/deployments","created_at":"2015-07-01T06:50:32Z","updated_at":"2016-02-18T01:14:13Z","pushed_at":"2016-03-13T19:41:20Z","git_url":"git://github.com/taborlab/FlowCal.git","ssh_url":"git@github.com:taborlab/FlowCal.git","clone_url":"https://github.com/taborlab/FlowCal.git","svn_url":"https://github.com/taborlab/FlowCal","homepage":"","size":9899,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":28,"forks":1,"open_issues":28,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/taborlab/FlowCal/pulls/194"},"html":{"href":"https://github.com/taborlab/FlowCal/pull/194"},"issue":{"href":"https://api.github.com/repos/taborlab/FlowCal/issues/194"},"comments":{"href":"https://api.github.com/repos/taborlab/FlowCal/issues/194/comments"},"review_comments":{"href":"https://api.github.com/repos/taborlab/FlowCal/pulls/194/comments"},"review_comment":{"href":"https://api.github.com/repos/taborlab/FlowCal/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/taborlab/FlowCal/pulls/194/commits"},"statuses":{"href":"https://api.github.com/repos/taborlab/FlowCal/statuses/011244f96ea8c7b71624505192fa9821bf128735"}}}}