# mbkemec/signal_peptide_prediction_model architecture

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

- Interactive diagram: https://gitdiagram.com/mbkemec/signal_peptide_prediction_model
- Repository: https://github.com/mbkemec/signal_peptide_prediction_model

## Overview

This repository is a research pipeline for predicting protein signal peptides, with two prediction approaches: a feature-based SVM and a von Heijne-style PSWM. The documented workflow collects and curates protein sequences, analyzes the resulting datasets, trains and evaluates predictors, and interprets benchmark errors. The graph preserves those stages and the major visualization and optimization branches. Some subsystems are represented from README descriptions because their implementation was not sampled; those relationships cite the README rather than implying source inspection.

Main entry points: [`data_collection/merge_data.py`](https://github.com/mbkemec/signal_peptide_prediction_model/blob/main/data_collection/merge_data.py) (Combined dataset), [`data_collection/filter_reps.py`](https://github.com/mbkemec/signal_peptide_prediction_model/blob/main/data_collection/filter_reps.py) (Representative filtering), [`SVM_optimization/final_model_test_benchmark.py`](https://github.com/mbkemec/signal_peptide_prediction_model/blob/main/SVM_optimization/final_model_test_benchmark.py) (Benchmark evaluation), [`von_heine_method/model_creation.py`](https://github.com/mbkemec/signal_peptide_prediction_model/blob/main/von_heine_method/model_creation.py) (PSWM training and CV)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Data curation"]
  node_positive_retrieval["Positive retrieval"]
  node_negative_retrieval["Negative retrieval"]
  node_representative_filter["Representative filtering<br/>[filter_reps.py]"]
  node_sequence_files[("Sequence FASTA files<br/>[fasta_sep.py]")]
  node_dataset_split["Shuffle and split<br/>[shuffle_NR.py]"]
  node_fold_datasets["Fold datasets"]
  node_dataset_merge["Dataset assembly<br/>[merge_data.py]"]
  node_combined_dataset[("Combined dataset<br/>[merge_data.py]")]
end

subgraph group_analysis["Dataset analysis"]
  node_dataset_shuffle["Analysis dataset shuffle<br/>[file_shuffle.py]"]
  node_exploratory_analysis["Biological visualizations"]
end

subgraph group_svm["SVM prediction"]
  node_feature_extraction["Sequence features"]
  node_feature_data[("Feature matrices")]
  node_svm_selection["SVM selection"]
  node_svm_model["Final SVM model"]
end

subgraph group_pswm["PSWM prediction"]
  node_pswm_model["PSWM training and CV<br/>[model_creation.py]"]
end

subgraph group_interpretation["Evaluation and interpretation"]
  node_benchmark_evaluation["Benchmark evaluation"]
  node_error_analysis["Benchmark error motifs"]
  node_motif_visualization["Motif logos<br/>[motif_logo.py]"]
end

node_researcher(("Researcher"))
node_uniprot[("UniProt")]

node_researcher -->|"initiates collection"| node_positive_retrieval
node_researcher -->|"initiates collection"| node_negative_retrieval
node_positive_retrieval -->|"queries"| node_uniprot
node_negative_retrieval -->|"queries"| node_uniprot
node_positive_retrieval -->|"curated by"| node_representative_filter
node_negative_retrieval -->|"curated by"| node_representative_filter
node_representative_filter -->|"separates sequences"| node_sequence_files
node_representative_filter -->|"feeds"| node_dataset_split
node_dataset_split -->|"splits training data"| node_fold_datasets
node_fold_datasets -->|"assembled by"| node_dataset_merge
node_dataset_merge -->|"writes"| node_combined_dataset
node_researcher -->|"starts analysis"| node_dataset_shuffle
node_dataset_shuffle -->|"shuffles dataset"| node_combined_dataset
node_combined_dataset -->|"analyzed for"| node_exploratory_analysis
node_combined_dataset -->|"provides labels"| node_feature_extraction
node_sequence_files -->|"provides sequences"| node_feature_extraction
node_feature_extraction -->|"writes features"| node_feature_data
node_feature_data -->|"loads matrices"| node_svm_selection
node_svm_selection -.->|"guides optimization"| node_svm_model
node_combined_dataset -->|"provides folds and labels"| node_pswm_model
node_sequence_files -->|"provides sequences"| node_pswm_model
node_researcher -->|"trains predictor"| node_svm_model
node_researcher -->|"trains and evaluates"| node_pswm_model
node_svm_model -->|"evaluated on benchmark"| node_benchmark_evaluation
node_pswm_model -->|"scores benchmark"| node_benchmark_evaluation
node_benchmark_evaluation -->|"provides false negatives"| node_error_analysis
node_benchmark_evaluation -->|"supports motif analysis"| node_motif_visualization
node_exploratory_analysis -->|"extracts cleavage motifs"| node_motif_visualization

click node_positive_retrieval "https://github.com/mbkemec/signal_peptide_prediction_model/blob/main/data_collection/data_collection_positive.py"
click node_negative_retrieval "https://github.com/mbkemec/signal_peptide_prediction_model/blob/main/data_collection/data_collection_negative.py"
click node_representative_filter "https://github.com/mbkemec/signal_peptide_prediction_model/blob/main/data_collection/filter_reps.py"
click node_sequence_files "https://github.com/mbkemec/signal_peptide_prediction_model/blob/main/data_collection/fasta_sep.py"
click node_dataset_split "https://github.com/mbkemec/signal_peptide_prediction_model/blob/main/data_collection/shuffle_NR.py"
click node_fold_datasets "https://github.com/mbkemec/signal_peptide_prediction_model/blob/main/data_collection/split_cross_validation.py"
click node_dataset_merge "https://github.com/mbkemec/signal_peptide_prediction_model/blob/main/data_collection/merge_data.py"
click node_combined_dataset "https://github.com/mbkemec/signal_peptide_prediction_model/blob/main/data_collection/merge_data.py"
click node_dataset_shuffle "https://github.com/mbkemec/signal_peptide_prediction_model/blob/main/data_visualization/file_shuffle.py"
click node_exploratory_analysis "https://github.com/mbkemec/signal_peptide_prediction_model/tree/main/data_visualization"
click node_feature_extraction "https://github.com/mbkemec/signal_peptide_prediction_model/blob/main/SVM_optimization/feature_extraction.py"
click node_feature_data "https://github.com/mbkemec/signal_peptide_prediction_model/blob/main/SVM_optimization/feature_extraction.py"
click node_svm_selection "https://github.com/mbkemec/signal_peptide_prediction_model/blob/main/SVM_optimization/svm_and_feature_selection.py"
click node_svm_model "https://github.com/mbkemec/signal_peptide_prediction_model/blob/main/SVM_optimization/final_model_creation.py"
click node_pswm_model "https://github.com/mbkemec/signal_peptide_prediction_model/blob/main/von_heine_method/model_creation.py"
click node_benchmark_evaluation "https://github.com/mbkemec/signal_peptide_prediction_model/blob/main/SVM_optimization/final_model_test_benchmark.py"
click node_error_analysis "https://github.com/mbkemec/signal_peptide_prediction_model/blob/main/von_heine_method/false_negative_motifs.py"
click node_motif_visualization "https://github.com/mbkemec/signal_peptide_prediction_model/blob/main/data_visualization/motif_logo.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_positive_retrieval,node_negative_retrieval,node_representative_filter,node_sequence_files,node_dataset_split,node_fold_datasets,node_dataset_merge,node_combined_dataset toneBlue
class node_dataset_shuffle,node_exploratory_analysis,node_uniprot toneAmber
class node_feature_extraction,node_feature_data,node_svm_selection,node_svm_model toneMint
class node_pswm_model toneRose
class node_benchmark_evaluation,node_error_analysis,node_motif_visualization,node_researcher toneIndigo
```

## Components

### Data curation

- [Positive retrieval](https://github.com/mbkemec/signal_peptide_prediction_model/blob/main/data_collection/data_collection_positive.py): `data_collection/data_collection_positive.py`
- [Negative retrieval](https://github.com/mbkemec/signal_peptide_prediction_model/blob/main/data_collection/data_collection_negative.py): `data_collection/data_collection_negative.py`
- [Representative filtering](https://github.com/mbkemec/signal_peptide_prediction_model/blob/main/data_collection/filter_reps.py): `data_collection/filter_reps.py`
- [Sequence FASTA files](https://github.com/mbkemec/signal_peptide_prediction_model/blob/main/data_collection/fasta_sep.py): `data_collection/fasta_sep.py`
- [Shuffle and split](https://github.com/mbkemec/signal_peptide_prediction_model/blob/main/data_collection/shuffle_NR.py): `data_collection/shuffle_NR.py`
- [Fold datasets](https://github.com/mbkemec/signal_peptide_prediction_model/blob/main/data_collection/split_cross_validation.py): `data_collection/split_cross_validation.py`
- [Dataset assembly](https://github.com/mbkemec/signal_peptide_prediction_model/blob/main/data_collection/merge_data.py): `data_collection/merge_data.py`
- [Combined dataset](https://github.com/mbkemec/signal_peptide_prediction_model/blob/main/data_collection/merge_data.py): `data_collection/merge_data.py`

### Dataset analysis

- [Analysis dataset shuffle](https://github.com/mbkemec/signal_peptide_prediction_model/blob/main/data_visualization/file_shuffle.py): `data_visualization/file_shuffle.py`
- [Biological visualizations](https://github.com/mbkemec/signal_peptide_prediction_model/tree/main/data_visualization): `data_visualization`

### SVM prediction

- [Sequence features](https://github.com/mbkemec/signal_peptide_prediction_model/blob/main/SVM_optimization/feature_extraction.py): `SVM_optimization/feature_extraction.py`
- [Feature matrices](https://github.com/mbkemec/signal_peptide_prediction_model/blob/main/SVM_optimization/feature_extraction.py): `SVM_optimization/feature_extraction.py`
- [SVM selection](https://github.com/mbkemec/signal_peptide_prediction_model/blob/main/SVM_optimization/svm_and_feature_selection.py): `SVM_optimization/svm_and_feature_selection.py`
- [Final SVM model](https://github.com/mbkemec/signal_peptide_prediction_model/blob/main/SVM_optimization/final_model_creation.py): `SVM_optimization/final_model_creation.py`

### PSWM prediction

- [PSWM training and CV](https://github.com/mbkemec/signal_peptide_prediction_model/blob/main/von_heine_method/model_creation.py): `von_heine_method/model_creation.py`

### Evaluation and interpretation

- [Benchmark evaluation](https://github.com/mbkemec/signal_peptide_prediction_model/blob/main/SVM_optimization/final_model_test_benchmark.py): `SVM_optimization/final_model_test_benchmark.py`
- [Benchmark error motifs](https://github.com/mbkemec/signal_peptide_prediction_model/blob/main/von_heine_method/false_negative_motifs.py): `von_heine_method/false_negative_motifs.py`
- [Motif logos](https://github.com/mbkemec/signal_peptide_prediction_model/blob/main/data_visualization/motif_logo.py): `data_visualization/motif_logo.py`

### Other components

- **Researcher**
- **UniProt**

## Connections

- Researcher → Positive retrieval: initiates collection (evidence: `README.md`)
- Researcher → Negative retrieval: initiates collection (evidence: `README.md`)
- Positive retrieval → UniProt: queries (evidence: `data_collection/data_collection_positive.py`)
- Negative retrieval → UniProt: queries (evidence: `data_collection/data_collection_negative.py`)
- Positive retrieval → Representative filtering: curated by (evidence: `README.md`)
- Negative retrieval → Representative filtering: curated by (evidence: `README.md`)
- Representative filtering → Sequence FASTA files: separates sequences (evidence: `README.md`)
- Representative filtering → Shuffle and split: feeds (evidence: `README.md`)
- Shuffle and split → Fold datasets: splits training data (evidence: `README.md`)
- Fold datasets → Dataset assembly: assembled by (evidence: `README.md`)
- Dataset assembly → Combined dataset: writes (evidence: `data_collection/merge_data.py`)
- Researcher → Analysis dataset shuffle: starts analysis (evidence: `README.md`)
- Analysis dataset shuffle → Combined dataset: shuffles dataset (evidence: `README.md`)
- Combined dataset → Biological visualizations: analyzed for (evidence: `README.md`)
- Combined dataset → Sequence features: provides labels (evidence: `SVM_optimization/feature_extraction.py`)
- Sequence FASTA files → Sequence features: provides sequences (evidence: `SVM_optimization/feature_extraction.py`)
- Sequence features → Feature matrices: writes features (evidence: `SVM_optimization/feature_extraction.py`)
- Feature matrices → SVM selection: loads matrices (evidence: `SVM_optimization/svm_and_feature_selection.py`)
- SVM selection → Final SVM model: guides optimization
- Combined dataset → PSWM training and CV: provides folds and labels (evidence: `von_heine_method/model_creation.py`)
- Sequence FASTA files → PSWM training and CV: provides sequences (evidence: `von_heine_method/model_creation.py`)
- Researcher → Final SVM model: trains predictor (evidence: `README.md`)
- Researcher → PSWM training and CV: trains and evaluates (evidence: `README.md`)
- Final SVM model → Benchmark evaluation: evaluated on benchmark (evidence: `README.md`)
- PSWM training and CV → Benchmark evaluation: scores benchmark (evidence: `von_heine_method/model_creation.py`)
- Benchmark evaluation → Benchmark error motifs: provides false negatives (evidence: `von_heine_method/false_negative_motifs.py`)
- Benchmark evaluation → Motif logos: supports motif analysis (evidence: `README.md`)
- Biological visualizations → Motif logos: extracts cleavage motifs (evidence: `README.md`)
