Skip to content

Commit 11f7f2e

Browse files
000specificclaude
andcommitted
phylonames: full §38/§3/§29 compliance refactor + conventions §40/§41
Convention additions: - §38 refined: explicit "subproject-level only — never per-STEP, per-BLOCK, per-workflow-RUN"; user-defined upload_to_server structure allowed via manifest dest_name overrides - §2 refined: output_to_input internal structure mandatorily mirrors producer paths (STEP_<N>/, BLOCK_<name>/, unit/) for provenance - §40 NEW: bidirectional discoverability — producer AI_GUIDEs list their consumers ("downstream consumers" section) - §41 NEW: three subproject types (STEP / BLOCK / UNIT) — internal organization is subproject-natural; interface layer is standardized Phylonames refactor (§38 compliance): - DELETE legacy flat publisher RUN-update_upload_to_server.sh (subproject-level + STEP_1 duplicate) - DELETE per-STEP upload_to_server/ dirs (STEP_1 + STEP_2) — Eric's local data inside was untracked - DELETE STEP_1 duplicate RUN-clean_and_record_subproject.sh (per-STEP copy of the subproject-level script; one path-adjusted line different) - NEW subproject-level RUN-update_upload_to_server.sh: thin wrapper around the canonical shared helper at gigantic_project-COPYME/server/ai/update_upload_to_server.py (matches trees_gene_families pattern) - NEW upload_manifest.tsv at each workflow-COPYME-*/ level (STEP_1: publish taxonomy_summary html/md from 4-output; STEP_2: publish updated taxonomy_summary html/md from 2-output) Phylonames doc cleanup: - Rename 4 AI_GUIDE-X.md → AI_GUIDE.md (§3 compliance): AI_GUIDE-phylonames.md, STEP_1/AI_GUIDE-generate_and_evaluate.md, STEP_1/workflow-COPYME/ai/AI_GUIDE-phylonames_workflow.md, STEP_2/AI_GUIDE-apply_user_phylonames.md - NEW STEP_2/workflow-COPYME-apply_user_phylonames/ai/AI_GUIDE.md (was missing; pairs with the new workflow README) - Bulk-fix cross-references in all phylonames docs: AI_GUIDE-*.md → AI_GUIDE.md; ../../AI_GUIDE-project.md (deleted) → ../../AI_GUIDE.md - Rewrite both workflow READMEs (STEP_1 + STEP_2) to remove RUN-workflow.sbatch references; document unified driver per §29; add publishing-to-server section - Update subproject README.md: directory tree reflects current state (no per-STEP upload_to_server; manifests at workflow-COPYME-* level; drop user_research/ in favor of research_notebook/research_user/); "Sharing Data via GIGANTIC Server" section rewritten for new subproject-level publisher - Update subproject AI_GUIDE.md: same directory tree fix; drop RUN-workflow.sbatch from Key Files table; add Downstream Consumers section per §40 listing every subproject that consumes phylonames output_to_input/maps/ Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent c3616bb commit 11f7f2e

14 files changed

Lines changed: 566 additions & 1110 deletions

File tree

gigantic_project-COPYME/ai/ai_FYIs/gigantic_conventions.md

Lines changed: 110 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,11 @@ specific outputs with downstream subprojects:
3939
(lowercase `o`)
4040
- Entries inside `output_to_input/` are **symlinks** pointing into the canonical
4141
`OUTPUT_pipeline/` of the appropriate `workflow-RUN_N-*` directory
42-
- The directory structure inside `output_to_input/` (typically organized by BLOCK
43-
or STEP name) keeps sequential runs from overwriting each other and preserves
44-
clear provenance
42+
- The directory structure inside `output_to_input/` is organized by
43+
`STEP_<N>-<name>/` or `BLOCK_<name>/` subdirectories matching the
44+
producer's structure. This keeps sequential runs from overwriting each
45+
other and preserves clear provenance (consumer sees which step generated
46+
what)
4547

4648
Downstream subprojects always read from `<upstream_subproject>/output_to_input/`,
4749
never from inside an `OUTPUT_pipeline/` directly.
@@ -829,17 +831,43 @@ Full documentation lives in `server/README.md` (user-facing) and
829831
Each subproject exposes selected outputs to the project's data server
830832
through a fixed interface:
831833

832-
- **`<subproject>/upload_to_server/`** holds the published view of that
833-
subproject's data
834-
- Entries inside are **symlinks** pointing into the canonical
835-
`OUTPUT_pipeline/` of the appropriate `workflow-RUN_N-*` directory
836-
(per §35; the run-instance dirs hold the actual data)
837-
- A **`upload_manifest.tsv`** at `<workflow-RUN_*>/upload_manifest.tsv`
838-
controls which outputs publish (one manifest per canonical RUN dir;
839-
see §39)
840-
- Each subproject has its own **`RUN-update_upload_to_server.sh`** that
841-
invokes the shared helper `gigantic_project-COPYME/server/ai/update_upload_to_server.py`
842-
to create/refresh the symlinks in `upload_to_server/`
834+
- **`<subproject>/upload_to_server/`** is the single publish destination
835+
per subproject (subproject-level; **never per-STEP, per-BLOCK, or
836+
per-workflow-RUN** — consumers and the server look in exactly one
837+
place per subproject). The current state of any subproject with
838+
`<STEP>/upload_to_server/` dirs is a legacy deviation to be refactored.
839+
- Internal structure inside `upload_to_server/` is **user-facing**
840+
organized for collaborators to browse the project, not for GIGANTIC's
841+
internal bookkeeping. The shared helper's default is to mirror
842+
producer paths:
843+
```
844+
<subproject>/upload_to_server/
845+
└── STEP_<N>-<name>/ (or BLOCK_<name>/, or unit-name/)
846+
└── workflow-RUN_<K>-<name>/ (canonical RUN per §39)
847+
└── N-output/
848+
└── <file> (symlink to the actual output)
849+
```
850+
This default works well when the natural collaborator-facing framework
851+
IS the producer's structure. Per-manifest `dest_name` overrides can
852+
reshape paths into a user-defined framework when the natural framework
853+
for collaborators differs from the internal pipeline layout (e.g.,
854+
grouping by species set, by hypothesis, by deliverable type rather
855+
than by STEP).
856+
857+
Note distinction from `output_to_input/` (§2): `output_to_input/`
858+
structure **mirrors producer paths** mandatorily (preserves provenance
859+
for downstream subprojects); `upload_to_server/` structure is for
860+
human collaborators and **can deviate** from producer paths when a
861+
different organization serves the user better.
862+
- Each canonical `workflow-RUN_*/` carries its own
863+
**`upload_manifest.tsv`** controlling which of its outputs publish
864+
(one manifest per canonical RUN dir; see §39)
865+
- Each subproject has a **`RUN-update_upload_to_server.sh`** at
866+
subproject level that invokes the shared helper at
867+
`gigantic_project-COPYME/server/ai/update_upload_to_server.py`. The
868+
shared helper walks the subproject, finds every `upload_manifest.tsv`
869+
inside any `workflow-RUN_*/`, and assembles the nested
870+
`upload_to_server/` tree above.
843871
- The server reads `upload_to_server/` symlinks transparently — **there
844872
is no copy or sync step**. Follow-the-symlink at HTTP request time.
845873

@@ -896,6 +924,74 @@ workflow" section).
896924

897925
---
898926

927+
## 40. Bidirectional discoverability: producer AI_GUIDEs list their consumers
928+
929+
When a subproject, STEP, BLOCK, or workflow **consumes** data from
930+
another subproject's `output_to_input/`, update the **producer's**
931+
relevant AI_GUIDE to note the consumer. This bidirectional cross-
932+
reference makes the data-flow graph navigable from either end.
933+
934+
**Example**: trees_species' STEP that produces species-tree structures
935+
gets a note in its AI_GUIDE saying "downstream consumers: orthogroups_X_ocl
936+
reads these structures; annotations_X_ocl reads them via orthogroups_X_ocl's
937+
output_to_input/."
938+
939+
**Why**: an AI walking into a subproject and finding it produces data
940+
should be able to answer "who uses this?" without grep'ing the whole
941+
tree. The producer-side reference solves this directly. Without it, you
942+
need a separate dependency map (drifts) or a cross-tree search (slow,
943+
incomplete).
944+
945+
**How**: add a "Downstream consumers" section to the producer's relevant
946+
AI_GUIDE (the one closest to the output_to_input/ source) when a
947+
consumer relationship is established. Keep it short:
948+
949+
```markdown
950+
## Downstream consumers
951+
952+
The `output_to_input/<subdir>/` exposed here is read by:
953+
954+
- **<consumer subproject>**`<consumer subproject>/...` consumes
955+
`<which file(s) and what for>`. See `<consumer subproject>/AI_GUIDE.md`
956+
for the consumer side.
957+
```
958+
959+
Apply when surfacing a new producer-consumer pair during cleanup or
960+
during new development.
961+
962+
---
963+
964+
## 41. Subproject internal organization: three natural types (STEP, BLOCK, UNIT)
965+
966+
GIGANTIC subprojects come in three structural shapes, chosen to fit the
967+
scientific use case. Internal structure is **subproject-natural** — do
968+
not force a single shape on all subprojects. (Compare with the
969+
**interface layer**`upload_to_server/`, `output_to_input/`,
970+
`RUN-update_upload_to_server.sh` at subproject root — which IS
971+
standardized per §2, §38, etc., regardless of internal type.)
972+
973+
| Type | When to use | Internal layout | Examples |
974+
|------|-------------|-----------------|----------|
975+
| **STEP** | Sequential pipeline; STEP_<N+1> depends on STEP_<N> | `<subproject>/STEP_<N>-<descriptor>/workflow-COPYME-<name>/` | `phylonames` (STEP_1-generate_and_evaluate → STEP_2-apply_user_phylonames); `genomesDB` (STEP_1-sources → ... → STEP_4-create_final_species_set) |
976+
| **BLOCK** | Parallel/alternative tools, methods, or analyses producing comparable outputs | `<subproject>/BLOCK_<descriptor>/workflow-COPYME-<name>/` | `orthogroups` (BLOCK_orthohmm, BLOCK_orthofinder, BLOCK_broccoli — pick your tool); `annotations_hmms` (BLOCK_interproscan, BLOCK_deeploc, BLOCK_signalp — different annotations); `hotspots` (BLOCK_self_blast, BLOCK_identify_hotspots) |
977+
| **UNIT** | Per-unit instances of a templated workflow chain (each unit goes through the same STEP_1 → STEP_2 → ... pipeline) | `<subproject>/<unit_prefix>_COPYME/STEP_<N>/workflow-COPYME-<name>/` (template) and `<subproject>/<unit_prefix>-<name>/STEP_<N>/workflow-COPYME-<name>/` (per-unit instances) | `trees_gene_families` (gene_family_COPYME template + gene_family-<name> instances); `trees_gene_groups` (similar) |
978+
979+
**Mixed or hybrid types**: a subproject occasionally needs more than one
980+
type (e.g., a STEP-organized subproject where one STEP has BLOCK
981+
alternatives inside it). That's fine — apply the type that fits at each
982+
level. Don't invent custom types.
983+
984+
**Naming**:
985+
- `STEP_<N>-<descriptor>` — zero-padded number with descriptive suffix
986+
- `BLOCK_<descriptor>` — no number; BLOCKs are alternatives, not ordered
987+
- `<unit_prefix>_COPYME` for the unit template (e.g., `gene_family_COPYME`)
988+
- `<unit_prefix>-<unit_name>` for unit instances (e.g.,
989+
`gene_family-innexin_pannexin_channels`)
990+
- `workflow-COPYME-<descriptor>` for the workflow template inside any
991+
STEP/BLOCK/unit (§35)
992+
993+
---
994+
899995
<!-- Add new conventions below as they surface during per-directory review. -->
900996
<!-- User shorthand "gcon" = "please add this to gigantic_conventions.md". -->
901997

gigantic_project-COPYME/subprojects/phylonames/AI_GUIDE-phylonames.md renamed to gigantic_project-COPYME/subprojects/phylonames/AI_GUIDE.md

Lines changed: 79 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# AI Guide: phylonames Subproject
22

3-
**For AI Assistants**: Read `../../AI_GUIDE-project.md` first for GIGANTIC overview, directory structure, and general patterns. This guide covers phylonames-specific concepts and troubleshooting.
3+
**For AI Assistants**: Read `../../../AI_GUIDE.md` (project root) first for GIGANTIC overview, directory structure, and general patterns. This guide covers phylonames-specific concepts and troubleshooting.
44

55
**Location**: `gigantic_project-*/subprojects/phylonames/`
66

@@ -21,11 +21,11 @@
2121

2222
| User needs... | Go to... |
2323
|---------------|----------|
24-
| GIGANTIC overview, directory structure | `../../AI_GUIDE-project.md` |
24+
| GIGANTIC overview, directory structure | `../../../AI_GUIDE.md` (project root) |
2525
| Phylonames concepts, troubleshooting | This file |
26-
| STEP_1 overview (generate and evaluate) | `STEP_1-generate_and_evaluate/AI_GUIDE-generate_and_evaluate.md` |
27-
| STEP_1 workflow execution | `STEP_1-generate_and_evaluate/workflow-COPYME-generate_phylonames/ai/AI_GUIDE-phylonames_workflow.md` |
28-
| STEP_2 overview (apply user phylonames) | `STEP_2-apply_user_phylonames/AI_GUIDE-apply_user_phylonames.md` |
26+
| STEP_1 overview (generate and evaluate) | `STEP_1-generate_and_evaluate/AI_GUIDE.md` |
27+
| STEP_1 workflow execution | `STEP_1-generate_and_evaluate/workflow-COPYME-generate_phylonames/ai/AI_GUIDE.md` |
28+
| STEP_2 overview (apply user phylonames) | `STEP_2-apply_user_phylonames/AI_GUIDE.md` |
2929
| STEP_2 workflow execution | `STEP_2-apply_user_phylonames/workflow-COPYME-apply_user_phylonames/ai/` |
3030

3131
---
@@ -53,39 +53,44 @@
5353

5454
```
5555
phylonames/
56-
├── README.md # Human documentation
57-
├── AI_GUIDE-phylonames.md # THIS FILE
56+
├── README.md # User-facing documentation
57+
├── AI_GUIDE.md # THIS FILE
5858
59-
├── user_research/ # Personal workspace for this subproject
60-
├── upload_to_server/ # Server sharing
59+
├── RUN-clean_and_record_subproject.sh # Subproject-level cleanup + session recording
60+
├── RUN-update_upload_to_server.sh # Subproject-level publisher (thin wrapper around shared helper, §38)
6161
62-
├── output_to_input/ # Outputs for downstream subprojects
62+
├── upload_to_server/ # Single publish destination per §38
63+
│ # (auto-populated by RUN-update_upload_to_server.sh; no per-STEP upload_to_server)
64+
65+
├── output_to_input/ # Outputs for downstream subprojects (§2)
6366
│ ├── STEP_1-generate_and_evaluate/
6467
│ │ └── maps/
65-
│ │ └── [project]_map-genus_species_X_phylonames.tsv
68+
│ │ └── [project]_map-genus_species_X_phylonames.tsv (symlink)
6669
│ ├── STEP_2-apply_user_phylonames/
6770
│ │ └── maps/
68-
│ │ └── [project]_map-genus_species_X_phylonames.tsv
69-
│ └── maps/ # Convenience symlink to whichever STEP ran last
70-
│ └── [project]_map-genus_species_X_phylonames.tsv # SYMLINK
71+
│ │ └── [project]_map-genus_species_X_phylonames.tsv (symlink)
72+
│ └── maps/ # Convenience symlink to most recent STEP
73+
│ └── [project]_map-genus_species_X_phylonames.tsv (symlink)
74+
75+
├── research_notebook/ # Personal workspace + AI session captures (§1, §25)
76+
│ ├── research_user/ # User sandbox (ships empty)
77+
│ └── research_ai/sessions/ # Captured chat transcripts (§9)
7178
7279
├── STEP_1-generate_and_evaluate/
73-
│ ├── AI_GUIDE-generate_and_evaluate.md # STEP-level guide
74-
│ ├── RUN-clean_and_record_subproject.sh # Cleanup + AI session recording
75-
│ ├── RUN-update_upload_to_server.sh # Update server symlinks
76-
│ ├── upload_to_server/ # Taxonomy summaries for server
77-
│ │ └── taxonomy_summaries/
80+
│ ├── AI_GUIDE.md # STEP-level guide
7881
│ │
7982
│ └── workflow-COPYME-generate_phylonames/
80-
│ ├── RUN-workflow.sh # bash RUN-workflow.sh
81-
│ ├── RUN-workflow.sbatch # sbatch RUN-workflow.sbatch
82-
│ ├── START_HERE-user_config.yaml # User edits project name here
83-
│ ├── INPUT_user/ # Species list (copied from project INPUT_user at runtime)
84-
│ ├── OUTPUT_pipeline/ # Results
85-
│ └── ai/ # Nextflow pipeline and scripts
86-
│ ├── AI_GUIDE-phylonames_workflow.md
83+
│ ├── README.md # User-facing workflow quickstart
84+
│ ├── RUN-workflow.sh # Unified driver (§29: local or slurm via execution_mode)
85+
│ ├── START_HERE-user_config.yaml # Config: project name, execution_mode, slurm.*
86+
│ ├── upload_manifest.tsv # Server publish manifest (§38, §39)
87+
│ ├── INPUT_user/ # Species list (auto-copied from project default if absent)
88+
│ ├── OUTPUT_pipeline/ # Results (1-output through 5-output)
89+
│ └── ai/
90+
│ ├── AI_GUIDE.md
8791
│ ├── main.nf
8892
│ ├── nextflow.config
93+
│ ├── conda_environment.yml
8994
│ └── scripts/
9095
│ ├── 001_ai-bash-download_ncbi_taxonomy.sh
9196
│ ├── 002_ai-python-generate_phylonames.py
@@ -94,23 +99,30 @@ phylonames/
9499
│ └── 005_ai-python-write_run_log.py
95100
96101
└── STEP_2-apply_user_phylonames/
97-
├── AI_GUIDE-apply_user_phylonames.md # STEP-level guide
102+
├── AI_GUIDE.md # STEP-level guide
98103
99104
└── workflow-COPYME-apply_user_phylonames/
100-
├── RUN-workflow.sh # bash RUN-workflow.sh
101-
├── RUN-workflow.sbatch # sbatch RUN-workflow.sbatch
102-
├── START_HERE-user_config.yaml # User edits project name and user phylonames path
103-
├── INPUT_user/ # User phylonames TSV goes here
104-
├── OUTPUT_pipeline/ # Results
105-
└── ai/ # Nextflow pipeline and scripts
105+
├── README.md # User-facing workflow quickstart
106+
├── RUN-workflow.sh # Unified driver (§29)
107+
├── START_HERE-user_config.yaml # Config: project name, user_phylonames path, etc.
108+
├── upload_manifest.tsv # Server publish manifest
109+
├── INPUT_user/ # User phylonames TSV
110+
├── OUTPUT_pipeline/ # Results (1-output through 3-output)
111+
└── ai/
112+
├── AI_GUIDE.md
106113
├── main.nf
107114
├── nextflow.config
115+
├── conda_environment.yml
108116
└── scripts/
109117
├── 001_ai-python-apply_user_phylonames.py
110118
├── 002_ai-python-generate_taxonomy_summary.py
111119
└── 003_ai-python-write_run_log.py
112120
```
113121

122+
Per §38 and §41, phylonames is a STEP-organized subproject and has ONE
123+
subproject-level `upload_to_server/` (no per-STEP `upload_to_server/`
124+
those were deleted in the 2026-05-26 cleanup).
125+
114126
---
115127

116128
## Phylonames-Specific Concepts
@@ -273,24 +285,51 @@ workflow-*/ai/logs/
273285
|------|---------|-------------|
274286
| `../../INPUT_user/species_set/species_list.txt` | Project-wide default species list | **YES** |
275287
| `STEP_1-*/workflow-*/START_HERE-user_config.yaml` | STEP_1 project name and options | **YES** |
276-
| `STEP_1-*/workflow-*/RUN-workflow.sbatch` | STEP_1 SLURM account/qos | **YES** (SLURM) |
288+
| `STEP_1-*/workflow-*/START_HERE-user_config.yaml` | STEP_1 project name, execution_mode, slurm.account/qos | **YES** |
277289
| `STEP_1-*/workflow-*/INPUT_user/species_list.txt` | STEP_1 species list override (optional, auto-copied from project default) | **YES** (to override) |
278-
| `STEP_2-*/workflow-*/START_HERE-user_config.yaml` | STEP_2 project name, user phylonames path, unofficial marking | **YES** |
279-
| `STEP_2-*/workflow-*/RUN-workflow.sbatch` | STEP_2 SLURM account/qos | **YES** (SLURM) |
290+
| `STEP_2-*/workflow-*/START_HERE-user_config.yaml` | STEP_2 project name, user phylonames path, unofficial marking, execution_mode, slurm.account/qos | **YES** |
280291
| `STEP_2-*/workflow-*/INPUT_user/user_phylonames.tsv` | User-provided phyloname overrides | **YES** |
281292
| `output_to_input/maps/*.tsv` | Output for downstream subprojects (symlink to latest STEP) | No |
282293
| `output_to_input/STEP_1-*/maps/*.tsv` | STEP_1 mapping output | No |
283294
| `output_to_input/STEP_2-*/maps/*.tsv` | STEP_2 mapping output (with user overrides) | No |
284295

285296
---
286297

298+
## Downstream consumers (per §40)
299+
300+
The `output_to_input/maps/[project]_map-genus_species_X_phylonames.tsv`
301+
exposed here is consumed by virtually every downstream GIGANTIC
302+
subproject, because phylonames are the canonical species identifiers
303+
used throughout the framework:
304+
305+
- **genomesDB** — uses phylonames to name standardized proteome files
306+
and to label species across the database
307+
- **orthogroups** — labels orthogroup memberships by phyloname
308+
- **annotations_hmms** — keys per-species annotation files by phyloname
309+
- **trees_species** — labels species in candidate species trees by
310+
phyloname
311+
- **trees_gene_families**, **trees_gene_groups** — label gene-family /
312+
gene-group tree tips by phyloname
313+
- **orthogroups_X_ocl**, **annotations_X_ocl** — propagate phyloname
314+
labels through OCL analyses
315+
- **gene_sizes**, **homolog_counts**, **hotspots**, **secretome**,
316+
**one_direction_homologs**, and so on — all use phylonames
317+
318+
In practice every subproject that operates per-species reads from
319+
`phylonames/output_to_input/maps/` at some point. **phylonames must run
320+
first** in any GIGANTIC project (see top of this file).
321+
287322
## Next Steps After phylonames
288323

289324
Guide users to:
290-
1. **Review STEP_1 output** - Check the taxonomy summary for numbered clades or misclassifications
291-
2. **Run STEP_2 if needed** - If any species need corrected phylonames, create `user_phylonames.tsv` and run STEP_2
292-
3. **genomesDB** - Set up proteome database using phylonames for file naming
293-
4. **Keep the mapping** - All downstream subprojects reference `output_to_input/maps/`
325+
1. **Review STEP_1 output** — check the taxonomy summary for numbered
326+
clades or misclassifications
327+
2. **Run STEP_2 if needed** — if any species need corrected phylonames,
328+
create `user_phylonames.tsv` and run STEP_2
329+
3. **genomesDB next** — set up proteome database using phylonames for
330+
file naming (the canonical second subproject to run)
331+
4. **Keep the mapping intact** — all downstream subprojects reference
332+
`output_to_input/maps/`
294333

295334
---
296335

0 commit comments

Comments
 (0)