This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This projects as a reproducible workflow for generating peptide-to-kinase annotations for the KRSA and reKRSA kinome analysis systems. This project utilizes the PamChip annotation files for each PamChip article numbers and the Sequence-based kinome atlas developed by Johnson et al (2023) Yaron-Barir et al (2024) to identify likely upstream kinases based on the substrate sequences.
- STK Kinome Atlas Paper: An atlas of substrate specificities for the human serine/threonine kinome
- PTK Kinome Atlas Paper: The intrinsic substrate specificity of the human tyrosine kinome
- GraphQL API: https://kinase-library.phosphosite.org/kinase-library-api/graphql
The project has a simple R-based pipeline with the following structure:
├── raw/ # Raw layout files from KRSA (Layout.txt)
├── data/
│ ├── input_sequence_data.csv.bz2 # Prepared peptide sequences
│ └── individual/ # Downloaded kinase specificity data (per peptide/chip)
├── results/
│ ├── complete_kinase_specificity_map.csv.gz # Kinase map filtered to the top 20 targets by score for each peptide
│ ├── complete_kinase_specificity_map_raw.csv.gz # Raw kinase map including all results for each peptide on each chip
├── scripts/
│ └── utf8_converter.sh # Utility batch UTF-8 conversion script
└── R/
├── prepare_sequences.R # Extract the sequences from each layout file and format the to be queried from the API
├── download_specificity_data.R # Download data from GraphQL API
The annotation pipeline follows these steps:
- Layout Processing: Read Layout.txt files from
raw/directory - UTF-8 Conversion: Convert legacy files to UTF-8 using
scripts/utf8_converter.sh - Sequence Preparation: Run
prepare_sequences.Rto:- Add * markers to S, T, Y residues
- Generate phosphorylation variants
- Handle ambiguous amino acids (B/Z)
- Create phosphoprimer/phosphosite encodings
- Output:
data/input_sequence_data.csv.bz2
- Data Download: Run
download_specificity_data.Rto:- Query GraphQL API for each prepared sequence
- Download kinase specificity scores
- Output:
results/complete_kinase_specificity_map.csv.gz
# Step 1: UTF-8 conversion (if needed)
bash scripts/utf8_converter.sh
# Step 2: Prepare sequences
Rscript R/prepare_sequences.R
# Step 3: Download data from API
Rscript R/download_specificity_data.R
# Step 4: Generate metrics
Rscript R/create_specificity_metrics.R# Prepare sequences only
Rscript R/prepare_sequences.R
# Download data only (uses cached data when files already exist)
Rscript R/download_specificity_data.R
# Generate metrics
Rscript R/create_specificity_metrics.RTo run a specific analysis script:
Rscript [script_name].R- tidyverse (includes: dplyr, tidyr, purrr, tibble, readr, stringr)
- httr2 (for HTTP requests to GraphQL API)
- glue (for string interpolation)
- stringi (for string operations)
- UpSetR (for intersection visualization)
The project uses renv for package management. The .Rprofile automatically sources renv/activate.R.
.Rproj.user/,.Rhistory,.RData,.Ruserdata*.logx-*.R(downloaded data from API).vscode/
Note: Data files are excluded:
data/*.bz2andresults/*.gzare tracked (compression makes them reasonable to version)raw_backup/is excluded
The project uses renv for reproducible R environments. Run renv::init() or renv::restore() as needed.
PeptideID<TAB>Sequence<TAB>GeneName<TAB>...
ID- Composite identifier (Old_ID + phosphosite + priming + disambiguation)PeptideID- Original peptide identifiersource_sequence- Original peptide sequenceprepared_sequence- Modified sequence with phosphorylation markersphosphosite- Phosphorylation site location (e.g., "Y4")priming_status- Priming location encoding (e.g., "0b0", "0b1")disambiguation- Amino acid disambiguation code (e.g., "O0xO")ChipArticleID- KRSA article identifier
The GraphQL query returns kinase data including:
processedSequence- Processed sequencekinasesarray with: family, geneName, name, percentile, percentileRank, score, scoreRank, uniprotId, displayName
- STK: Serine/Threonine kinase chip (targets S/T residues)
- PTK: Protein Tyrosine kinase chip (targets Y residues)
Use the /browse skill (from gstack) for all web browsing tasks.
- Never use
mcp__claude-in-chrome__*tools — always use/browseinstead.
Use these skills for planning, design, testing, and development tasks:
- /office-hours — Brainstorming, idea exploration, startup thinking
- /plan-ceo-review — CEO/founder-mode strategic review, scope expansion
- /plan-eng-review — Engineering review, architecture, data flow, edge cases
- /plan-design-review — Design critique, visual audits, layout review
- /design-consultation — Design system creation, brand guidelines
- /review — Pre-landing PR review, code review
- /ship — Ship workflow: merge, CI, deploy, verify
- /browse — Headless browser for QA testing and site dogfooding
- /qa — Systematic QA testing, test and fix bugs
- /qa-only — QA report mode: test without fixing
- /design-review — Visual QA, design polish, fix visual issues
- /setup-browser-cookies — Import cookies for authenticated testing
- /retro — Engineering retrospective, commit history analysis
- /investigate — Systematic debugging with root cause analysis
- /document-release — Update documentation post-ship
- /codex — Code review, challenge mode, second opinion
- /careful — Safety mode: destructive command warnings
- /freeze — Restrict edits to specific directory
- /guard — Full safety: warnings + directory-scoped edits
- /unfreeze — Clear edit restrictions
- /gstack-upgrade — Upgrade gstack to latest version
# To view a website:
/browse
# To test a feature on a live site:
/browse
# For authentication before testing:
/setup-browser-cookies