# rvaldes/iphomed architecture

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

- Interactive diagram: https://gitdiagram.com/rvaldes/iphomed
- Repository: https://github.com/rvaldes/iphomed

## Overview

IPHOMED combines shotgun metagenomics and mass-spectrometry proteomics to detect host, bacterial, and dietary proteins, then refines dietary calls and reports sample-level results. The README documents the required inputs, workflow invocation, configured reference databases, and outputs. Source excerpts show several analysis utilities, but the Snakefile and many scripts were not sampled, so internal workflow links beyond documented capabilities are omitted or marked unverified.

Main entry points: [`Snakefile`](https://github.com/rvaldes/iphomed/blob/main/Snakefile) (Snakemake workflow), [`scripts/proteomics3D.py`](https://github.com/rvaldes/iphomed/blob/main/scripts/proteomics3D.py) (Protein classification), [`config.yml`](https://github.com/rvaldes/iphomed/blob/main/config.yml) (Reference databases), [`scripts/diet_filter.py`](https://github.com/rvaldes/iphomed/blob/main/scripts/diet_filter.py) (Diet quality filtering)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Inputs and references"]
  node_sequencing["FASTQ reads"]
  node_spectra["mzML spectra"]
  node_references[("Reference databases<br/>[config.yml]")]
end

subgraph group_workflow["Analysis workflow"]
  node_workflow_run["Snakemake workflow"]
  node_shotgun["Shotgun analysis"]
  node_proteomics_search["Proteomics search"]
  node_partition["Protein classification<br/>[proteomics3D.py]"]
end

subgraph group_diet["Diet refinement"]
  node_diet_results["Diet proteins"]
  node_peptide_extract["Dietary peptide extraction"]
  node_diet_filter["Diet quality filtering<br/>[diet_filter.py]"]
  node_sample_combine["Sample-level diet combine"]
end

subgraph group_outputs["Reports and summaries"]
  node_host_results["Host proteins"]
  node_bacteria_results["Bacterial proteins"]
  node_filtered_results["Filtered diet proteins"]
  node_sample_results["Per-sample diet results"]
  node_protein_coverage["Protein callability"]
  node_genome_coverage["Genome callability<br/>[genome_coverage.py]"]
end

node_researcher(("Researcher"))

node_researcher -->|"provides reads"| node_sequencing
node_researcher -->|"provides spectra"| node_spectra
node_researcher -->|"configures references"| node_references
node_researcher -->|"runs workflow"| node_workflow_run
node_sequencing -->|"analyzes reads"| node_workflow_run
node_spectra -->|"analyzes spectra"| node_workflow_run
node_references -->|"configures analysis"| node_workflow_run
node_workflow_run -->|"includes"| node_shotgun
node_workflow_run -->|"includes"| node_proteomics_search
node_workflow_run -.->|"produces protein calls"| node_partition
node_partition -.->|"writes host calls"| node_host_results
node_partition -.->|"writes bacterial calls"| node_bacteria_results
node_partition -.->|"writes diet calls"| node_diet_results
node_diet_results -.->|"extracts peptides"| node_peptide_extract
node_diet_results -.->|"filters calls"| node_diet_filter
node_diet_filter -->|"writes filtered calls"| node_filtered_results
node_diet_results -.->|"combines samples"| node_sample_combine
node_sample_combine -->|"writes sample calls"| node_sample_results
node_protein_coverage -.->|"summarizes callability"| node_genome_coverage

click node_references "https://github.com/rvaldes/iphomed/blob/main/config.yml"
click node_workflow_run "https://github.com/rvaldes/iphomed/blob/main/Snakefile"
click node_shotgun "https://github.com/rvaldes/iphomed/blob/main/Snakefile"
click node_proteomics_search "https://github.com/rvaldes/iphomed/blob/main/Snakefile"
click node_partition "https://github.com/rvaldes/iphomed/blob/main/scripts/proteomics3D.py"
click node_peptide_extract "https://github.com/rvaldes/iphomed/blob/main/scripts/dietary_peptides.py"
click node_diet_filter "https://github.com/rvaldes/iphomed/blob/main/scripts/diet_filter.py"
click node_sample_combine "https://github.com/rvaldes/iphomed/blob/main/scripts/combine_dietaryProteins_bySample.py"
click node_protein_coverage "https://github.com/rvaldes/iphomed/blob/main/scripts/protein_coverage.py"
click node_genome_coverage "https://github.com/rvaldes/iphomed/blob/main/scripts/genome_coverage.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_sequencing,node_spectra,node_references toneBlue
class node_workflow_run,node_shotgun,node_proteomics_search,node_partition toneAmber
class node_diet_results,node_peptide_extract,node_diet_filter,node_sample_combine toneMint
class node_host_results,node_bacteria_results,node_filtered_results,node_sample_results,node_protein_coverage,node_genome_coverage toneRose
class node_researcher toneIndigo
```

## Components

### Inputs and references

- **FASTQ reads**
- **mzML spectra**
- [Reference databases](https://github.com/rvaldes/iphomed/blob/main/config.yml): `config.yml`

### Analysis workflow

- [Snakemake workflow](https://github.com/rvaldes/iphomed/blob/main/Snakefile): `Snakefile`
- [Shotgun analysis](https://github.com/rvaldes/iphomed/blob/main/Snakefile): `Snakefile`
- [Proteomics search](https://github.com/rvaldes/iphomed/blob/main/Snakefile): `Snakefile`
- [Protein classification](https://github.com/rvaldes/iphomed/blob/main/scripts/proteomics3D.py): `scripts/proteomics3D.py`

### Diet refinement

- **Diet proteins**
- [Dietary peptide extraction](https://github.com/rvaldes/iphomed/blob/main/scripts/dietary_peptides.py): `scripts/dietary_peptides.py`
- [Diet quality filtering](https://github.com/rvaldes/iphomed/blob/main/scripts/diet_filter.py): `scripts/diet_filter.py`
- [Sample-level diet combine](https://github.com/rvaldes/iphomed/blob/main/scripts/combine_dietaryProteins_bySample.py): `scripts/combine_dietaryProteins_bySample.py`

### Reports and summaries

- **Host proteins**
- **Bacterial proteins**
- **Filtered diet proteins**
- **Per-sample diet results**
- [Protein callability](https://github.com/rvaldes/iphomed/blob/main/scripts/protein_coverage.py): `scripts/protein_coverage.py`
- [Genome callability](https://github.com/rvaldes/iphomed/blob/main/scripts/genome_coverage.py): `scripts/genome_coverage.py`

### Other components

- **Researcher**

## Connections

- Researcher → FASTQ reads: provides reads (evidence: `README.md`)
- Researcher → mzML spectra: provides spectra (evidence: `README.md`)
- Researcher → Reference databases: configures references (evidence: `README.md`)
- Researcher → Snakemake workflow: runs workflow (evidence: `README.md`)
- FASTQ reads → Snakemake workflow: analyzes reads (evidence: `README.md`)
- mzML spectra → Snakemake workflow: analyzes spectra (evidence: `README.md`)
- Reference databases → Snakemake workflow: configures analysis (evidence: `README.md`)
- Snakemake workflow → Shotgun analysis: includes (evidence: `README.md`)
- Snakemake workflow → Proteomics search: includes (evidence: `README.md`)
- Snakemake workflow → Protein classification: produces protein calls
- Protein classification → Host proteins: writes host calls
- Protein classification → Bacterial proteins: writes bacterial calls
- Protein classification → Diet proteins: writes diet calls
- Diet proteins → Dietary peptide extraction: extracts peptides
- Diet proteins → Diet quality filtering: filters calls
- Diet quality filtering → Filtered diet proteins: writes filtered calls (evidence: `README.md`)
- Diet proteins → Sample-level diet combine: combines samples
- Sample-level diet combine → Per-sample diet results: writes sample calls (evidence: `README.md`)
- Protein callability → Genome callability: summarizes callability
