# shlokye16/psycalzpnd architecture

> Architecture diagram of the GitHub repository shlokye16/psycalzpnd, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shlokye16/psycalzpnd
- Repository: https://github.com/shlokye16/psycalzpnd

## Overview

This is an exploratory research pipeline comparing resting-state EEG and fMRI measures between APOE ε4 and PICALM genetic-risk groups, plus an OASIS-2 MCI companion analysis. The principal workflow processes PEARL-Neuro subjects, derives EEG and DMN-connectivity features, combines them with genotype labels, then evaluates EEG-only and multimodal classification and interpretability. The README documents the analysis capabilities, but the notebooks were not sampled; their internal calls and ordering are therefore not asserted.

Main entry points: [`extract/xtpneuro.py`](https://github.com/shlokye16/psycalzpnd/blob/main/extract/xtpneuro.py) (Labeled features), [`extract/xtoasis2.py`](https://github.com/shlokye16/psycalzpnd/blob/main/extract/xtoasis2.py) (MRI processing), [`notebook/model.ipynb`](https://github.com/shlokye16/psycalzpnd/blob/main/notebook/model.ipynb) (EEGNet evaluation), [`notebook/fusion.ipynb`](https://github.com/shlokye16/psycalzpnd/blob/main/notebook/fusion.ipynb) (EEG-fMRI fusion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pearl["PEARL data processing"]
  node_pearl_pipeline["Subject processing<br/>[xtpneuro.py]"]
  node_eeg_features["EEG features<br/>[xtpneuro.py]"]
  node_fmri_features["fMRI connectivity<br/>[xtpneuro.py]"]
  node_feature_matrix["Labeled features<br/>[xtpneuro.py]"]
end

subgraph group_analysis["Classification and interpretation"]
  node_eegnet["EEGNet evaluation<br/>[model.ipynb]"]
  node_linear_baseline["Linear baseline<br/>[model.ipynb]"]
  node_fusion["EEG-fMRI fusion<br/>[fusion.ipynb]"]
  node_interpretability["Feature interpretation<br/>[analysis.ipynb]"]
  node_preprocessing_analysis["EEG preprocessing analysis<br/>[preprocess.ipynb]"]
end

subgraph group_oasis["OASIS-2 companion"]
  node_oasis_pipeline["MRI processing<br/>[xtoasis2.py]"]
  node_oasis_features["MRI features<br/>[xtoasis2.py]"]
end

node_researcher(("Researcher"))
node_pearl_data[("PEARL-Neuro data")]
node_oasis_data[("OASIS-2 MRI data")]

node_researcher -->|"runs"| node_pearl_pipeline
node_pearl_data -->|"processes"| node_pearl_pipeline
node_pearl_pipeline -->|"derives"| node_eeg_features
node_pearl_pipeline -->|"derives"| node_fmri_features
node_pearl_pipeline -->|"assembles"| node_feature_matrix
node_eeg_features -->|"merges into"| node_feature_matrix
node_fmri_features -->|"merges into"| node_feature_matrix
node_feature_matrix -.->|"evaluated by"| node_eegnet
node_feature_matrix -.->|"evaluated by"| node_linear_baseline
node_feature_matrix -.->|"combined in"| node_fusion
node_feature_matrix -.->|"interpreted by"| node_interpretability
node_researcher -->|"runs"| node_oasis_pipeline
node_oasis_data -->|"processes"| node_oasis_pipeline
node_oasis_pipeline -->|"extracts"| node_oasis_features

click node_pearl_pipeline "https://github.com/shlokye16/psycalzpnd/blob/main/extract/xtpneuro.py"
click node_eeg_features "https://github.com/shlokye16/psycalzpnd/blob/main/extract/xtpneuro.py"
click node_fmri_features "https://github.com/shlokye16/psycalzpnd/blob/main/extract/xtpneuro.py"
click node_feature_matrix "https://github.com/shlokye16/psycalzpnd/blob/main/extract/xtpneuro.py"
click node_eegnet "https://github.com/shlokye16/psycalzpnd/blob/main/notebook/model.ipynb"
click node_linear_baseline "https://github.com/shlokye16/psycalzpnd/blob/main/notebook/model.ipynb"
click node_fusion "https://github.com/shlokye16/psycalzpnd/blob/main/notebook/fusion.ipynb"
click node_interpretability "https://github.com/shlokye16/psycalzpnd/blob/main/notebook/analysis.ipynb"
click node_preprocessing_analysis "https://github.com/shlokye16/psycalzpnd/blob/main/notebook/preprocess.ipynb"
click node_oasis_pipeline "https://github.com/shlokye16/psycalzpnd/blob/main/extract/xtoasis2.py"
click node_oasis_features "https://github.com/shlokye16/psycalzpnd/blob/main/extract/xtoasis2.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_pearl_pipeline,node_eeg_features,node_fmri_features,node_feature_matrix toneBlue
class node_eegnet,node_linear_baseline,node_fusion,node_interpretability,node_preprocessing_analysis,node_pearl_data,node_oasis_data toneAmber
class node_oasis_pipeline,node_oasis_features toneMint
class node_researcher toneIndigo
```

## Components

### PEARL data processing

- [Subject processing](https://github.com/shlokye16/psycalzpnd/blob/main/extract/xtpneuro.py): `extract/xtpneuro.py`
- [EEG features](https://github.com/shlokye16/psycalzpnd/blob/main/extract/xtpneuro.py): `extract/xtpneuro.py`
- [fMRI connectivity](https://github.com/shlokye16/psycalzpnd/blob/main/extract/xtpneuro.py): `extract/xtpneuro.py`
- [Labeled features](https://github.com/shlokye16/psycalzpnd/blob/main/extract/xtpneuro.py): `extract/xtpneuro.py`

### Classification and interpretation

- [EEGNet evaluation](https://github.com/shlokye16/psycalzpnd/blob/main/notebook/model.ipynb): `notebook/model.ipynb`
- [Linear baseline](https://github.com/shlokye16/psycalzpnd/blob/main/notebook/model.ipynb): `notebook/model.ipynb`
- [EEG-fMRI fusion](https://github.com/shlokye16/psycalzpnd/blob/main/notebook/fusion.ipynb): `notebook/fusion.ipynb`
- [Feature interpretation](https://github.com/shlokye16/psycalzpnd/blob/main/notebook/analysis.ipynb): `notebook/analysis.ipynb`
- [EEG preprocessing analysis](https://github.com/shlokye16/psycalzpnd/blob/main/notebook/preprocess.ipynb): `notebook/preprocess.ipynb`

### OASIS-2 companion

- [MRI processing](https://github.com/shlokye16/psycalzpnd/blob/main/extract/xtoasis2.py): `extract/xtoasis2.py`
- [MRI features](https://github.com/shlokye16/psycalzpnd/blob/main/extract/xtoasis2.py): `extract/xtoasis2.py`

### Other components

- **Researcher**
- **PEARL-Neuro data**
- **OASIS-2 MRI data**

## Connections

- Researcher → Subject processing: runs (evidence: `extract/xtpneuro.py`)
- PEARL-Neuro data → Subject processing: processes (evidence: `extract/xtpneuro.py`)
- Subject processing → EEG features: derives (evidence: `extract/xtpneuro.py`)
- Subject processing → fMRI connectivity: derives (evidence: `extract/xtpneuro.py`)
- Subject processing → Labeled features: assembles (evidence: `extract/xtpneuro.py`)
- EEG features → Labeled features: merges into (evidence: `extract/xtpneuro.py`)
- fMRI connectivity → Labeled features: merges into (evidence: `extract/xtpneuro.py`)
- Labeled features → EEGNet evaluation: evaluated by (evidence: `README.md`)
- Labeled features → Linear baseline: evaluated by (evidence: `README.md`)
- Labeled features → EEG-fMRI fusion: combined in (evidence: `README.md`)
- Labeled features → Feature interpretation: interpreted by (evidence: `README.md`)
- Researcher → MRI processing: runs (evidence: `extract/xtoasis2.py`)
- OASIS-2 MRI data → MRI processing: processes (evidence: `extract/xtoasis2.py`)
- MRI processing → MRI features: extracts (evidence: `extract/xtoasis2.py`)
