How grandrea/alphafold-analysis works
Main Components
• Input Data: The user’s output files from AlphaFold runs – including .fasta files (protein sequences), possibly .cif and .pdb files (protein structures), and potentially job request JSON files (for AlphaFold3).
• Processing Modules:
• Plot Generation: Scripts like “plot_AF_all.py” generate plots (PAE, pLDDT, MSA coverage) from a single run.
• Summary Creation: The “plot_all.sh”, “make_summary.sh”, and “alphafold_summary.py” collectively process a directory of runs to create summary statistics and aggregated plots.
• Confidence-Based Splitting: “alphacrop.py” processes structure files (.pdb or .cif) to split them based on the confidence threshold (using the b-factor column).
• Visualization Component: “make_structure_figure.pml” (a PyMOL script) that creates detailed structure figures based on the processed data.
• External Dependencies: Technologies like Python (with numpy, seaborn, pandas, matplotlib, biopython), optional jax (for unpacking .pkl files), and PyMOL for visualization.
Relationships and Data Flows
• The Input Data (AlphaFold run results) is loaded by the processing scripts.
• “plot_AF_all.py” is used to create basic visualizations (by directly processing a given directory’s data).
• For batch processing of multiple runs:
• “plot_all.sh” is used to iterate over directories, generating all necessary plots.
• “make_summary.sh” then creates summary files.
• “alphafold_summary.py” further aggregates these summaries into a final comprehensive plot.
• When high-quality structural visualization is needed, the user runs “make_structure_figure.pml” via PyMOL to generate detailed structure figures.
• “alphacrop.py” plays a role independent of the visualization pipeline – it processes structural files to “crop” them based on different confidence thresholds, outputting three separate files according to the plDDT cutoffs.
Architectural Patterns and Technologies
• Modular Script Design: Each script addresses a specific element of the analysis pipeline, lending itself to a “pipe and filter” or modular command-line tool design.
• Command-Line Driven Workflow: The use of shell script wrappers (“plot_all.sh”, “make_summary.sh”) indicates a sequential processing pipeline.
• Integration with External Tools: The project integrates Python-based analysis with PyMOL (for visualization) and potentially jax for specific file-unpacking tasks.
• Directory Scanning: There is an implicit architectural decision to organize and process multiple runs based on a file/directory naming convention, ensuring that each “run” is a discrete unit of processing.
Instructing the Principal Software Engineer
• Document how users are expected to interact with the system – for example, by running individual scripts for single directory analysis or batch processing via shell scripts.