code wiki / (root) / nx_peptide.nx

nx_peptide.nx

buildroot/runtime/nx_peptide.nx

20914 B565 linesdepth 3pulls 3 transitivereach 11 importersview sourcekind librarytopic peptide
docsdependenciesstructsconstsfunctions

about

nx_peptide.nx -- CHEMISTRY SUITE / PEPTIDE PRIMARY-STRUCTURE rung. Turns an amino-acid SEQUENCE into real chemistry: exact mass, charge state, isoelectric point, UV absorbance, hydropathy, and the b/y fragment-ion ladder an MS/MS run actually observes. This is the missing rung between the ecosystem's molecule stack (nx_chem_molecule / nx_chem_mass / nx_chem_isotope_pattern / nx_chem_peak_list) and peptide work: the mass stack could weigh a MolGraph but nothing could go from "DRVYIHPF" to 1045.5345 Da, so the NIST Peptide Tandem Mass Spectral Libraries (SRD 1c) in the corpus had no local counterpart to match against. This closes that. ALL INTEGER, no float: *_q4 = value x 10^4 (mass in Da -> micro-AMU; matches nx_chem_mass) *_q3 = value x 10^3 (charge, hydropathy, decade-log intermediates) *_milli = value x 10^3 (pH and pKa) THE exceed: a sequence viewer prints letters. This computes the mass an instrument will SEE (monoisotopic, not average -- they differ by ~0.66 Da at 1 kDa and that is the difference between a hit and a miss), the m/z of every charge state, and the b/y ladder for identification -- and it REFUSES a sequence containing a residue it does not know rather than silently scoring the unknown as zero mass. PRECISION, stated honestly (not asserted): - Residue masses are rounded to Q4, so an n-mer accumulates up to n/2 Q4 units of rounding. Measured against literature: angiotensin II (8-mer) is EXACT (1045.5345); bradykinin (9-mer) lands 1 Q4 unit (0.0001 Da) high. pep_mass_agrees() makes that tolerance explicit. - pI comes from bisection over pep_pow10_q3, whose decade table is 0.1-log granular, so pI is good to about +/-0.05 pH -- adequate to choose a buffer, NOT a substitute for a titration. Grounding (cited; researcher-groundable): iupac_amino_acid_residue_monoisotopic_masses (residue table) emboss_pepstats_pka_set (pKa set for pI/charge) kyte_doolittle_hydropathy_1982 (GRAVY) pace_1995_extinction_coefficient_280nm (Trp 5500 / Tyr 1490 / cystine 125) biemann_1990_peptide_fragment_ion_nomenclature (b/y ions)

dependencies 2 imports · 11 importers

nx_syscalls.nx nx_pow10.nx nx_peptide.nx nx_labsci_gate.nx nx_labsci_svc.nx nx_peptide_deconv.nx nx_peptide_denovo.nx nx_peptide_ext.nx nx_peptide_formula.nx nx_peptide_identify.nx nx_peptide_isotope.nx nx_peptide_msms.nx nx_qc_svc.nx

diagram shows first 10 each side; +0 more imports, +1 more importers in the complete lists below.

imports: nx_syscalls.nxnx_pow10.nx

imported by: nx_labsci_gate.nxnx_labsci_svc.nxnx_peptide_deconv.nxnx_peptide_denovo.nxnx_peptide_ext.nxnx_peptide_formula.nxnx_peptide_identify.nxnx_peptide_isotope.nxnx_peptide_msms.nxnx_qc_svc.nxnx_supplement_screen.nx

structs

none

consts

45const PEP_MAGIC_710371: i64 = 710371
46const PEP_MAGIC_1030092: i64 = 1030092
47const PEP_MAGIC_1150269: i64 = 1150269
48const PEP_MAGIC_1290426: i64 = 1290426
49const PEP_MAGIC_1470684: i64 = 1470684
50const PEP_MAGIC_570215: i64 = 570215
51const PEP_MAGIC_1370589: i64 = 1370589
52const PEP_MAGIC_1130841: i64 = 1130841
53const PEP_MAGIC_1280950: i64 = 1280950
54const PEP_MAGIC_1310405: i64 = 1310405
55const PEP_MAGIC_1140429: i64 = 1140429
56const PEP_MAGIC_970528: i64 = 970528
57const PEP_MAGIC_1280586: i64 = 1280586
58const PEP_MAGIC_1561011: i64 = 1561011
59const PEP_MAGIC_870320: i64 = 870320
60const PEP_MAGIC_1010477: i64 = 1010477
61const PEP_MAGIC_990684: i64 = 990684
62const PEP_MAGIC_1860793: i64 = 1860793
63const PEP_MAGIC_1630633: i64 = 1630633
64const PEP_MAGIC_710788: i64 = 710788
65const PEP_MAGIC_1031388: i64 = 1031388
66const PEP_MAGIC_1150886: i64 = 1150886
67const PEP_MAGIC_1291155: i64 = 1291155
68const PEP_MAGIC_1471766: i64 = 1471766
69const PEP_MAGIC_570519: i64 = 570519
70const PEP_MAGIC_1371411: i64 = 1371411
71const PEP_MAGIC_1131594: i64 = 1131594
72const PEP_MAGIC_1281741: i64 = 1281741
73const PEP_MAGIC_1311926: i64 = 1311926
74const PEP_MAGIC_1141038: i64 = 1141038
75const PEP_MAGIC_971167: i64 = 971167
76const PEP_MAGIC_1281307: i64 = 1281307
77const PEP_MAGIC_1561875: i64 = 1561875
78const PEP_MAGIC_870782: i64 = 870782
79const PEP_MAGIC_1011051: i64 = 1011051
80const PEP_MAGIC_991326: i64 = 991326
81const PEP_MAGIC_1862132: i64 = 1862132
82const PEP_MAGIC_1631760: i64 = 1631760
83const PEP_MAGIC_1800: i64 = 1800
84const PEP_MAGIC_2500: i64 = 2500
85const PEP_MAGIC_3500: i64 = 3500
86const PEP_MAGIC_2800: i64 = 2800
87const PEP_MAGIC_3200: i64 = 3200
88const PEP_MAGIC_4500: i64 = 4500
89const PEP_MAGIC_3900: i64 = 3900
90const PEP_MAGIC_3800: i64 = 3800
91const PEP_MAGIC_1900: i64 = 1900
92const PEP_MAGIC_1600: i64 = 1600
93const PEP_MAGIC_4200: i64 = 4200
94const PEP_MAGIC_1300: i64 = 1300
95const PEP_MAGIC_1000000: i64 = 1000000
99const PEP_A: i64 = 0
100const PEP_C: i64 = 1
101const PEP_D: i64 = 2
102const PEP_E: i64 = 3
103const PEP_F: i64 = 4
104const PEP_G: i64 = 5
105const PEP_H: i64 = 6
106const PEP_I: i64 = 7
107const PEP_K: i64 = 8
108const PEP_L: i64 = 9
109const PEP_M: i64 = 10
110const PEP_N: i64 = 11
111const PEP_P: i64 = 12
112const PEP_Q: i64 = 13
113const PEP_R: i64 = 14
114const PEP_S: i64 = 15
115const PEP_T: i64 = 16
116const PEP_V: i64 = 17
117const PEP_W: i64 = 18
118const PEP_Y: i64 = 19
119const PEP_N_AA: i64 = 20
121const PEP_INVALID: i64 = 0 - 1
127const PEP_WATER_MONO_Q4: i64 = 180106 // H2O monoisotopic 18.010565 Da
128const PEP_WATER_AVG_Q4: i64 = 180153 // H2O average 18.0153 Da
131const PEP_PROTON_Q4: i64 = 10073 // 1.00728 Da
135const PEP_EXT_TRP: i64 = 5500
136const PEP_EXT_TYR: i64 = 1490
137const PEP_EXT_CYSTINE: i64 = 125 // per DISULFIDE, not per free Cys
141const PEP_PKA_CTERM: i64 = 3600
142const PEP_PKA_NTERM: i64 = 8600
143const PEP_PKA_C: i64 = 8500
144const PEP_PKA_D: i64 = 3900
145const PEP_PKA_E: i64 = 4100
146const PEP_PKA_H: i64 = 6500
147const PEP_PKA_K: i64 = 10800
148const PEP_PKA_R: i64 = 12500
149const PEP_PKA_Y: i64 = 10100
153const PEP_PI_LO_MILLI: i64 = 0
154const PEP_PI_HI_MILLI: i64 = 14000
155const PEP_PI_ITERS: i64 = 20
159const PEP_POW10_CLAMP: i64 = 6000

functions

167func pep_residue_mono_q4(aa: i64) -> i64
193func pep_residue_avg_q4(aa: i64) -> i64
called by 1: pep_mass_avg_q4
218func pep_hydropathy_q3(aa: i64) -> i64
called by 1: pep_gravy_q3
249func pep_aa_from_char(c: i64) -> i64
273func pep_len(seq: *u8) -> i64
280func pep_seq_valid(seq: *u8) -> i64
294func pep_count_aa(seq: *u8, aa_want: i64) -> i64
313func pep_mass_mono_q4(seq: *u8) -> i64
328func pep_mass_avg_q4(seq: *u8) -> i64
345func pep_mass_agrees(computed_q4: i64, reference_q4: i64, tol_q4: i64) -> i64
359func pep_mz_q4(mass_q4: i64, n_charge: i64) -> i64
376func pep_b_ion_q4(seq: *u8, i_frag: i64) -> i64
393func pep_y_ion_q4(seq: *u8, i_frag: i64) -> i64
412func pep_by_complement_ok(seq: *u8, i_frag: i64) -> i64
433func pep_pow10_q3(d_milli: i64) -> i64
444func pep_frac_basic_q3(ph_milli: i64, pka_milli: i64) -> i64
called by 1: pep_charge_q3 calls 1: pep_pow10_q3
451func pep_frac_acidic_q3(ph_milli: i64, pka_milli: i64) -> i64
called by 1: pep_charge_q3 calls 1: pep_pow10_q3
463func pep_charge_q3(seq: *u8, ph_milli: i64) -> i64
497func pep_pi_milli(seq: *u8) -> i64
521func pep_ext_coeff_280(seq: *u8, n_cystine: i64) -> i64
532func pep_a280_quantifiable(seq: *u8, n_cystine: i64) -> i64
544func pep_gravy_q3(seq: *u8) -> i64
560func pep_is_hydrophobic(seq: *u8) -> i64
calls 1: pep_gravy_q3