Skip to content

Commit

Permalink
Add nonpharyngeal neuron view; ensure correct ordering of male neuron…
Browse files Browse the repository at this point in the history
…s in matrix
  • Loading branch information
pgleeson committed Dec 16, 2024
1 parent f06401a commit 0647fa7
Show file tree
Hide file tree
Showing 9 changed files with 1,191 additions and 53 deletions.
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -685,3 +685,21 @@ __pycache__
/docs/assets/Brittin2021*
/docs/*_Brittin2021_data*.md
/clean.sh
/docs/assets/Test_Nonpharyngeal_Chemical_Exc.json
/docs/assets/Test_Nonpharyngeal_Chemical_Exc.png
/docs/assets/Test_Nonpharyngeal_Chemical_Exc_graph.json
/docs/assets/Test_Nonpharyngeal_Chemical_Exc_graph.png
/docs/assets/Test_Nonpharyngeal_Chemical_Exc_hiveplot.json
/docs/assets/Test_Nonpharyngeal_Chemical_Exc_hiveplot.png
/docs/assets/Test_Nonpharyngeal_Chemical_Inh.json
/docs/assets/Test_Nonpharyngeal_Chemical_Inh.png
/docs/assets/Test_Nonpharyngeal_Chemical_Inh_graph.json
/docs/assets/Test_Nonpharyngeal_Chemical_Inh_graph.png
/docs/assets/Test_Nonpharyngeal_Chemical_Inh_hiveplot.json
/docs/assets/Test_Nonpharyngeal_Chemical_Inh_hiveplot.png
/docs/assets/Test_Nonpharyngeal_Electrical.json
/docs/assets/Test_Nonpharyngeal_Electrical.png
/docs/assets/Test_Nonpharyngeal_Electrical_graph.json
/docs/assets/Test_Nonpharyngeal_Electrical_graph.png
/docs/assets/Test_Nonpharyngeal_Electrical_hiveplot.json
/docs/assets/Test_Nonpharyngeal_Electrical_hiveplot.png
42 changes: 25 additions & 17 deletions cect/Analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,25 @@


def test_bilaterals():
from cect.BrittinDataReader import get_instance
from cect.White_whole import get_instance

"""
from cect.White_whole import get_instance
from cect.WormNeuroAtlasMAReader import get_instance
from cect.WormNeuroAtlasFuncReader import get_instance
from cect.Cook2019HermReader import get_instance
from cect.Cook2019MaleReader import get_instance
from cect.Cook2019HermReader import get_instance
from cect.WitvlietDataReader1 import get_instance
from cect.WitvlietDataReader8 import get_instance
from cect.RipollSanchezDataReader import get_instance
from cect.TestDataReader import get_instance
from cect.SpreadsheetDataReader import get_instance
from cect.Cook2020DataReader import get_instance
from cect.BrittinDataReader import get_instance
from cect.WormNeuroAtlasMAReader import get_instance
from cect.WormNeuroAtlasFuncReader import get_instance
from cect.RipollSanchezDataReader import get_instance
from cect.ConnectomeView import PHARYNX_VIEW as view
from cect.ConnectomeView import NONPHARYNGEAL_NEURONS_VIEW as view"""
from cect.ConnectomeView import SOCIAL_VIEW as view
from cect.ConnectomeView import NEURONS_VIEW as view
from cect.ConnectomeView import RAW_VIEW as view"""
from cect.ConnectomeView import NONPHARYNGEAL_NEURONS_VIEW as view

print(
"NOTE: For the sake of this paper, we excluded the pharyngeal neurons from the connectome data for both genders due to their distinction from the somatic nervous system."
Expand All @@ -31,7 +34,7 @@ def test_bilaterals():
cds2 = cds.get_connectome_view(view)

synclass = "Chemical Inh"
synclass = "Chemical Exc"
synclass = "Chemical Exc" if "Raw" not in view.name else "Chemical"

# synclass = "Acetylcholine"
# synclass = "Chemical"
Expand Down Expand Up @@ -59,22 +62,27 @@ def array_info(conn_array):
array_info(new_conn_array)

for synclass in [
"Chemical",
"Chemical Exc",
"Chemical Inh",
"Electrical",
"Contact",
"Functional",
"Extrasynaptic",
]:
print(" Adding conns of type: %s" % synclass)
conns_cs = cds2.connections[synclass]

array_info(conns_cs)
for i in range(len(conns_cs)):
for j in range(len(conns_cs[i])):
if (
i != j
): # Kim et al 2024: Self-connections are treated as nonexistent (∀𝐴𝑖𝑖 = 0).
new_conn_array[i, j] = new_conn_array[i, j] or conns_cs[i, j] > 0
if synclass in cds2.connections:
conns_cs = cds2.connections[synclass]

array_info(conns_cs)
for i in range(len(conns_cs)):
for j in range(len(conns_cs[i])):
if (
i != j
): # Kim et al 2024: Self-connections are treated as nonexistent (∀𝐴𝑖𝑖 = 0).
new_conn_array[i, j] = (
new_conn_array[i, j] or conns_cs[i, j] > 0
)

amal = "CS+GJ"
print("Amalgamated array:")
Expand Down
31 changes: 19 additions & 12 deletions cect/Cells.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ def get_cell_notes(cell: str):
for cell in MALE_HEAD_SENSORY_NEURONS:
cell_notes[cell] = "male head sensory neuron"

MALE_SENSORY_NEURONS = [
MALE_NON_HEAD_SENSORY_NEURONS = [
"R1AL",
"R1AR",
"R1BL",
Expand Down Expand Up @@ -556,10 +556,10 @@ def get_cell_notes(cell: str):
"SPVR",
]

for cell in MALE_SENSORY_NEURONS:
for cell in MALE_NON_HEAD_SENSORY_NEURONS:
cell_notes[cell] = "male sensory neuron"

MALE_INTERNEURONS = [
MALE_NON_HEAD_INTERNEURONS = [
"PVV",
"PVX",
"PVY",
Expand Down Expand Up @@ -595,15 +595,15 @@ def get_cell_notes(cell: str):
]


for cell in MALE_INTERNEURONS:
for cell in MALE_NON_HEAD_INTERNEURONS:
cell_notes[cell] = "male interneuron"


MALE_SPECIFIC_NEURONS = (
MALE_HEAD_INTERNEURONS
+ MALE_NON_HEAD_INTERNEURONS
+ MALE_HEAD_SENSORY_NEURONS
+ MALE_INTERNEURONS
+ MALE_SENSORY_NEURONS
+ MALE_NON_HEAD_SENSORY_NEURONS
)

UNKNOWN_FUNCTION_NEURONS = ["CANL", "CANR"]
Expand Down Expand Up @@ -1524,7 +1524,9 @@ def get_primary_classification():
classification[cell] = cell_type
elif cell_type == "interneuron":
for cell in (
INTERNEURONS_COOK + MALE_HEAD_INTERNEURONS + MALE_INTERNEURONS
INTERNEURONS_COOK
+ MALE_HEAD_INTERNEURONS
+ MALE_NON_HEAD_INTERNEURONS
):
classification[cell] = cell_type
elif cell_type == "motor neuron":
Expand All @@ -1534,7 +1536,7 @@ def get_primary_classification():
for cell in (
SENSORY_NEURONS_COOK
+ MALE_HEAD_SENSORY_NEURONS
+ MALE_SENSORY_NEURONS
+ MALE_NON_HEAD_SENSORY_NEURONS
):
classification[cell] = cell_type
elif cell_type == "odd numbered pharyngeal muscle":
Expand Down Expand Up @@ -1955,10 +1957,15 @@ def get_standard_color(cell: str):
return WA_COLORS["Hermaphrodite"]["Muscle"]["odd numbered pharyngeal muscle"]
elif cell in EVEN_PHARYNGEAL_MUSCLE_NAMES:
return WA_COLORS["Hermaphrodite"]["Muscle"]["even numbered pharyngeal muscle"]
elif cell in INTERNEURONS_COOK + MALE_HEAD_INTERNEURONS + MALE_INTERNEURONS:
elif (
cell in INTERNEURONS_COOK + MALE_HEAD_INTERNEURONS + MALE_NON_HEAD_INTERNEURONS
):
return WA_COLORS["Hermaphrodite"]["Nervous Tissue"]["interneuron"]
elif (
cell in SENSORY_NEURONS_COOK + MALE_HEAD_SENSORY_NEURONS + MALE_SENSORY_NEURONS
cell
in SENSORY_NEURONS_COOK
+ MALE_HEAD_SENSORY_NEURONS
+ MALE_NON_HEAD_SENSORY_NEURONS
):
return WA_COLORS["Hermaphrodite"]["Nervous Tissue"]["sensory neuron"]
elif cell in MOTORNEURONS_COOK:
Expand Down Expand Up @@ -2430,7 +2437,7 @@ def _generate_cell_table(cell_type: str, cells: List[str]):
cell_type,
INTERNEURONS_COOK
+ MALE_HEAD_INTERNEURONS
+ MALE_INTERNEURONS,
+ MALE_NON_HEAD_INTERNEURONS,
)
)
elif cell_type == "motor neuron":
Expand All @@ -2441,7 +2448,7 @@ def _generate_cell_table(cell_type: str, cells: List[str]):
cell_type,
SENSORY_NEURONS_COOK
+ MALE_HEAD_SENSORY_NEURONS
+ MALE_SENSORY_NEURONS,
+ MALE_NON_HEAD_SENSORY_NEURONS,
)
)
elif cell_type == "odd numbered pharyngeal muscle":
Expand Down
3 changes: 1 addition & 2 deletions cect/Comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,7 @@ def generate_comparison_page(quick: bool, color_table=True, dataset_pages=True):
readers["Witvliet4"] = ["cect.WitvlietDataReader4", "Witvliet_2021"]
readers["Witvliet5"] = ["cect.WitvlietDataReader5", "Witvliet_2021"]
readers["Witvliet6"] = ["cect.WitvlietDataReader6", "Witvliet_2021"]

readers["Witvliet7"] = ["cect.WitvlietDataReader7", "Witvliet_2021"]
readers["Witvliet7"] = ["cect.WitvlietDataReader7", "Witvliet_2021"]

readers["Witvliet8"] = ["cect.WitvlietDataReader8", "Witvliet_2021"]

Expand Down
56 changes: 38 additions & 18 deletions cect/ConnectomeView.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
from cect.Cells import INTERNEURONS_NONPHARYNGEAL_COOK
from cect.Cells import UNKNOWN_FUNCTION_NEURONS
from cect.Cells import MALE_SPECIFIC_NEURONS
from cect.Cells import MALE_HEAD_INTERNEURONS
from cect.Cells import MALE_NON_HEAD_INTERNEURONS
from cect.Cells import MALE_HEAD_SENSORY_NEURONS
from cect.Cells import MALE_NON_HEAD_SENSORY_NEURONS
from cect.Cells import PREFERRED_MUSCLE_NAMES
from cect.Cells import ALL_NON_NEURON_MUSCLE_CELLS

Expand Down Expand Up @@ -156,24 +160,41 @@ def get_index_of_cell(self, cell):
NEURONS_VIEW = View(
"Neurons",
"Neurons",
"All 302 hermaphrodite neurons (whether present or not in the connectome dataset)",
"All 302 **hermaphrodite** neurons (whether present or not in the connectome dataset)",
[],
EXC_INH_GJ_FUNC_CONT_SYN_CLASSES,
)

NONPHARYNGEAL_NEURONS_VIEW = View(
NONPHARYNGEAL_NEURONS_HERM_VIEW = View(
"Nonpharyngeal",
"Nonpharyngeal Neurons",
"All neurons except those in the pharynx",
"All **hermaphrodite** neurons except those in the pharynx",
[],
EXC_INH_GJ_FUNC_CONT_SYN_CLASSES,
only_show_existing_nodes=False,
)

NONPHARYNGEAL_NEURONS_HM_VIEW = View(
"Nonpharyngeal",
"Nonpharyngeal Neurons",
"All neurons (herm. & male) except those in the pharynx",
[],
EXC_INH_GJ_FUNC_CONT_SYN_CLASSES,
only_show_existing_nodes=False,
)

for cell in (
sorted(PHARYNGEAL_NEURONS)
+ sorted(SENSORY_NEURONS_NONPHARYNGEAL_COOK)
+ sorted(INTERNEURONS_NONPHARYNGEAL_COOK)
+ sorted(
SENSORY_NEURONS_NONPHARYNGEAL_COOK
+ MALE_HEAD_SENSORY_NEURONS
+ MALE_NON_HEAD_SENSORY_NEURONS
)
+ sorted(
INTERNEURONS_NONPHARYNGEAL_COOK
+ MALE_HEAD_INTERNEURONS
+ MALE_NON_HEAD_INTERNEURONS
)
+ sorted(
HEAD_MOTORNEURONS_COOK
+ VENTRAL_CORD_MOTORNEURONS
Expand All @@ -183,23 +204,21 @@ def get_index_of_cell(self, cell):
)
+ sorted(UNKNOWN_FUNCTION_NEURONS)
):
NEURONS_VIEW.node_sets.append(NodeSet(cell, [cell], get_standard_color(cell)))
RAW_VIEW.node_sets.append(NodeSet(cell, [cell], get_standard_color(cell)))

if cell not in MALE_SPECIFIC_NEURONS:
NEURONS_VIEW.node_sets.append(NodeSet(cell, [cell], get_standard_color(cell)))

if cell not in PHARYNGEAL_NEURONS:
NONPHARYNGEAL_NEURONS_VIEW.node_sets.append(
if cell not in MALE_SPECIFIC_NEURONS:
NONPHARYNGEAL_NEURONS_HERM_VIEW.node_sets.append(
NodeSet(cell, [cell], get_standard_color(cell))
)
NONPHARYNGEAL_NEURONS_HM_VIEW.node_sets.append(
NodeSet(cell, [cell], get_standard_color(cell))
)

for cell in sorted(MALE_SPECIFIC_NEURONS):
NONPHARYNGEAL_NEURONS_VIEW.node_sets.append(
NodeSet(cell, [cell], get_standard_color(cell))
)

for cell in (
sorted(MALE_SPECIFIC_NEURONS)
+ sorted(PREFERRED_MUSCLE_NAMES)
+ sorted(ALL_NON_NEURON_MUSCLE_CELLS)
):
for cell in sorted(PREFERRED_MUSCLE_NAMES) + sorted(ALL_NON_NEURON_MUSCLE_CELLS):
RAW_VIEW.node_sets.append(NodeSet(cell, [cell], get_standard_color(cell)))

assert len(NEURONS_VIEW.node_sets) == 302
Expand Down Expand Up @@ -491,6 +510,7 @@ def get_index_of_cell(self, cell):
RAW_VIEW,
NEURONS_VIEW,
PHARYNX_VIEW,
NONPHARYNGEAL_NEURONS_HERM_VIEW,
SOCIAL_VIEW,
ESCAPE_VIEW,
COOK_FIG3_VIEW,
Expand Down Expand Up @@ -547,7 +567,7 @@ def get_index_of_cell(self, cell):
print(tdr_instance.get_connectome_view(ESCAPE_VIEW).summary())

print("------- Nonpharyngeal ---------")
print(tdr_instance.get_connectome_view(NONPHARYNGEAL_NEURONS_VIEW).summary())
print(tdr_instance.get_connectome_view(NONPHARYNGEAL_NEURONS_HM_VIEW).summary())

"""
from cect.Cells import ALL_PREFERRED_CELL_NAMES
Expand Down
8 changes: 4 additions & 4 deletions cect/data/all_cell_info.csv
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,6 @@ VD8,Ventral cord motor neuron,Ventral D-type Motor Neuron 8,P7.app,"Ventralcord
VD9,Ventral cord motor neuron,Ventral D-type Motor Neuron 9,P8.app,"Ventral cord motor neuron, innervates vent body muscles, reciprocal inhibitor"
MCML,Male head interneuron,Mystery Cell of the Male Left,AmsoL,Male specific interneuron
MCMR,Male head interneuron,Mystery Cell of the Male Right,AmsoR,Male specific interneuron
CEMDL,Male head sensory neuron,CEphalic Male Sensory Neuron Dorsal Left,AB plaaaaaap,"Male specific cephalic neurons (programmed cell death in hermaphrodite embryo) open to outside, possible function in male chemotaxis toward hermaphrodite"
CEMDR,Male head sensory neuron,CEphalic Male Sensory Neuron Dorsal Right,AB arpapaaap,"Male specific cephalic neurons (programmed cell death in hermaphrodite embryo) open to outside, possible function in male chemotaxis toward hermaphrodite"
CEMVL,Male head sensory neuron,CEphalic Male Sensory Neuron Ventral Left,AB plpaapapp,"Male specific cephalic neurons (programmed cell death in hermaphrodite embryo) open to outside, possible function in male chemotaxis toward hermaphrodite"
CEMVR,Male head sensory neuron,CEphalic Male Sensory Neuron Ventral Right,AB prpaapapp,"Male specific cephalic neurons (programmed cell death in hermaphrodite embryo) open to outside, possible function in male chemotaxis toward hermaphrodite"
PVV,Male interneuron,Posterior Ventral Process V,P11.paaa,"Male specific motor neuron, pre-anal ganglion"
PVX,Male interneuron,Posterior Ventral Process X,P12.aap,"Male specific interneuron, cell body in pre-anal ganglion, postsynaptic in ring and ventral cord"
PVY,Male interneuron,Posterior Ventral Process Y,P11.paap,"Male specific interneuron, cell body in pre-anal ganglion"
Expand Down Expand Up @@ -339,6 +335,10 @@ CP06,Male interneuron,"C-type Neuron, Posterior Daughter after Division 6",P8.aa
CP07,Male interneuron,"C-type Neuron, Posterior Daughter after Division 7",P9.aapp,Male specific motor neuron in ventral cord
CP08,Male interneuron,"C-type Neuron, Posterior Daughter after Division 8",P10.aapp,"Male specific interneuron, projects into preanal ganglion"
CP09,Male interneuron,"C-type Neuron, Posterior Daughter after Division 9",P11.aapp,"Male specific interneuron, projects into preanal ganglion"
CEMDL,Male head sensory neuron,CEphalic Male Sensory Neuron Dorsal Left,AB plaaaaaap,"Male specific cephalic neurons (programmed cell death in hermaphrodite embryo) open to outside, possible function in male chemotaxis toward hermaphrodite"
CEMDR,Male head sensory neuron,CEphalic Male Sensory Neuron Dorsal Right,AB arpapaaap,"Male specific cephalic neurons (programmed cell death in hermaphrodite embryo) open to outside, possible function in male chemotaxis toward hermaphrodite"
CEMVL,Male head sensory neuron,CEphalic Male Sensory Neuron Ventral Left,AB plpaapapp,"Male specific cephalic neurons (programmed cell death in hermaphrodite embryo) open to outside, possible function in male chemotaxis toward hermaphrodite"
CEMVR,Male head sensory neuron,CEphalic Male Sensory Neuron Ventral Right,AB prpaapapp,"Male specific cephalic neurons (programmed cell death in hermaphrodite embryo) open to outside, possible function in male chemotaxis toward hermaphrodite"
R1AL,Male sensory neuron,Ray 1 Neuron A Left,"V5L.pppppaaa, (R1.aaaL)","Male sensory rays, neuron, striated rootlet, cell body in left lumbar ganglion"
R1AR,Male sensory neuron,Ray 1 Neuron A Right,"V5R.pppppaaa, (R1.aaaR)","Male sensory rays, neuron, striated rootlet, cell body in right lumbar ganglion"
R1BL,Male sensory neuron,Ray 1 Neuron B Left,"V5L.pppppapa, (R1.apaL)","Male sensory rays, neuron, darkly staining tip, open to outside, cell body in left lumbar ganglion"
Expand Down
Loading

0 comments on commit 0647fa7

Please sign in to comment.