code wiki / (root) / nx_peptide_chain.nx

nx_peptide_chain.nx

buildroot/runtime/nx_peptide_chain.nx

5660 B147 linesdepth 5pulls 5 transitivereach 1 importersview sourcekind librarytopic peptide
docsdependenciesstructsconstsfunctions

about

nx_peptide_chain.nx -- CHEMISTRY SUITE / MULTI-CHAIN PEPTIDE rung. Closes the last gap the peptide lane declared: an assembly of SEVERAL chains held together by disulfide bridges. Insulin is the case that matters -- two chains, three bridges, and one of the most counterfeited biologics there is -- and nothing before this could weigh it. WHY IT IS NOT JUST "ADD THE CHAINS UP". Two things break that: 1. Every chain carries its OWN terminal water, so an N-chain assembly has N waters, not one. Treating insulin as a single 51-residue sequence is short by a whole water (18.011 Da). 2. Bridges are owned by the ASSEMBLY, not by any chain. An inter-chain disulfide belongs to neither A nor B. So pca_add_chain REFUSES a builder that already carries its own bridges -- otherwise the same -2.016 Da gets subtracted twice and the answer looks plausible. INTRA AND INTER ARE TRACKED SEPARATELY, because they mean different things. Both cost the same mass, but only INTER-chain bridges hold the assembly together: linking N chains needs at least N-1 of them. pca_is_covalently_linked enforces exactly that, so a "two-chain" molecule with only intra-chain bridges is correctly reported as two separate peptides that happen to be in the same tube. THE CYSTEINE BUDGET IS A REAL CONSTRAINT, NOT A FORMALITY. Each bridge consumes two cysteines, and a claim of more bridges than the sequences can supply produces a mass that looks entirely reasonable. Insulin is the perfect witness: 6 cysteines, 3 bridges, ZERO left over. Grounding (cited; researcher-groundable): published_monoisotopic_mass_human_insulin_5803_6375 (the anchor) human_insulin_a_b_chain_sequences_and_disulfide_map disulfide_bond_two_hydrogen_loss (via nx_peptide_ext) genealogy_id: peptide_chemistry + nishi_chem_suite

dependencies 3 imports · 1 importers

nx_syscalls.nx nx_peptide.nx nx_peptide_ext.nx nx_peptide_chain.nx nx_peptide_chain_test.nx

imports: nx_syscalls.nxnx_peptide.nxnx_peptide_ext.nx

imported by: nx_peptide_chain_test.nx

structs

41struct NxPepAssembly

consts

none

functions

50func nx_pep_assembly_new() -> *NxPepAssembly
called by 2: build_insulinmain calls 1: sys_mmap
62func pca_count_cys(seq: *u8) -> i64
called by 1: pca_add_chain_seq calls 1: pep_count_aa
69func pca_add_chain(a: *NxPepAssembly, b: *NxPepBuild, n_cys: i64) -> i64
called by 2: pca_add_chain_seqmain calls 1: pex_mass_q4
81func pca_add_chain_seq(a: *NxPepAssembly, seq: *u8) -> i64
88func pca_add_intra_disulfide(a: *NxPepAssembly) -> i64 { a.n_ss_intra = a.n_ss_intra + 1; return 0 }
called by 2: build_insulinmain
89func pca_add_inter_disulfide(a: *NxPepAssembly) -> i64 { a.n_ss_inter = a.n_ss_inter + 1; return 0 }
called by 2: build_insulinmain
91func pca_total_ss(a: *NxPepAssembly) -> i64
99func pca_free_cys(a: *NxPepAssembly) -> i64
104func pca_bridges_possible(a: *NxPepAssembly) -> i64
called by 2: pca_mass_q4main calls 1: pca_free_cys
111func pca_is_covalently_linked(a: *NxPepAssembly) -> i64
called by 1: main
125func pca_mass_q4(a: *NxPepAssembly) -> i64
137func pca_mass_reduced_q4(a: *NxPepAssembly) -> i64
called by 1: main
143func pca_mz_q4(a: *NxPepAssembly, z: i64) -> i64
called by 1: main calls 2: pca_mass_q4pep_mz_q4