Analysis repository for "Comparative transcriptomic analysis reveals signatures of selection for orb-weaving behavior in spiders," Runnels et al. 2026
| Directory / Filename | Description |
|---|---|
data/ |
Raw and intermediate data files used in the pipeline, e.g. OrthoFinder outputs, BUSCO scores, lists of species belonging to different categories, lists of HOGs tested in the HyPhy analyses, permulation-generated phenotype designations, and resources used to annotate results. |
figures/ |
PDF files of all figures and figure elements output by the figure-generating notebooks in scripts/07_figures_tables. |
results/ |
Results from the analyses including all Supplementary Tables (source code), lists of U. diversus or P. tepidariorum gene IDs for significant HOGs and complete GO enrichment of these genes (Fig. 3-5, source code), and all outputs from the Log Odds Ratio test (Fig. 5, source code) and phyloGLM. |
scripts/ |
Full analysis pipeline divided into stages following the paper's methods section. See below for a complete description of the steps required for each stage of the analysis. |
src/ |
Contains helper modules used in various stages of the analysis. |
.Rprofile |
Project-level R startup settings. |
.gitignore |
Version control exclusion rules. |
CHANGELOG.md |
Repository reorganization details. Reorganization support was performed with GitHub Copilot (GPT-5.3-Codex). |
README.md |
Top-level project overview, pipeline stage documentation, and usage notes. |
environment.yml |
Python dependencies. |
hyphy_environment.yml |
Conda environment used to run the HyPhy selection tests (see scripts/03_selection_tests) on high performance computing cluster. |
pyproject.toml |
Python packaging and project metadata configuration (build system, dependencies, package discovery). |
renv.lock |
R dependencies. |
upset_env.yml |
Conda environment for running the Upset Plots notebook. |
Some required inputs and outputs are not available in this repository.
- Raw and processed transcriptome FASTA inputs for OrthoFinder and the HyPhy pipeline are external.
- HyPhy per-gene JSON outputs are external.
- Some cache pickle files for HyPhy and Log Odds Ratio test results used by downstream scripts are external.
The scripts in scripts/01_pre_processing prepare the raw sequence set used in the orthology search.
- Download transcriptomes (Supplementary Table 1) from NCBI GenBank.
- Cluster with CD-HIT:
process_fsas_cd-hit.sh - Identify open reading frames with TransDecoder.LongOrfs:
process_fsas.TD-LO.sh - Identify homology with BLAST-P:
process_fsas.blastp.sh - Predict coding sequences with TransDecoder.Predict:
process_fsas.TD-P.sh - Analyze transcriptome quality using BUSCO:
process_fsas.busco.sh
The scripts in scripts/02_orthofinder_prep_hyphy process OrthoFinder results and corresponding sequences to prepare them for selection testing. OrthoFinder was re-run several times due to errors related to the number of files and the need to use an edited species tree; a record of the options used each time is in the stage 2 README.md.
- Run OrthoFinder (see stage 2 README.md)
- Filter orthogroups to N5 HOGs with occupancy ≥ 75 and get nucleotide sequences:
get_nuc_seqs.sh - Preparation for HyPhy testing:
prep_for_hyphy.sh. Includes:- Pre-alignment quality filtering with PREQUAL
- Alignment with MACSE
- Gene tree generation with IQ-TREE
- Error-filtering alignments and trees with BUSTED + hyphy error-filter
- Foreground branch labeling:
label_trees.sh
Data note: Stage 02 uses processed FASTA files not tracked in GitHub due to size.
The scripts/modules in scripts/03_selection_tests run the HyPhy analyses on the 4,576 N5 orthogroups and parse the results.
- Run RELAX:
relax.sh - Run BUSTED-PH with orb-weavers as foreground:
busted_ph.sh - Run BUSTED-PH with non-orb-weavers as foreground:
busted_ph_switch_fg.sh - Parse the results:
parse_hyphy_results.py
Data note: Stage 03 uses thousands of JSON result files not tracked in GitHub due to size.
The scripts and notebooks in scripts/04_permulation_loss_dup run the odds-ratio permulation workflow and evaluate distribution shape assumptions for test statistics.
- Generate and export permulation tip assignments:
permulations.R - Run loss/duplication odds-ratio test module
odds_ratio_test.pyusing the workflow in theOdds Ratio Permulation Test.ipynbnotebook
Data note: Stage 04 uses some cached pickle inputs/outputs that are external to this repository due to size.
The script and notebook in scripts/05_phyloglm fit a phylogenetic generalized linear model to each gene and evaluate the results.
- Run phyloglm analysis in parallel on ~12000 genes:
phyloglm.R - Inspect significant results:
PhyloGLM Analysis.ipynb
The scripts in scripts/06_enrichment create significant gene ID lists from HyPhy and odds_ratio_test.py results and run GO enrichment summaries.
- Make BLAST db from the P. tepidariorum genome
- Run
annotate_ogroups_vs_ref.pyto determine best BLAST hit for each orthogroup from the P. tepidariorum for enrichment of significant gene sets for orthogroups more commonly found in non-orb-weavers - Helper functions to generate significant ID list files for downstream enrichment:
get_gene_id_lists.py - Run topGO enrichment for each gene set:
go_enrichment.R - Summarize enrichment outputs into merged tables:
summarise_topgo_output.sh
Data note: Stage 06 depends on cached HyPhy and odds ratio test result objects for hit-list generation.
The scripts and notebooks in scripts/07_figures_tables generate manuscript figures, significant results intersections, and supplementary data tables.
- Plot HyPhy omega distributions and selected gene examples:
Hyphy Omega Plots.ipynb - Plot odds ratio test results:
Odds Ratio Test Plots.ipynb - Generate UpSet plots and intersections of significant results:
UpSet Plots.ipynb - Compile supplementary result tables for export:
Supplementary Data Tables.ipynb
Data note: Stage 07 expects completed outputs from stages 03-05 and writes figure/table artifacts to figures/ and results/.