|
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | +# ProForma Notation - Basic Summary |
| 5 | + |
| 6 | +1 - Never make summary documentation unles specifically asked. |
| 7 | +2 - check makfile for commands |
| 8 | + |
| 9 | +## Documentation & Comments |
| 10 | + |
| 11 | +### Docstring Format |
| 12 | + |
| 13 | +Use **Google-style docstrings** but keep them minimal - type hints handle the rest. |
| 14 | + |
| 15 | +**Simple function:** |
| 16 | +```python |
| 17 | +def calculate_mass(sequence: str, charge: int = 1) -> float: |
| 18 | + """Calculate the mass-to-charge ratio of a peptide.""" |
| 19 | +``` |
| 20 | + |
| 21 | +**When you need more detail:** |
| 22 | +```python |
| 23 | +def find_isotopes(mz: float, tolerance: float = 0.01) -> list[Peak]: |
| 24 | + """Find isotopic peaks within the tolerance window. |
| 25 | + |
| 26 | + Uses a greedy algorithm to identify the most intense peaks first, |
| 27 | + then searches for their isotopic patterns. |
| 28 | + """ |
| 29 | +``` |
| 30 | + |
| 31 | +**Classes:** |
| 32 | +```python |
| 33 | +class Peptide: |
| 34 | + """Represents a peptide sequence with ProForma modifications.""" |
| 35 | +``` |
| 36 | + |
| 37 | +### What to Document |
| 38 | + |
| 39 | +- **One-line summary** for all public functions/classes |
| 40 | +- **Additional details** only when the implementation is non-obvious |
| 41 | +- **Don't repeat** what's already in type hints |
| 42 | +- **Private functions** (`_name`) can skip docstrings if obvious |
| 43 | + |
| 44 | +### Building Docs |
| 45 | +```bash |
| 46 | +cd docs |
| 47 | +make html |
| 48 | +# View at docs/_build/html/index.html |
| 49 | +``` |
| 50 | + |
| 51 | +see **proforma.schema.json** for the full ProForma 2.0 json object specification. |
| 52 | + |
| 53 | +## What is ProForma? |
| 54 | + |
| 55 | +ProForma is a **standardized text notation for representing peptides and proteins with modifications**. It's designed to be both human-readable and machine-parsable, allowing scientists to precisely describe modified peptide sequences in mass spectrometry data. |
| 56 | + |
| 57 | +## Core Concept |
| 58 | + |
| 59 | +Think of it as a way to write: **"amino acid sequence + where modifications are located + what those modifications are"** |
| 60 | + |
| 61 | +## Basic Examples |
| 62 | + |
| 63 | +### 1. Simple Unmodified Peptide |
| 64 | +``` |
| 65 | +PEPTIDE |
| 66 | +``` |
| 67 | +Just amino acids using standard one-letter codes (A, C, D, E, F, G, H, I, K, L, M, N, P, Q, R, S, T, V, W, Y) |
| 68 | + |
| 69 | +### 2. Peptide with Modification |
| 70 | +``` |
| 71 | +PEM[Oxidation]TIDE |
| 72 | +``` |
| 73 | +- Methionine (M) is oxidized |
| 74 | +- Modifications go in square brackets `[]` right after the modified amino acid |
| 75 | + |
| 76 | +### 3. Multiple Modifications |
| 77 | +``` |
| 78 | +PEM[Oxidation]TIS[Phospho]DE |
| 79 | +``` |
| 80 | +- M is oxidized |
| 81 | +- S is phosphorylated |
| 82 | + |
| 83 | +### 4. Terminal Modifications |
| 84 | +``` |
| 85 | +[Acetyl]-PEPTIDE |
| 86 | +[iTRAQ4plex]-PEPTIDE-[Amidated] |
| 87 | +``` |
| 88 | +- N-terminal modifications: `[mod]-` before sequence |
| 89 | +- C-terminal modifications: `-[mod]` after sequence |
| 90 | + |
| 91 | +## Ways to Specify Modifications |
| 92 | + |
| 93 | +ProForma supports multiple ways to describe the same modification: |
| 94 | + |
| 95 | +``` |
| 96 | +EM[Oxidation]TIDE # By name (Unimod) |
| 97 | +EM[UNIMOD:35]TIDE # By accession number |
| 98 | +EM[+15.995]TIDE # By mass change |
| 99 | +EM[Formula:O]TIDE # By chemical formula |
| 100 | +``` |
| 101 | + |
| 102 | +## Key Advanced Features |
| 103 | + |
| 104 | +### Ambiguous Modification Position |
| 105 | +When you know a modification exists but not exactly where: |
| 106 | +``` |
| 107 | +[Phospho]?PEPTIDE # Phospho is somewhere, location unknown |
| 108 | +``` |
| 109 | + |
| 110 | +### Multiple Possible Sites |
| 111 | +``` |
| 112 | +PEP[Phospho#g1]TIS[#g1]DE # Phospho is on either T or S |
| 113 | +``` |
| 114 | + |
| 115 | +### Labile Modifications |
| 116 | +Modifications that fall off during fragmentation: |
| 117 | +``` |
| 118 | +{Glycan:Hex}PEPTIDE # Glycan present but lost in MS2 |
| 119 | +``` |
| 120 | + |
| 121 | +### Cross-linked Peptides |
| 122 | +This is somewhat handled at the parsing level but will not will not be implmented in the codebased. Dont worry about this too much. |
| 123 | +``` |
| 124 | +PEPTK[#XL1]IDE//SEQK[#XL1] # Two peptides linked together |
| 125 | +``` |
| 126 | + |
| 127 | +### Chimeric Spectra |
| 128 | +Multiple peptides in same spectrum: |
| 129 | +This is somewhat handled at the parsing level but will not will not be implmented int eh codebased. Dont worry about this too much. |
| 130 | +``` |
| 131 | +PEPTIDE+SEQUENCE # Two co-eluting peptides |
| 132 | +``` |
| 133 | + |
| 134 | +### Charge States |
| 135 | +``` |
| 136 | +PEPTIDE/2 # Charge state +2 |
| 137 | +``` |
| 138 | + |
| 139 | +### Charge Adducts |
| 140 | +``` |
| 141 | +PEPTIDE/[Na+:z+1] # Sodium adduct with +1 charge |
| 142 | +PEPTIDE/[Na+:z+1^2] # added 2 times (total charge: +2) |
| 143 | +EPT[Formula:Zn:z+2]IDE/[Na:z+1^2] # total +4 |
| 144 | +
|
| 145 | +``` |
| 146 | + |
| 147 | +both charge and charge adduct cannot occur simultaneously. |
| 148 | + |
| 149 | +``` |
| 150 | +PEPTIDE/[Na+:z+1^2] # Sodium adduct with +1 charge 2 times |
| 151 | +``` |
| 152 | + |
| 153 | + |
| 154 | + |
| 155 | +## Compliance Levels |
| 156 | + |
| 157 | +ProForma has different levels of complexity: |
| 158 | + |
| 159 | +1. **Base-ProForma** - Simple sequences with basic modifications |
| 160 | +2. **Level 2-ProForma** - Adds ambiguity, formulas, delta masses |
| 161 | +3. **Extensions** - Specialized features for: |
| 162 | + - Top-down proteomics |
| 163 | + - Cross-linking |
| 164 | + - Glycoproteomics |
| 165 | + - Advanced complexity |
| 166 | + |
| 167 | +## Common Use Cases |
| 168 | + |
| 169 | +### Bottom-up Proteomics |
| 170 | +``` |
| 171 | +[Acetyl]-EM[Oxidation]EVTSES[Phospho]PEK |
| 172 | +``` |
| 173 | +Typical tryptic peptide with PTMs |
| 174 | + |
| 175 | +### Top-down Proteomics |
| 176 | +``` |
| 177 | +<[Oxidation]@M>FULLPROTEINSEQUENCE... |
| 178 | +``` |
| 179 | +Full protein with fixed modifications |
| 180 | + |
| 181 | +### Glycopeptide |
| 182 | +``` |
| 183 | +NEEYN[Glycan:Hex5HexNAc4]K |
| 184 | +``` |
| 185 | +N-glycosylation site |
| 186 | + |
| 187 | +### Cross-linking |
| 188 | +``` |
| 189 | +PEPTK[XLMOD:02001#XL1]IDE//SEQK[#XL1] |
| 190 | +``` |
| 191 | +DSS cross-link between two lysines |
| 192 | + |
| 193 | +## Why ProForma? |
| 194 | + |
| 195 | +**Before ProForma:** Everyone used different formats to describe modified peptides |
| 196 | +- Hard to share data |
| 197 | +- Hard to write software that works with different tools |
| 198 | +- Ambiguous representations |
| 199 | + |
| 200 | +**With ProForma:** Standard notation means: |
| 201 | +- Data can be easily exchanged between labs |
| 202 | +- Software tools can interoperate |
| 203 | +- Unambiguous communication of results |
| 204 | +- Integration with databases (Unimod, PSI-MOD, etc.) |
| 205 | + |
| 206 | +## Key Design Principles |
| 207 | + |
| 208 | +1. **Human readable** - Scientists can read and understand it |
| 209 | +2. **Machine parsable** - Software can reliably parse it |
| 210 | +3. **Extensible** - Can add new features as needs evolve |
| 211 | +4. **Precise** - Captures uncertainty and ambiguity when present |
| 212 | +5. **Standards-based** - Uses controlled vocabularies (Unimod, PSI-MOD, etc.) |
| 213 | + |
| 214 | + |
0 commit comments