Skip to content

Person 2: Domain delta features, tests, and feature docs #4

Description

@amruthesht

Summary

Follow-up to the feature extraction PR (Person 2 / Phase 2). Complete remaining core feature-engineering work: domain delta features relative to reference structures, expanded tests, a feature-column manifest in docs, and minor code cleanup.

Does not depend on Person 1's curated annotations or OPM data.

Background

The workplan (Person 2, task 2) asks for domain distances/angles and changes relative to reference structures. Current confostate/features/domains.py computes absolute inter-helix distances and angles only — delta features are not yet implemented.

Reference PDBs are already defined in confostate/features/rmsd.py:

State Reference PDB
OF_open 3F3E
IF_open 3F3A
Occluded 3F4J
Intermediate 3USI

Tasks

1. Domain delta features

  • Add delta features in confostate/features/domains.py (or a small helper) for each LEUT_DOMAIN_PAIRS pair, e.g.:
    • domain_TM1_TM7_distance_delta_vs_3F3E
    • domain_TM1_TM7_angle_delta_vs_3F3E
  • Delta = value in query structure − value in reference structure
  • Use the same reference PDBs as rmsd.py (at minimum vs primary OF reference 3F3E; optionally vs all four state references)
  • Wire into extract_features() via pipeline.py if not automatic
  • Handle missing reference PDBs gracefully (skip or NaN, consistent with RMSD module)

2. Tests

  • Add tests in tests/test_features.py for delta features
  • Self-delta vs same PDB should be ≈ 0
  • Confirm dimers still work (e.g. 3USI — primary chain only, as in existing RMSD fix)

3. Feature column manifest

  • Add a table to docs/features.md listing every output column from extract_features()
  • Mark each as: computed from PDB vs copied from annotations CSV
  • Include new delta columns

4. Code cleanup

  • Remove unused code (e.g. sort_by_resid in _structure.py if still unused)
  • Document or wire family param in pipeline.py if keeping it for future multi-family support

Acceptance criteria

  • pytest tests/test_features.py -v passes
  • extract_features("input/3F3E.pdb") includes delta feature keys
  • docs/features.md documents all output columns
  • No dependency on Person 1's annotation/OPM deliverables

Out of scope

  • Hollow cavity detection (Tier 4 stretch)
  • RCSB metadata fetch / OPM integration (Person 1)
  • Renaming annotation status columns (PR approved as-is)

Files likely touched

  • confostate/features/domains.py
  • confostate/features/pipeline.py
  • tests/test_features.py
  • docs/features.md

Test plan

pip install -e ".[dev]"
python scripts/download_structures.py --codes 3F3E 3F3A 3F4J 3USI --output-dir input
pytest tests/test_features.py -v
python -c "from confostate.features import extract_features; print([k for k in extract_features('input/3F3A.pdb', reference_dir='input') if 'delta' in k])"

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions