Skip to content

Commit

Permalink
scatter plot
Browse files Browse the repository at this point in the history
  • Loading branch information
tathey1 committed Jan 3, 2024
1 parent 8c98326 commit ed9df83
Show file tree
Hide file tree
Showing 14 changed files with 48 additions and 347 deletions.
25 changes: 6 additions & 19 deletions brainlit/BrainLine/analyze_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,17 +459,14 @@ def region_barchart(
"y": "Region",
"hue": "Subtype",
"data": df,
# "jitter": False,
"dodge": True,
}

sns.set(font_scale=2)
bplot = sns.stripplot(ax=axes[0, 0], orient="h", legend=False, **fig_args)
bplot = sns.scatterplot(ax=axes[0, 0], **fig_args)
fig_args["boxprops"] = {"facecolor": "none"}
bplot = sns.boxplot(ax=axes[0, 0], orient="h", **fig_args)
bplot.set_xscale("log")

fig_args.pop("dodge")
fig_args.pop("boxprops")
fig_args["style"] = "Brain ID"
sns.scatterplot(ax=axes[1, 0], **fig_args)
Expand All @@ -483,14 +480,12 @@ def region_barchart(

# second panel
fig_args["x"] = "Percent of Total Somas (%)"
fig_args["dodge"] = True

bplot = sns.stripplot(ax=axes[0, 1], orient="h", legend=False, **fig_args)
bplot = sns.scatterplot(ax=axes[0, 1], **fig_args)
fig_args["boxprops"] = {"facecolor": "none"}
bplot = sns.boxplot(ax=axes[0, 1], orient="h", **fig_args)
bplot.set_xscale("log")

fig_args.pop("dodge")
fig_args.pop("boxprops")
fig_args["style"] = "Brain ID"
sns.scatterplot(ax=axes[1, 1], **fig_args)
Expand All @@ -507,15 +502,13 @@ def region_barchart(
# third panel
if normalize_region >= 0:
fig_args["x"] = "Normalized Somas"
fig_args["dodge"] = True

sns.set(font_scale=2)
bplot = sns.stripplot(ax=axes[0, 2], orient="h", legend=False, **fig_args)
bplot = sns.scatterplot(ax=axes[0, 2], **fig_args)
fig_args["boxprops"] = {"facecolor": "none"}
bplot = sns.boxplot(ax=axes[0, 2], orient="h", **fig_args)
bplot.set_xscale("log")

fig_args.pop("dodge")
fig_args.pop("boxprops")
fig_args["style"] = "Brain ID"
sns.scatterplot(ax=axes[1, 2], **fig_args)
Expand Down Expand Up @@ -1199,12 +1192,10 @@ def region_barchart(
"y": "Region",
"hue": "Subtype",
"data": df,
# "jitter": False,
"dodge": True,
}

sns.set(font_scale=2)
bplot = sns.stripplot(ax=axes[0], orient="h", legend=False, **fig_args)
bplot = sns.scatterplot(ax=axes[0], **fig_args)
fig_args["boxprops"] = {"facecolor": "none"}
bplot = sns.boxplot(ax=axes[0], orient="h", **fig_args)
bplot.set_xscale("log")
Expand All @@ -1220,11 +1211,9 @@ def region_barchart(
"y": "Region",
"hue": "Subtype",
"data": df,
# "jitter": False,
"dodge": True,
}

bplot = sns.stripplot(ax=axes[1], orient="h", legend=False, **fig_args)
bplot = sns.scatterplot(ax=axes[1], **fig_args)
fig_args["boxprops"] = {"facecolor": "none"}
bplot = sns.boxplot(ax=axes[1], orient="h", **fig_args)
bplot.set_xscale("log")
Expand All @@ -1243,12 +1232,10 @@ def region_barchart(
"y": "Region",
"hue": "Subtype",
"data": df,
# "jitter": False,
"dodge": True,
}

sns.set(font_scale=2)
bplot = sns.stripplot(ax=axes[2], orient="h", legend=False, **fig_args)
bplot = sns.scatterplot(ax=axes[2], **fig_args)
fig_args["boxprops"] = {"facecolor": "none"}
bplot = sns.boxplot(ax=axes[2], orient="h", **fig_args)
bplot.set_xscale("log")
Expand Down
5 changes: 4 additions & 1 deletion docs/notebooks/pipelines/BrainLine/axon_analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@
"with open(data_file, \"r\") as f:\n",
" data = json.load(f)\n",
"\n",
"data[\"brain2paths\"][\"test\"][\"base\"] = (\n",
"\n",
"base = (\n",
" \"precomputed://file://\"\n",
" + str(\n",
" brainlit_path\n",
Expand All @@ -129,6 +130,8 @@
" )\n",
" + \"/\"\n",
")\n",
"data[\"brain2paths\"][\"test\"][\"base_s3\"] = base\n",
"data[\"brain2paths\"][\"test\"][\"base_local\"] = base\n",
"\n",
"brain2paths = data[\"brain2paths\"]\n",
"\n",
Expand Down
3 changes: 1 addition & 2 deletions docs/notebooks/pipelines/BrainLine/axon_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
"url": "https://viz.neurodata.io/?json_url=https://json.neurodata.io/v1?NGStateID=Ap9ZkdUyOAZqMg",
"layer": "val"
},
"subtype": "test_type",
"base": "precomputed://file:///Users/thomasathey/Documents/mimlab/mouselight/brainlit_parent/brainlit/docs/notebooks/pipelines/BrainLine/example-data/"
"subtype": "test_type"
},
"pytest": {
"base_s3": "precomputed://https://open-neurodata.s3.amazonaws.com/ara_2016/sagittal_10um/",
Expand Down
4 changes: 3 additions & 1 deletion docs/notebooks/pipelines/BrainLine/soma_analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"with open(data_file, \"r\") as f:\n",
" data = json.load(f)\n",
"\n",
"data[\"brain2paths\"][\"test\"][\"base\"] = (\n",
"base = (\n",
" \"precomputed://file://\"\n",
" + str(\n",
" brainlit_path\n",
Expand All @@ -130,6 +130,8 @@
" )\n",
" + \"/\"\n",
")\n",
"data[\"brain2paths\"][\"test\"][\"base_s3\"] = base\n",
"data[\"brain2paths\"][\"test\"][\"base_local\"] = base\n",
"\n",
"brain2paths = data[\"brain2paths\"]\n",
"\n",
Expand Down
3 changes: 1 addition & 2 deletions docs/notebooks/pipelines/BrainLine/soma_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
"nonsomas_layer": "nonsoma_val"
},
"somas_atlas_url": "https://ara.viz.neurodata.io/?json_url=https://json.neurodata.io/v1?NGStateID=iRoE0KP6J0ULDg",
"subtype": "test_type",
"base": "precomputed://file:///Users/thomasathey/Documents/mimlab/mouselight/brainlit_parent/brainlit/docs/notebooks/pipelines/BrainLine/example-data/"
"subtype": "test_type"
},
"biccn": {
"somas_atlas_url": "https://ara.viz.neurodata.io/?json_url=https://json.neurodata.io/v1?NGStateID=8VHD-seixZg9pg",
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
25 changes: 10 additions & 15 deletions experiments/BrainLine/data/axon_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"filepath": "/Users/thomasathey/Documents/mimlab/mouselight/ailey/ara/ara_10um.tif"
},
"test": {
"base": "precomputed://file:///Users/thomasathey/Documents/mimlab/mouselight/brainlit_parent/brainlit/brainlit/BrainLine/data/example/",
"base_s3": "precomputed://file:///Users/thomasathey/Documents/mimlab/mouselight/brainlit_parent/brainlit/brainlit/BrainLine/data/example/",
"base_local": "precomputed://file:///Users/thomasathey/Documents/mimlab/mouselight/brainlit_parent/brainlit/brainlit/BrainLine/data/example/",
"transformed_mask": "precomputed://file:///Users/thomasathey/Documents/mimlab/mouselight/brainlit_parent/brainlit/brainlit/BrainLine/data/example/axon_mask_transformed/",
"val_info": {
"url": "https://viz.neurodata.io/?json_url=https://json.neurodata.io/v1?NGStateID=rywXvJ3kVOV71w",
Expand Down Expand Up @@ -38,7 +39,7 @@
"subtype": "sert cre"
},
"8613": {
"base": "precomputed://s3://smartspim-precomputed-volumes/2022_01_14/8613/",
"base_s3": "precomputed://s3://smartspim-precomputed-volumes/2022_01_14/8613/",
"transformed_mask": "precomputed://s3://smartspim-precomputed-volumes/2022_01_14/8613/axon_mask_transformed",
"subtype": "tph2 vglut3"
},
Expand All @@ -54,7 +55,7 @@
"subtype": "tbd"
},
"8650": {
"base": "precomputed://s3://smartspim-precomputed-volumes/2022_01_21/8650/",
"base_s3": "precomputed://s3://smartspim-precomputed-volumes/2022_01_21/8650/",
"transformed_mask": "precomputed://s3://smartspim-precomputed-volumes/2022_01_21/8650/axon_mask_transformed",
"val_info": {
"url": "https://viz.neurodata.io/?json_url=https://json.neurodata.io/v1?NGStateID=tnXt-hF7Uyuq-w",
Expand All @@ -63,7 +64,7 @@
"subtype": "tph2 gad2"
},
"8589": {
"base": "precomputed://s3://smartspim-precomputed-volumes/2022_11_03/8589/",
"base_s3": "precomputed://s3://smartspim-precomputed-volumes/2022_11_03/8589/",
"transformed_mask": "precomputed://s3://smartspim-precomputed-volumes/2022_11_03/8589/axon_mask_transformed",
"val_info": {
"url": "https://viz.neurodata.io/?json_url=https://json.neurodata.io/v1?NGStateID=sCrJq3bVmN5N4Q",
Expand All @@ -72,7 +73,7 @@
"subtype": "tph2 vglut3"
},
"8590": {
"base": "precomputed://s3://smartspim-precomputed-volumes/2022_03_04/8590/",
"base_s3": "precomputed://s3://smartspim-precomputed-volumes/2022_03_04/8590/",
"transformed_mask": "precomputed://s3://smartspim-precomputed-volumes/2022_03_04/8590/axon_mask_transformed",
"val_info": {
"url": "https://viz.neurodata.io/?json_url=https://json.neurodata.io/v1?NGStateID=gq91htCi35XdPw",
Expand All @@ -81,7 +82,7 @@
"subtype": "tph2 vglut3"
},
"8649": {
"base": "precomputed://s3://smartspim-precomputed-volumes/2022_03_28/8649/",
"base_s3": "precomputed://s3://smartspim-precomputed-volumes/2022_03_28/8649/",
"transformed_mask": "precomputed://s3://smartspim-precomputed-volumes/2022_03_28/8649/axon_mask_transformed",
"val_info": {
"url": "https://viz.neurodata.io/?json_url=https://json.neurodata.io/v1?NGStateID=b0unpdsrz-bO6A",
Expand Down Expand Up @@ -139,7 +140,7 @@
"transformed_mask": "precomputed://s3://smartspim-precomputed-volumes/2022_10_26/11537/axon_mask_transformed"
},
"8786": {
"base": "precomputed://s3://smartspim-precomputed-volumes/2022_11_02/8786/",
"base_s3": "precomputed://s3://smartspim-precomputed-volumes/2022_11_02/8786/",
"val_info": {
"url": "https://viz.neurodata.io/?json_url=https://json.neurodata.io/v1?NGStateID=YRB3G4Hn19TjIA",
"layer": "val"
Expand All @@ -148,7 +149,7 @@
"transformed_mask": "precomputed://s3://smartspim-precomputed-volumes/2022_11_02/8786/axon_mask_transformed"
},
"8790": {
"base": "precomputed://s3://smartspim-precomputed-volumes/2022_11_01/8790/",
"base_s3": "precomputed://s3://smartspim-precomputed-volumes/2022_11_01/8790/",
"val_info": {
"url": "https://viz.neurodata.io/?json_url=https://json.neurodata.io/v1?NGStateID=hhlEcKDIfqrY-w",
"layer": "val"
Expand All @@ -157,7 +158,6 @@
"transformed_mask": "precomputed://s3://smartspim-precomputed-volumes/2022_11_01/8790/axon_mask_transformed"
},
"MS32": {
"base": "precomputed://s3://smartspim-precomputed-volumes/2023_04_03/MS32/",
"base_s3": "precomputed://s3://smartspim-precomputed-volumes/2023_04_03/MS32/",
"val_info": {
"url": "/Users/thomasathey/Documents/mimlab/mouselight/ailey/detection_axon/brainMS32/val.json",
Expand All @@ -172,7 +172,6 @@
"transformed_mask": "precomputed://s3://smartspim-precomputed-volumes/2023_04_03/MS32/axon_mask_transformed"
},
"MS15": {
"base": "precomputed://s3://smartspim-precomputed-volumes/2023_04_03/MS15/",
"base_s3": "precomputed://s3://smartspim-precomputed-volumes/2023_04_03/MS15/",
"val_info": {
"url": "https://viz.neurodata.io/?json_url=https://json.neurodata.io/v1?NGStateID=uN171hvFEvDw-Q",
Expand All @@ -182,7 +181,6 @@
"transformed_mask": "precomputed://s3://smartspim-precomputed-volumes/2023_04_03/MS15/axon_mask_transformed"
},
"MS29": {
"base": "precomputed://s3://smartspim-precomputed-volumes/2023_04_07/MS29/",
"base_s3": "precomputed://s3://smartspim-precomputed-volumes/2023_04_07/MS29/",
"val_info": {
"url": "https://viz.neurodata.io/?json_url=https://json.neurodata.io/v1?NGStateID=gf8YOhsEvdGXgQ",
Expand All @@ -196,7 +194,6 @@
"transformed_mask": "precomputed://s3://smartspim-precomputed-volumes/2023_04_07/MS29/axon_mask_transformed"
},
"MS11": {
"base": "precomputed://s3://smartspim-precomputed-volumes/2023_04_10/MS11/",
"base_s3": "precomputed://s3://smartspim-precomputed-volumes/2023_04_10/MS11/",
"val_info": {
"url": "https://viz.neurodata.io/?json_url=https://json.neurodata.io/v1?NGStateID=kcPAtNm-SdK2IQ",
Expand All @@ -216,15 +213,14 @@
"transformed_mask": "precomputed://s3://smartspim-precomputed-volumes/2023_04_10/MS12/axon_mask_transformed"
},
"MS10": {
"base": "precomputed://s3://smartspim-precomputed-volumes/2023_04_28/MS10/",
"base_s3": "precomputed://s3://smartspim-precomputed-volumes/2023_04_28/MS10/",
"val_info": {
"url": "https://viz.neurodata.io/?json_url=https://json.neurodata.io/v1?NGStateID=43c44vvUgelrsw",
"layer": "val"
},
"subtype": "gad2 vgat"
},
"MS9": {
"base": "precomputed://file:///mnt/data/Neuroglancer_Data/2023_05_24/MS9/",
"base_s3": "precomputed://s3://smartspim-precomputed-volumes/2023_05_24/MS9/",
"val_info": {
"url": "https://viz.neurodata.io/?json_url=https://json.neurodata.io/v1?NGStateID=30O_uxkW67rv2Q",
Expand All @@ -234,7 +230,6 @@
"transformed_mask": "precomputed://s3://smartspim-precomputed-volumes/2023_05_24/MS9/axon_mask_transformed"
},
"MS33": {
"base": "precomputed://s3://smartspim-precomputed-volumes/2023_09_18/MS33/",
"base_s3": "precomputed://s3://smartspim-precomputed-volumes/2023_09_18/MS33/",
"val_info": {
"url": "https://viz.neurodata.io/?json_url=https://json.neurodata.io/v1?NGStateID=H3idZ1oxxfEWdg",
Expand Down

0 comments on commit ed9df83

Please sign in to comment.