Skip to content

Commit

Permalink
Connectivity tags
Browse files Browse the repository at this point in the history
  • Loading branch information
arie-matsliah committed Jul 18, 2023
1 parent 48661cb commit 27cf901
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 26 deletions.
5 changes: 4 additions & 1 deletion src/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@
"coordinates": "Marked neuron coordinates. "
"FlyWire Supervoxel IDs and position coordinates for cells in the dataset. One cell might have zero or more "
"marked coordinates and supervoxel IDs.",
"neuropil_synapse_table": "In-out synapse & partner counts by neuropil. "
"connectivity_tags": "Descriptors for neurons connectivity characteristics, derived from network analysis. Each "
"neuron can have 0 or more tags, separated by commas in the second column. "
'See <a href="" data-toggle="modal" data-target="#connectivityTagsModal">details</a>.',
"neuropil_synapse_table": "In-out synapse & partner counts by neuropil."
"For every cell and neuropil (region), contains the number of input and output synapses, as well as the "
"number of input and output partners the cell has in that neuropil. One row for each cell with the first "
"column containing the FlyWire Root ID of the cell, followed by a column for every combination of neuropil X "
Expand Down
54 changes: 34 additions & 20 deletions src/data/downloadable_files_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
"morphology_clusters.csv.gz": 736744,
"connectivity_clusters.csv.gz": 522912,
"connections.csv.gz": 26124953,
"labels.csv.gz": 3519519,
"labels.csv.gz": 3533768,
"coordinates.csv.gz": 4584155,
"connectivity_tags.csv.gz": 653687,
"neuropil_synapse_table.csv.gz": 4490002
},
"571": {
Expand All @@ -17,8 +18,9 @@
"cell_stats.csv.gz": 2257920,
"morphology_clusters.csv.gz": 209413,
"connections.csv.gz": 32220716,
"labels.csv.gz": 2924127,
"labels.csv.gz": 3049771,
"coordinates.csv.gz": 3945113,
"connectivity_tags.csv.gz": 616461,
"neuropil_synapse_table.csv.gz": 2866446
}
},
Expand Down Expand Up @@ -82,17 +84,17 @@
"col 5 - nt_type": "6 unique values"
},
"labels.csv.gz": {
"# rows": "123,985 (+ header)",
"# rows": "124,394 (+ header)",
"# columns": "9",
"col 1 - root_id": "90,112 unique values",
"col 2 - label": "6,601 unique values",
"col 3 - user_id": "132 unique values",
"col 4 - position": "102,955 unique values",
"col 5 - supervoxel_id": "102,224 unique values",
"col 1 - root_id": "90,394 unique values",
"col 2 - label": "6,612 unique values",
"col 3 - user_id": "133 unique values",
"col 4 - position": "103,364 unique values",
"col 5 - supervoxel_id": "102,633 unique values",
"col 6 - label_id": "all rows contain unique values",
"col 7 - date_created": "37,271 unique values",
"col 8 - user_name": "129 unique values in 123,335 rows, empty in 650 rows",
"col 9 - user_affiliation": "52 unique values in 123,272 rows, empty in 713 rows"
"col 7 - date_created": "37,443 unique values",
"col 8 - user_name": "130 unique values in 123,744 rows, empty in 650 rows",
"col 9 - user_affiliation": "52 unique values in 123,681 rows, empty in 713 rows"
},
"coordinates.csv.gz": {
"# rows": "207,700 (+ header)",
Expand All @@ -101,6 +103,12 @@
"col 2 - position": "196,123 unique values",
"col 3 - supervoxel_id": "193,412 unique values"
},
"connectivity_tags.csv.gz": {
"# rows": "117,334 (+ header)",
"# columns": "2",
"col 1 - root_id": "all rows contain unique values",
"col 2 - connectivity_tag": "69 unique values"
},
"neuropil_synapse_table.csv.gz": {
"# rows": "124,891 (+ header)",
"# columns": "321",
Expand Down Expand Up @@ -480,17 +488,17 @@
"col 5 - nt_type": "6 unique values"
},
"labels.csv.gz": {
"# rows": "110,661 (+ header)",
"# rows": "114,356 (+ header)",
"# columns": "9",
"col 1 - root_id": "79,296 unique values",
"col 2 - label": "6,221 unique values",
"col 3 - user_id": "129 unique values",
"col 4 - position": "90,152 unique values",
"col 5 - supervoxel_id": "89,501 unique values",
"col 1 - root_id": "82,182 unique values",
"col 2 - label": "6,325 unique values",
"col 3 - user_id": "130 unique values",
"col 4 - position": "93,844 unique values",
"col 5 - supervoxel_id": "93,191 unique values",
"col 6 - label_id": "all rows contain unique values",
"col 7 - date_created": "4,496 unique values",
"col 8 - user_name": "126 unique values in 110,020 rows, empty in 641 rows",
"col 9 - user_affiliation": "50 unique values in 109,957 rows, empty in 704 rows"
"col 7 - date_created": "5,688 unique values",
"col 8 - user_name": "127 unique values in 113,715 rows, empty in 641 rows",
"col 9 - user_affiliation": "50 unique values in 113,652 rows, empty in 704 rows"
},
"coordinates.csv.gz": {
"# rows": "179,104 (+ header)",
Expand All @@ -499,6 +507,12 @@
"col 2 - position": "169,473 unique values",
"col 3 - supervoxel_id": "167,584 unique values"
},
"connectivity_tags.csv.gz": {
"# rows": "111,607 (+ header)",
"# columns": "2",
"col 1 - root_id": "all rows contain unique values",
"col 2 - connectivity_tag": "27 unique values"
},
"neuropil_synapse_table.csv.gz": {
"# rows": "117,605 (+ header)",
"# columns": "301",
Expand Down
5 changes: 2 additions & 3 deletions src/service/cell_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
display,
)
from src.utils.graph_algos import reachable_node_counts
from src.utils.markers import extract_markers


@lru_cache
Expand Down Expand Up @@ -102,7 +101,7 @@ def cached_cell_details(
"Connectivity Tags<br><small>"
'<a href="" data-toggle="modal" data-target="#connectivityTagsModal">'
'info & credits <i class="fa-solid fa-up-right-from-square"></i></a></small>': concat_labels(
extract_markers(neuron_data=nd, markers_type="connectivity_label")
nd["connectivity_tag"]
),
"Community Labels<br><small>"
f'<a href="{url_for("app.labeling_log", root_id=root_id)}" target="_blank">'
Expand Down Expand Up @@ -155,7 +154,7 @@ def insert_further_analysis_links(key, icon, search_endpoint):
"app.search", filter_string=f"{OP_DOWNSTREAM} {root_id}"
),
)
if "connectivity_label:reciprocal" in nd["marker"]:
if "reciprocal" in nd["connectivity_tag"]:
up, dn = neuron_db.connections_up_down(root_id)
reciprocal_count = len(set(up).intersection(dn))
insert_related_cell_links(
Expand Down
1 change: 1 addition & 0 deletions src/templates/download.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,6 @@
</div>

{% include "cell_annotations_modal.html" %}
{% include "connectivity_tags_modal.html" %}

{% endblock content %}
6 changes: 5 additions & 1 deletion src/utils/label_cleaning.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,11 @@ def remove_corrected(labels_latest_to_oldest):

# labels we want to exclude (non-informative wrt all other corrections)
def blacklisted(lbl):
blacklisted_labels = {"not a neuron", "not a neuron; glia", "correction - not optic lobe"}
blacklisted_labels = {
"not a neuron",
"not a neuron; glia",
"correction - not optic lobe",
}
return lbl.lower() in blacklisted_labels or can_be_flywire_root_id(lbl)


Expand Down
3 changes: 2 additions & 1 deletion tests/unit/test_neuron_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,8 @@ def test_no_garbage_labels(self):
"part of comprehensive neck connective tracing",
]:
self.assertFalse(
garbage.lower() in lbl.lower(), f"{lbl} contains {garbage}, all labels: {labels}"
garbage.lower() in lbl.lower(),
f"{lbl} contains {garbage}, all labels: {labels}",
)

def test_thumbnails(self):
Expand Down

0 comments on commit 27cf901

Please sign in to comment.