├── .github └── workflows │ ├── generate-databases.yml │ ├── python.yml │ ├── rust.yml │ └── scripts │ └── update-all-databases.sh ├── .gitignore ├── .vscode └── settings.json ├── CITATION.cff ├── CODE_OF_CONDUCT.md ├── Cargo.toml ├── LICENSE-APACHE ├── LICENSE-MIT ├── README.md ├── clippy.toml ├── docs └── python │ ├── .readthedocs.yaml │ └── source │ ├── api.rst │ ├── conf.py │ ├── contributing.md │ └── index.md ├── examples ├── README.md ├── de-novo-align │ ├── Cargo.toml │ ├── README.md │ ├── database.fasta │ └── src │ │ └── main.rs ├── ion-explorer │ ├── Cargo.toml │ ├── README.md │ ├── figure.r │ └── src │ │ └── main.rs └── multi-annotator │ ├── Cargo.toml │ ├── README.md │ └── src │ └── main.rs ├── fuzz ├── Cargo.toml ├── README.md ├── fuzz_targets │ ├── peaks.rs │ ├── pro_forma.rs │ └── sloppy_pro_forma.rs ├── in_peaks │ ├── 11.csv │ ├── 11_custom.csv │ ├── ab.csv │ ├── x.csv │ └── x_plus.csv └── in_pro_forma │ ├── 0 │ ├── 1 │ ├── 2 │ ├── 3 │ ├── 4 │ ├── 5 │ ├── 6 │ ├── 7 │ ├── 8 │ ├── 9 │ ├── 10 │ ├── 11 │ ├── 12 │ ├── 13 │ ├── 14 │ └── 15 ├── rustyms-generate-databases ├── Cargo.toml ├── data │ ├── CIAAW-atomic-weights.csv │ ├── CIAAW-isotopic-abundances.csv │ └── IUPAC-atomic-masses.csv └── src │ ├── atomic_masses.rs │ ├── gnome.rs │ ├── main.rs │ ├── obo.rs │ ├── ontology_modification.rs │ ├── psi_mod.rs │ ├── resid.rs │ ├── unimod.rs │ └── xlmod.rs ├── rustyms-generate-imgt ├── Cargo.toml └── src │ ├── combine.rs │ ├── imgt_gene.rs │ ├── main.rs │ ├── parse.rs │ └── structs.rs ├── rustyms-py ├── CONTRIBUTING.md ├── Cargo.toml ├── README.md ├── pyproject.toml └── src │ └── lib.rs └── rustyms ├── Cargo.toml ├── README.md ├── benches └── iai.rs ├── data ├── 200305_HER_test_04_DENOVO.csv.gz ├── 200305_HER_test_04_DENOVO_excerpt.csv ├── annotated_example.mgf ├── chimeric_example.mgf ├── data.txt ├── example.mgf ├── glycan.mgf ├── inter_link.mgf ├── intra_link.mgf ├── real_example.mgf └── stuff.mgf ├── images └── glycan_root.svg └── src ├── align ├── align_type.rs ├── alignment.rs ├── bad_alignments.rs ├── consecutive.rs ├── diagonal_array.rs ├── mass_alignment.rs ├── matrices │ ├── blosum45.txt │ ├── blosum50.txt │ ├── blosum62.txt │ ├── blosum80.txt │ ├── blosum90.txt │ ├── identity.txt │ ├── pam250.txt │ ├── pam30.txt │ └── pam70.txt ├── mod.rs ├── multi_alignment.rs ├── piece.rs ├── scoring.rs └── test_alignments.rs ├── annotation ├── ambiguous.rs ├── annotatable.rs ├── annotated.rs ├── fdr.rs ├── mod.rs ├── model │ ├── built_in.rs │ ├── charge.rs │ ├── fragmentation.rs │ ├── glycan.rs │ ├── immonium_losses.md │ ├── mod.rs │ ├── parameters.rs │ └── possible_ions.rs ├── mzdata.rs ├── scores.rs └── spectrum.rs ├── chemistry ├── element.rs ├── formula │ ├── formula.rs │ ├── mod.rs │ ├── pro_forma.rs │ ├── psi_mod.rs │ ├── resid.rs │ ├── search.rs │ ├── structure.rs │ ├── unimod.rs │ └── xlmod.rs ├── isotopes.rs ├── mass_mode.rs ├── mod.rs └── molecular_charge.rs ├── databases ├── elements.dat ├── gnome.dat ├── psimod.dat ├── resid.dat ├── unimod.dat └── xlmod.dat ├── error ├── context.rs ├── custom_error.rs └── mod.rs ├── fragment ├── fragment.rs ├── fragment_type.rs ├── mod.rs ├── mzpaf.rs ├── neutral_loss.rs └── position.rs ├── fragmentation_tests.rs ├── glycan ├── glycan.rs ├── glycan_structure.rs ├── lists.rs ├── mod.rs ├── monosaccharide.rs ├── position.rs ├── positioned_structure.rs └── render │ ├── absolute.rs │ ├── bitmap.rs │ ├── element.rs │ ├── mod.rs │ ├── shape.rs │ ├── svg.rs │ └── test.rs ├── helper_functions.rs ├── identification ├── common_parser.rs ├── csv.rs ├── file_format.rs ├── formats │ ├── basic_csv.rs │ ├── deepnovofamily.rs │ ├── deepnovofamily_tests.rs │ ├── fasta.rs │ ├── instanovo.rs │ ├── instanovo_tests.rs │ ├── maxquant.rs │ ├── maxquant_tests.rs │ ├── mod.rs │ ├── msfragger.rs │ ├── msfragger_tests.rs │ ├── mztab.rs │ ├── mztab_test.rs │ ├── novob.rs │ ├── novob_tests.rs │ ├── novor.rs │ ├── novor_tests.rs │ ├── opair.rs │ ├── opair_tests.rs │ ├── peaks.rs │ ├── peaks_tests.rs │ ├── pepnet.rs │ ├── pepnet_tests.rs │ ├── plgs.rs │ ├── plgs_tests.rs │ ├── plink.rs │ ├── plink_tests.rs │ ├── powernovo.rs │ ├── powernovo_tests.rs │ ├── sage.rs │ ├── sage_tests.rs │ ├── ssl.rs │ └── ssl_tests.rs ├── general.rs ├── identified_peptide.rs ├── mod.rs ├── peaks_family_id.rs ├── peaks_fuzz_tests │ ├── crash_0 │ ├── crash_1 │ ├── crash_2 │ ├── hang_0 │ ├── hang_1 │ ├── hang_10 │ ├── hang_11 │ ├── hang_12 │ ├── hang_13 │ ├── hang_14 │ ├── hang_15 │ ├── hang_16 │ ├── hang_17 │ ├── hang_18 │ ├── hang_19 │ ├── hang_2 │ ├── hang_20 │ ├── hang_21 │ ├── hang_22 │ ├── hang_23 │ ├── hang_24 │ ├── hang_25 │ ├── hang_26 │ ├── hang_3 │ ├── hang_4 │ ├── hang_5 │ ├── hang_6 │ ├── hang_7 │ ├── hang_8 │ └── hang_9 ├── source.rs ├── spectrum_id.rs ├── test.rs └── test_files │ ├── msfragger_v21.tsv │ └── sage_v0_14.tsv ├── imgt ├── fancy.rs ├── germlines │ ├── African or Cape clawed frog.bin │ ├── Alpaca.bin │ ├── American mink.bin │ ├── Arabian camel.bin │ ├── Atlantic cod.bin │ ├── Atlantic salmon.bin │ ├── Black rat.bin │ ├── Black rockcod.bin │ ├── Blackfin icefish.bin │ ├── Bornean orangutan.bin │ ├── Channel catfish.bin │ ├── Chimpanzee.bin │ ├── Clearnose skate.bin │ ├── Common carp.bin │ ├── Common gibbon.bin │ ├── Cook's mouse.bin │ ├── Crab-eating macaque.bin │ ├── Domestic bovine.bin │ ├── Domestic cat.bin │ ├── Domestic chicken.bin │ ├── Domestic dog.bin │ ├── Domestic ferret.bin │ ├── Domestic goat.bin │ ├── Domestic horse.bin │ ├── Domestic pig.bin │ ├── Domestic sheep.bin │ ├── Eastern European house mouse.bin │ ├── Emerald rockcod.bin │ ├── European rabbit.bin │ ├── European seabass.bin │ ├── Golden hamster.bin │ ├── Gray short-tailed opossum.bin │ ├── Horn shark.bin │ ├── House mouse.bin │ ├── Human.bin │ ├── Japanese amberjack.bin │ ├── Japanese wild mouse.bin │ ├── Liontail macaque.bin │ ├── Little skate.bin │ ├── Mandarin fish.bin │ ├── Marbled lungfish.bin │ ├── Mice.bin │ ├── Norway rat.bin │ ├── Nurse shark.bin │ ├── Olive baboon anubis.bin │ ├── Pere David's macaque.bin │ ├── Pig-tailed macaque.bin │ ├── Platypus.bin │ ├── Rabbit.bin │ ├── Rainbow trout.bin │ ├── Rhesus monkey.bin │ ├── Ring-tailed lemur.bin │ ├── River trout.bin │ ├── Sandbar shark.bin │ ├── Shrew mouse.bin │ ├── Sooty mangabey.bin │ ├── Southeastern Asian house mouse.bin │ ├── Southern African pygmy mouse.bin │ ├── Spiny mouse.bin │ ├── Spotted ratfish.bin │ ├── Spotted wolffish.bin │ ├── Stump-tailed macaque.bin │ ├── Sumatran orangutan.bin │ ├── Taiwan macaque.bin │ ├── Three-spined stickleback.bin │ ├── Western European house mouse.bin │ ├── Western gorilla.bin │ ├── Western lowland gorilla.bin │ ├── Western wild mouse.bin │ ├── Zebrafish.bin │ ├── germlines.md │ └── mod.rs ├── mod.rs ├── regions.rs ├── select.rs └── species.rs ├── isobaric_sets.rs ├── lib.rs ├── ontology.rs ├── quantities ├── mod.rs ├── multi.rs └── tolerance.rs ├── rand.rs ├── sequence ├── aminoacid │ ├── aminoacid.rs │ ├── is_amino_acid.rs │ ├── mod.rs │ ├── pka.rs │ └── properties.rs ├── checked_aminoacid.rs ├── cross_link.rs ├── mod.rs ├── modification.rs ├── peptidoform │ ├── annotated.rs │ ├── complexity.rs │ ├── compound_peptidoform_ion.rs │ ├── find_modifications.rs │ ├── mod.rs │ ├── parse.rs │ ├── parse_modification.rs │ ├── parse_sloppy.rs │ ├── peptidoform.rs │ ├── peptidoform_ion.rs │ ├── tests │ │ ├── fuzz_crash.rs │ │ ├── fuzz_hang.rs │ │ ├── mod.rs │ │ ├── parse.rs │ │ ├── pro_forma_negative.rs │ │ ├── pro_forma_positive.rs │ │ └── sloppy.rs │ └── validate.rs ├── placement_rule.rs ├── protease.rs ├── sequence_element.rs ├── sequence_position.rs └── simple_modification.rs ├── spectrum ├── mgf.rs ├── mod.rs ├── peaks.rs └── raw.rs └── system.rs /.github/workflows/generate-databases.yml: -------------------------------------------------------------------------------- 1 | name: Generate databases 2 | 3 | on: 4 | workflow_dispatch: 5 | schedule: 6 | - cron: "7 4 1 * *" 7 | push: 8 | branches: ["release", "main"] 9 | 10 | permissions: 11 | contents: write 12 | pull-requests: write 13 | 14 | env: 15 | CARGO_TERM_COLOR: always 16 | CARGO_ENCODED_RUSTFLAGS: --cfg=github_action 17 | 18 | jobs: 19 | generate-databases: 20 | runs-on: ubuntu-latest 21 | steps: 22 | - uses: actions/checkout@v4 23 | - name: Check 24 | run: cargo check 25 | - name: Download and build external databases 26 | run: | 27 | bash ./.github/workflows/scripts/update-all-databases.sh 28 | MESSAGE="$(cat /tmp/MESSAGES)" 29 | echo "MESSAGE=${MESSAGE}" >> "${GITHUB_ENV}" 30 | - name: Create pull request 31 | id: cpr 32 | uses: peter-evans/create-pull-request@v7 33 | with: 34 | token: ${{ secrets.RUSTEOMICS_MZCORE_PR_TOKEN }} 35 | commit-message: Update external databases and ontologies 36 | committer: GitHub 37 | author: GitHub 38 | branch: update-databases 39 | delete-branch: true 40 | title: "Update external databases and ontologies" 41 | body: | 42 | This automated PR updates the binary blobs for external databases 43 | and ontologies. 44 | 45 | Below are messages from script execution: 46 | > ${{ env.MESSAGE }} 47 | labels: | 48 | A-rustyms-generate-databases 49 | C-maintenance 50 | -------------------------------------------------------------------------------- /.github/workflows/python.yml: -------------------------------------------------------------------------------- 1 | name: Python CI 2 | 3 | on: 4 | release: 5 | -type: [publish] 6 | 7 | permissions: 8 | contents: read 9 | 10 | jobs: 11 | linux: 12 | runs-on: ubuntu-latest 13 | strategy: 14 | matrix: 15 | target: [x86_64, aarch64] 16 | steps: 17 | - uses: actions/checkout@v3 18 | - uses: actions/setup-python@v4 19 | with: 20 | python-version: "3.12" 21 | - name: Build wheels 22 | uses: PyO3/maturin-action@v1 23 | with: 24 | target: ${{ matrix.target }} 25 | args: --release --out dist --find-interpreter --manifest-path ./rustyms-py/Cargo.toml --jobs 1 26 | sccache: "false" 27 | manylinux: auto 28 | - name: Upload wheels 29 | uses: actions/upload-artifact@v4 30 | with: 31 | name: wheels-linux-${{ matrix.target }} 32 | path: dist 33 | 34 | windows: 35 | runs-on: windows-latest 36 | strategy: 37 | matrix: 38 | target: [x64, x86] 39 | steps: 40 | - uses: actions/checkout@v3 41 | - uses: actions/setup-python@v4 42 | with: 43 | python-version: "3.12" 44 | architecture: ${{ matrix.target }} 45 | - name: Build wheels 46 | uses: PyO3/maturin-action@v1 47 | with: 48 | target: ${{ matrix.target }} 49 | args: --release --out dist --find-interpreter --manifest-path ./rustyms-py/Cargo.toml 50 | sccache: "true" 51 | - name: Upload wheels 52 | uses: actions/upload-artifact@v4 53 | with: 54 | name: wheels-windows-${{ matrix.target }} 55 | path: dist 56 | 57 | macos: 58 | runs-on: macos-latest 59 | strategy: 60 | matrix: 61 | target: [x86_64, aarch64] 62 | steps: 63 | - uses: actions/checkout@v3 64 | - uses: actions/setup-python@v4 65 | with: 66 | python-version: "3.12" 67 | - name: Build wheels 68 | uses: PyO3/maturin-action@v1 69 | with: 70 | target: ${{ matrix.target }} 71 | args: --release --out dist --find-interpreter --manifest-path ./rustyms-py/Cargo.toml 72 | sccache: "true" 73 | - name: Upload wheels 74 | uses: actions/upload-artifact@v4 75 | with: 76 | name: wheels-macos-${{ matrix.target }} 77 | path: dist 78 | 79 | sdist: 80 | runs-on: ubuntu-latest 81 | steps: 82 | - uses: actions/checkout@v3 83 | - name: Build sdist 84 | uses: PyO3/maturin-action@v1 85 | with: 86 | command: sdist 87 | args: --out dist --manifest-path ./rustyms-py/Cargo.toml 88 | - name: Upload sdist 89 | uses: actions/upload-artifact@v4 90 | with: 91 | name: wheels-sdist 92 | path: dist 93 | 94 | release: 95 | name: Release 96 | runs-on: ubuntu-latest 97 | if: "startsWith(github.ref, 'refs/tags/')" 98 | needs: [linux, windows, macos, sdist] 99 | permissions: 100 | id-token: write 101 | steps: 102 | - uses: actions/download-artifact@v4 103 | with: 104 | pattern: wheels-* 105 | path: dist 106 | merge-multiple: true 107 | - name: Publish to PyPI 108 | uses: pypa/gh-action-pypi-publish@release/v1 109 | -------------------------------------------------------------------------------- /.github/workflows/rust.yml: -------------------------------------------------------------------------------- 1 | name: Rust 2 | 3 | on: 4 | push: 5 | branches: [ "release", "main" ] 6 | pull_request: 7 | branches: [ "release", "main" ] 8 | 9 | env: 10 | CARGO_TERM_COLOR: always 11 | 12 | jobs: 13 | build: 14 | 15 | runs-on: ubuntu-latest 16 | 17 | steps: 18 | - uses: actions/checkout@v4 19 | - name: Check 20 | run: cargo check 21 | - name: Build all features 22 | run: | 23 | cargo build -p rustyms --no-default-features 24 | cargo build -p rustyms --no-default-features --features align 25 | cargo build -p rustyms --no-default-features --features identification 26 | cargo build -p rustyms --no-default-features --features imgt 27 | cargo build -p rustyms --no-default-features --features isotopes 28 | cargo build -p rustyms --no-default-features --features rand 29 | cargo build -p rustyms --no-default-features --features rayon 30 | cargo build -p rustyms --no-default-features --features mzdata 31 | cargo build -p rustyms --no-default-features --features glycan-render 32 | cargo build -p rustyms --no-default-features --features glycan-render-bitmap 33 | cargo build -p rustyms --no-default-features --features imgt,rayon 34 | cargo build -p rustyms --no-default-features --features imgt,rayon,align 35 | cargo build -p rustyms --no-default-features --features imgt,align 36 | 37 | fmt: 38 | runs-on: ubuntu-latest 39 | 40 | needs: build 41 | steps: 42 | - uses: actions/checkout@v4 43 | - name: Run fmt 44 | run: cargo fmt --check 45 | 46 | clippy: 47 | runs-on: ubuntu-latest 48 | 49 | needs: build 50 | steps: 51 | - uses: actions/checkout@v4 52 | - name: Run clippy 53 | run: cargo clippy 54 | 55 | test: 56 | runs-on: ubuntu-latest 57 | env: 58 | CARGO_ENCODED_RUSTFLAGS: --cfg=github_action 59 | 60 | needs: build 61 | steps: 62 | - uses: actions/checkout@v4 63 | - name: Run tests 64 | run: cargo test -p rustyms 65 | 66 | -------------------------------------------------------------------------------- /.github/workflows/scripts/update-all-databases.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | 4 | function help { 5 | echo "Usage: generate-all-databases.sh" 6 | echo "" 7 | echo "Download the required databases and build the " 8 | echo "required binary representations of the ontologies." 9 | echo "" 10 | echo "Options:" 11 | echo " -h, --help Display this help and exit" 12 | exit 1 13 | } 14 | 15 | 16 | # Download IMGT and process and serialize it to a binary blob. 17 | function make-imgt { 18 | echo "Downloading IMGT..." 19 | mkdir -p rustyms-generate-imgt/data 20 | # IMGT is not very reliable, so sometimes the server is down. 21 | # The || clause here allows the rest of the script to continue 22 | # even if this fails. 23 | curl https://www.imgt.org/download/LIGM-DB/imgt.dat.Z \ 24 | | gunzip -c > rustyms-generate-imgt/data/imgt.dat \ 25 | && echo "Serializing IMGT ..." \ 26 | && cargo run --bin rustyms-generate-imgt \ 27 | || echo "Failed to download IMGT. I did not update it." >> /tmp/MESSAGES 28 | } 29 | 30 | 31 | # Download the relevant ontologies and serialize them to binary blobs. 32 | function make-ontologies { 33 | echo "Downloading databases..." 34 | db_data="rustyms-generate-databases/data" 35 | mkdir -p ${db_data} 36 | curl https://raw.githubusercontent.com/HUPO-PSI/psi-mod-CV/refs/heads/master/PSI-MOD-newstyle.obo \ 37 | > ${db_data}/PSI-MOD-newstyle.obo 38 | curl http://www.unimod.org/obo/unimod.obo > ${db_data}/unimod.obo 39 | curl ftp://ftp.proteininformationresource.org/pir_databases/other_databases/resid/RESIDUES.XML \ 40 | > ${db_data}/RESID-RESIDUES.XML 41 | curl https://raw.githubusercontent.com/HUPO-PSI/mzIdentML/master/cv/XLMOD.obo \ 42 | > ${db_data}/XLMOD.obo 43 | curl -L http://purl.obolibrary.org/obo/gno.obo \ 44 | > ${db_data}/GNOme.obo 45 | curl -L https://glycosmos.org/download/glycosmos_glycans_list.csv \ 46 | > ${db_data}/glycosmos_glycans_list.csv 47 | 48 | 49 | echo "Serializing the other databases..." 50 | cargo run --bin rustyms-generate-databases 51 | } 52 | 53 | 54 | function main { 55 | while [[ $# -gt 0 ]]; do 56 | case "$1" in 57 | -h|--help) 58 | help 59 | ;; 60 | *) 61 | echo "Unknown argument: $1" 62 | help 63 | ;; 64 | esac 65 | done 66 | 67 | touch /tmp/MESSAGES 68 | 69 | make-imgt 70 | make-ontologies 71 | } 72 | 73 | 74 | main "$@" 75 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | rustyms-generate-databases/data/* 2 | !rustyms-generate-databases/data/CIAAW* 3 | !rustyms-generate-databases/data/IUPAC* 4 | /target 5 | Cargo.lock 6 | */target/ 7 | errors.dat 8 | *.dat.Z 9 | *.dat 10 | *.html 11 | GNOme.obo 12 | glycosmos_glycans_list.csv 13 | .venv/ 14 | docs/**/_build/ 15 | out 16 | out_peaks 17 | out_pro_forma 18 | out_sloppy_pro_forma 19 | examples/ion-explorer/data 20 | examples/ion-explorer/figures -------------------------------------------------------------------------------- /CITATION.cff: -------------------------------------------------------------------------------- 1 | title: rustyms 2 | version: 0.9.0 3 | abstract: A rust library for parsing Pro Forma peptides and matching them against MS spectra . 4 | authors: 5 | - affiliation: Utrecht University 6 | family-names: Schulte 7 | given-names: Douwe 8 | orcid: https://orcid.org/0000-0003-0594-0993 9 | - affiliation: VIB-UGent Center for Medical Biotechnology 10 | family-names: Gabriels 11 | given-names: Ralf 12 | orcid: https://orcid.org/0000-0002-1679-1711 13 | - affiliation: Utrecht University 14 | family-names: Heerdink 15 | given-names: Auke 16 | cff-version: 1.2.0 17 | identifiers: 18 | - description: Main paper (preprint) 19 | type: doi 20 | value: 10.1101/2025.01.18.633732 21 | - description: Mass alignment algorithm paper 22 | type: doi 23 | value: 10.1021/acs.jproteome.4c00188 24 | - description: Mass alignment algorithm paper (preprint) 25 | type: url 26 | value: https://www.biorxiv.org/content/10.1101/2024.02.20.581155v1 27 | - description: Repository 28 | type: url 29 | value: https://github.com/snijderlab/rustyms 30 | keywords: 31 | - sequencing 32 | - antibody 33 | - mass-spectrometry 34 | - de novo 35 | license: MIT OR Apache-2.0 36 | message: If you use this software, please cite it using these metadata. 37 | repository-code: https://github.com/snijderlab/rustyms 38 | -------------------------------------------------------------------------------- /LICENSE-MIT: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Douwe Schulte and contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 🦀 Rust: [![Crates.io](https://img.shields.io/crates/v/rustyms.svg)](https://crates.io/crates/rustyms) [![rustyms documentation](https://docs.rs/rustyms/badge.svg)](https://docs.rs/rustyms) 2 | 🐍 Python: [![PyPI version](https://badge.fury.io/py/rustyms.svg)](https://badge.fury.io/py/rustyms) [![Python Docs](https://readthedocs.org/projects/rustyms/badge/?version=latest)](https://rustyms.readthedocs.io/) 3 | 4 | # Match those fragments! 5 | 6 | A peptide fragmentation matching library for Rust. Built to handle very complex peptidoforms in a sensible way. 7 | 8 | ## Features 9 | 10 | - Read [ProForma](https://github.com/HUPO-PSI/ProForma) sequences (complete 2.0 specification supported: 'level 2-ProForma + top-down compliant + cross-linking compliant + glycans compliant + mass spectrum compliant') 11 | - Generate theoretical fragments with control over the fragmentation model from any ProForma peptidoform 12 | - Generate theoretical fragments for chimeric spectra 13 | - Generate theoretical fragments for cross-links (also disulfides) 14 | - Generate theoretical fragments for modifications of unknown position 15 | - Generate peptide backbone (a, b, c, x, y, and z) and satellite ion fragments (d, v, and w) 16 | - Generate glycan fragments (B, Y, and internal fragments) 17 | - Integrated with [mzdata](https://crates.io/crates/mzdata) for reading raw data files 18 | - Match spectra to the generated fragments 19 | - [Align peptides based on mass](https://pubs.acs.org/doi/10.1021/acs.jproteome.4c00188) 20 | - Fast access to the IMGT database of antibody germlines 21 | - Reading of multiple identified peptide file formats (among others: Fasta, MaxQuant, MSFragger, Novor, OPair, Peaks, and Sage) 22 | - Exhaustively fuzz tested for reliability (using [cargo-afl](https://crates.io/crates/cargo-afl)) 23 | - Extensive use of [uom](https://docs.rs/uom/latest/uom/) for compile time unit checking 24 | - Python bindings are provided to several core components of the rustyms library. Go to the [Python documentation](https://rustyms.readthedocs.io/) for more information. 25 | 26 | # Folder organisation 27 | 28 | ## rustyms 29 | 30 | This is the main library. This contains all source code, databases (Unimod etc) and example data to run the rustyms library. 31 | 32 | ## examples 33 | 34 | Some examples on how to use the rustyms library are provided here, see the readme file in the examples themselves for more details. 35 | 36 | ## fuzz 37 | 38 | The harness to fuzz test the library for increased stability, see the readme for more details. 39 | 40 | ## rustyms-py 41 | 42 | This Rust library provides python bindings (using pyO3) for rustyms. 43 | 44 | ## rustyms-generate-databases 45 | 46 | Using the `rustyms-generate-databases` the definitions for the databases can be updated. See the readme on the download locations for all databases. Then run `cargo run -p rustyms-generate-databases` (from the root folder of this repository). 47 | 48 | ## rustyms-generate-imgt 49 | 50 | Using the `rustyms-generate-imgt` the definitions for the germlines can be updated. Put the imgt.dat.Z file in the `rustyms-generate-imgt/data` directory and unpack it (this can be downloaded from https://www.imgt.org/download/LIGM-DB/imgt.dat.Z). Then run `cargo run -p rustyms-generate-imgt` (from the root folder of this repository). 51 | 52 | # Contributing 53 | 54 | Any contribution is welcome (especially adding/fixing documentation as that is very hard to do as main developer). -------------------------------------------------------------------------------- /clippy.toml: -------------------------------------------------------------------------------- 1 | doc-valid-idents = [ 2 | "..", 3 | "BiatNovo", 4 | "Cascadia", 5 | "DeepNovo", 6 | "DeepNovoFamily", 7 | "EAciD", 8 | "FragPipe", 9 | "GNOme", 10 | "InstaNovo", 11 | "MaxNovo", 12 | "MaxQuant", 13 | "MSFragger", 14 | "MZTab", 15 | "NovoB", 16 | "OPair", 17 | "PepNet", 18 | "PGPointNovo", 19 | "pi-PrimeNovo", 20 | "PointNovo", 21 | "PointNovoFamily", 22 | "PowerNovo", 23 | "ProForma", 24 | "PSM_ID", 25 | "SpectrumSequenceList", 26 | "π-PrimeNovo", 27 | ] 28 | avoid-breaking-exported-api = false 29 | check-private-items = true 30 | -------------------------------------------------------------------------------- /docs/python/.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | build: 4 | os: "ubuntu-20.04" 5 | tools: 6 | python: "3.8" 7 | rust: "latest" 8 | 9 | python: 10 | install: 11 | - method: pip 12 | path: rustyms-py 13 | extra_requirements: 14 | - docs 15 | 16 | sphinx: 17 | builder: dirhtml 18 | -------------------------------------------------------------------------------- /docs/python/source/api.rst: -------------------------------------------------------------------------------- 1 | ******************** 2 | Python API Reference 3 | ******************** 4 | 5 | .. automodule:: rustyms 6 | :members: 7 | :undoc-members: 8 | :imported-members: 9 | :exclude-members: filterwarnings 10 | -------------------------------------------------------------------------------- /docs/python/source/conf.py: -------------------------------------------------------------------------------- 1 | """Configuration file for the Sphinx documentation builder.""" 2 | 3 | import os 4 | import sys 5 | 6 | sys.path.insert(0, os.path.abspath("../../")) 7 | 8 | # from rustyms import __version__ 9 | 10 | # Project information 11 | project = "rustyms" 12 | author = "Douwe Schulte, Ralf Gabriels" 13 | github_project_url = "https://github.com/snijderlab/rustyms/" 14 | github_doc_root = "https://github.com/snijderlab/rustyms/tree/release/docs/python/source/" 15 | 16 | # Version 17 | # release = __version__ 18 | 19 | # General configuration 20 | extensions = [ 21 | "sphinx.ext.autodoc", 22 | "sphinx.ext.autosectionlabel", 23 | "sphinx.ext.autosummary", 24 | "sphinx.ext.napoleon", 25 | "sphinx.ext.intersphinx", 26 | "sphinx.ext.viewcode", 27 | "myst_parser", 28 | "sphinx_rtd_theme", 29 | ] 30 | source_suffix = [".rst", ".md"] 31 | master_doc = "index" 32 | exclude_patterns = ["_build"] 33 | 34 | # Options for HTML output 35 | html_theme = "sphinx_rtd_theme" 36 | html_static_path = ["_static"] 37 | html_css_files = ["css/custom.css"] 38 | 39 | # Autodoc options 40 | autodoc_default_options = {"members": True, "show-inheritance": True} 41 | autodoc_member_order = "bysource" 42 | autodoc_typehints = "both" 43 | autoclass_content = "init" 44 | 45 | # Intersphinx options 46 | intersphinx_mapping = { 47 | "python": ("https://docs.python.org/3", None), 48 | } 49 | 50 | def setup(app): 51 | config = { 52 | "enable_eval_rst": True, 53 | } 54 | -------------------------------------------------------------------------------- /docs/python/source/contributing.md: -------------------------------------------------------------------------------- 1 | ```{include} ../../../rustyms-py/CONTRIBUTING.md 2 | :parser: myst 3 | ``` 4 | -------------------------------------------------------------------------------- /docs/python/source/index.md: -------------------------------------------------------------------------------- 1 | # rustyms Python bindings 2 | 3 | Python bindings to the [rustyms](https://docs.rs/rustyms/) library for proteomics 4 | and mass spectrometry. 5 | 6 | ## Quickstart 7 | 8 | Python bindings are provided to several core components of the rustyms library, including: 9 | 10 | - {py:class}`~rustyms.Element` Chemical elements 11 | - {py:class}`~rustyms.MolecularFormula` Molecular formulas 12 | - {py:class}`~rustyms.AminoAcid` Amino acids 13 | - {py:class}`~rustyms.Modification` Amino acid modifications, with support for mass shifts, 14 | chemical formulas, Unimod, and PSI-MOD labels 15 | - {py:class}`~rustyms.AmbiguousModification` {py:class}`~rustyms.Modification` with ambiguous 16 | localization. 17 | - {py:class}`~rustyms.Fragment` Theoretical fragment ion 18 | - {py:class}`~rustyms.SequenceElement` One position in a peptide sequence with amino acid and 19 | modifications 20 | - {py:class}`~rustyms.CompoundPeptidoformIon` Peptide sequence, modifications, and charge, using 21 | [ProForma 2.0](https://proforma.readthedocs.io) (see {ref}`ProForma support` for more 22 | information) 23 | - {py:class}`~rustyms.RawPeak` A single peak in a mass spectrum 24 | - {py:class}`~rustyms.RawSpectrum` A mass spectrum without any annotations 25 | - {py:class}`~rustyms.AnnotatedPeak` A single peak in a mass spectrum with annotations 26 | - {py:class}`~rustyms.AnnotatedSpectrum` A mass spectrum with annotations 27 | 28 | {py:mod}`rustyms` can, for example, annotate a mass spectrum from a 29 | [ProForma 2.0](https://proforma.readthedocs.io) peptidoforms string: 30 | 31 | ```python 32 | import rustyms 33 | 34 | # Create a new spectrum 35 | raw_spectrum = rustyms.RawSpectrum( 36 | title="spectrum_1", 37 | num_scans=6, 38 | rt=10, 39 | precursor_mass=436.12634, 40 | precursor_charge=2, 41 | mz_array=[72.04444, 148.06048, 175.05362, 263.08742, 290.08056, 366.09661], 42 | intensity_array=[100, 600, 300, 400, 500, 200], 43 | ) 44 | 45 | # Create a new peptide from a ProForma 2.0 string 46 | peptide = rustyms.CompoundPeptidoformIon("ACDE/2") 47 | 48 | # Annotate the spectrum with the peptide 49 | annotated_spectrum = raw_spectrum.annotate(peptide, "cid_hcd") 50 | ``` 51 | 52 | ## Installation 53 | 54 | Install with pip: 55 | 56 | ```bash 57 | pip install rustyms 58 | ``` 59 | 60 | ## Contributing and development 61 | 62 | See {ref}`Contributing` for information on the development setup and how to contribute to the 63 | rustyms Python bindings. 64 | 65 | ```{toctree} 66 | :hidden: 67 | :includehidden: 68 | :maxdepth: 2 69 | 70 | About 71 | api 72 | contributing 73 | ``` 74 | -------------------------------------------------------------------------------- /examples/README.md: -------------------------------------------------------------------------------- 1 | In the sub folders are some example small programs/scripts that are written with rustyms. See the readme for the separate examples for more details. 2 | -------------------------------------------------------------------------------- /examples/de-novo-align/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "de-novo-align" 3 | version = "0.1.0" 4 | authors.workspace = true 5 | edition.workspace = true 6 | license.workspace = true 7 | publish = false 8 | 9 | [dependencies] 10 | rustyms = { path = "../../rustyms", default-features=false, features = ["align", "identification"] } 11 | clap = { workspace = true } 12 | itertools = { workspace = true } 13 | rayon = { workspace = true } 14 | 15 | [lints] 16 | workspace = true 17 | -------------------------------------------------------------------------------- /examples/de-novo-align/README.md: -------------------------------------------------------------------------------- 1 | # De Novo align 2 | 3 | Usage: 4 | ``` 5 | cargo run --release --bin de-novo-align -- --peptides rustyms\data\200305_HER_test_04_DENOVO.csv.gz --database examples\de-novo-align\database.fasta --out-path out.csv 6 | ``` 7 | 8 | This aligns all peptides from a given identified peptides file, see rustyms for a list of all supported files, to a list of known proteins. It returns a CSV file with the best alignment for each _de novo_ peptide. This can be used to look into how good the _de novo_ predictions actually are. 9 | -------------------------------------------------------------------------------- /examples/de-novo-align/database.fasta: -------------------------------------------------------------------------------- 1 | >sp|P35900|K1C20_HUMAN Keratin, type I cytoskeletal 20 OS=Homo sapiens OX=9606 GN=KRT20 PE=1 SV=1 2 | MDFSRRSFHRSLSSSLQAPVVSTVGMQRLGTTPSVYGGAGGRGIRISNSRHTVNYGSDLT 3 | GGGDLFVGNEKMAMQNLNDRLASYLEKVRTLEQSNSKLEVQIKQWYETNAPRAGRDYSAY 4 | YRQIEELRSQIKDAQLQNARCVLQIDNAKLAAEDFRLKYETERGIRLTVEADLQGLNKVF 5 | DDLTLHKTDLEIQIEELNKDLALLKKEHQEEVDGLHKHLGNTVNVEVDAAPGLNLGVIMN 6 | EMRQKYEVMAQKNLQEAKEQFERQTAVLQQQVTVNTEELKGTEVQLTELRRTSQSLEIEL 7 | QSHLSMKESLEHTLEETKARYSSQLANLQSLLSSLEAQLMQIRSNMERQNNEYHILLDIK 8 | TRLEQEIATYRRLLEGEDVKTTEYQLSTLEERDIKKTRKIKTVVQEVVDGKVVSSEVKEV 9 | EENI 10 | >sp|P00761|TRYP_PIG Trypsin OS=Sus scrofa OX=9823 PE=1 SV=1 11 | FPTDDDDKIVGGYTCAANSIPYQVSLNSGSHFCGGSLINSQWVVSAAHCYKSRIQVRLGE 12 | HNIDVLEGNEQFINAAKIITHPNFNGNTLDNDIMLIKLSSPATLNSRVATVSLPRSCAAA 13 | GTECLISGWGNTKSSGSSYPSLLQCLKAPVLSDSSCKSSYPGQITGNMICVGFLEGGKDS 14 | CQGDSGGPVVCNGQLQGIVSWGYGCAQKNKPGVYTKVCNYVNWIQQTIAAN 15 | >sp|Q99895|CTRC_HUMAN Chymotrypsin-C OS=Homo sapiens OX=9606 GN=CTRC PE=1 SV=2 16 | MLGITVLAALLACASSCGVPSFPPNLSARVVGGEDARPHSWPWQISLQYLKNDTWRHTCG 17 | GTLIASNFVLTAAHCISNTRTYRVAVGKNNLEVEDEEGSLFVGVDTIHVHKRWNALLLRN 18 | DIALIKLAEHVELSDTIQVACLPEKDSLLPKDYPCYVTGWGRLWTNGPIADKLQQGLQPV 19 | VDHATCSRIDWWGFRVKKTMVCAGGDGVISACNGDSGGPLNCQLENGSWEVFGIVSFGSR 20 | RGCNTRKKPVVYTRVSAYIDWINEKMQL 21 | >sp|P00778|PRLA_LYSEN Alpha-lytic protease OS=Lysobacter enzymogenes OX=69 GN=alpha-LP PE=1 SV=3 22 | MYVSNHRSRRVARVSVSCLVAALAAMSCGAALAADQVDPQLKFAMQRDLGIFPTQLPQYL 23 | QTEKLARTQAAAIEREFGAQFAGSWIERNEDGSFKLVAATSGARKSSTLGGVEVRNVRYS 24 | LKQLQSAMEQLDAGANARVKGVSKPLDGVQSWYVDPRSNAVVVKVDDGATEAGVDFVALS 25 | GADSAQVRIESSPGKLQTTANIVGGIEYSINNASLCSVGFSVTRGATKGFVTAGHCGTVN 26 | ATARIGGAVVGTFAARVFPGNDRAWVSLTSAQTLLPRVANGSSFVTVRGSTEAAVGAAVC 27 | RSGRTTGYQCGTITAKNVTANYAEGAVRGLTQGNACMGRGDSGGSWITSAGQAQGVMSGG 28 | NVQSNGNNCGIPASQRSSLFERLQPILSQYGLSLVTG 29 | >sp|P00800|THER_BACTH Thermolysin OS=Bacillus thermoproteolyticus OX=1427 GN=npr PE=1 SV=3 30 | MKMKMKLASFGLAAGLAAQVFLPYNALASTEHVTWNQQFQTPQFISGDLLKVNGTSPEEL 31 | VYQYVEKNENKFKFHENAKDTLQLKEKKNDNLGFTFMRFQQTYKGIPVFGAVVTSHVKDG 32 | TLTALSGTLIPNLDTKGSLKSGKKLSEKQARDIAEKDLVANVTKEVPEYEQGKDTEFVVY 33 | VNGDEASLAYVVNLNFLTPEPGNWLYIIDAVDGKILNKFNQLDAAKPGDVKSITGTSTVG 34 | VGRGVLGDQKNINTTYSTYYYLQDNTRGNGIFTYDAKYRTTLPGSLWADADNQFFASYDA 35 | PAVDAHYYAGVTYDYYKNVHNRLSYDGNNAAIRSSVHYSQGYNNAFWNGSQMVYGDGDGQ 36 | TFIPLSGGIDVVAHELTHAVTDYTAGLIYQNESGAINEAISDIFGTLVEFYANKNPDWEI 37 | GEDVYTPGISGDSLRSMSDPAKYGDPDHYSKRYTGTQDNGGVHINSGIINKAAYLISQGG 38 | THYGVSVVGIGRDKLGKIFYRALTQYLTPTSNFSQLRAAAVQSATDLYGSTSQEVASVKQ 39 | AFDAVGVK 40 | >sp|Q9R4J4|ASPN_PSEFR Peptidyl-Asp metalloendopeptidase (Fragment) OS=Pseudomonas fragi OX=296 PE=1 SV=2 41 | ESNQGYVNSNVGIELARYETTNYTESGSFDTDLARFRGTSDSIHTSRNTYTAADCATGYY 42 | SFAHEIGHLQSARDIATDSSTSPYAYGHGYRYEPATGWRTIMAYNCTRSCPRLNYWSNPN 43 | ISYDIGPDNQRVLVNTKATIAAFR 44 | >Herceptin 45 | EVQLVESGGGLVQPGGSLRLSCAASGFNIKDTYIHWVRQAPGKGLEWVARIYPTNGYTRY 46 | ADSVKGRFTISADTSKNTAYLQMNSLRAEDTAVYYCSRWGGDGFYAMDYWGQGTLVTVSS 47 | ASTKGPSVFPLAPSSKSTSGGTAALGCLVKDYFPEPVTVSWNSGALTSGVHTFPAVLQSS 48 | GLYSLSSVVTVPSSSLGTQTYICNVNHKPSNTKVDKKVEPKSCDKTHTCPPCPAPELLGG 49 | PSVFLFPPKPKDTLMISRTPEVTCVVVDVSHEDPEVKFNWYVDGVEVHNAKTKPREEQYN 50 | STYRVVSVLTVLHQDWLNGKEYKCKVSNKALPAPIEKTISKAKGQPREPQVYTLPPSREE 51 | MTKNQVSLTCLVKGFYPSDIAVEWESNGQPENNYKTTPPVLDSDGSFFLYSKLTVDKSRW 52 | QQGNVFSCSVMHEALHNHYTQKSLSLSPGK 53 | DIQMTQSPSSLSASVGDRVTITCRASQDVNTAVAWYQQKPGKAPKLLIYSASFLYSGVPS 54 | RFSGSRSGTDFTLTISSLQPEDFATYYCQQHYTTPPTFGQGTKVEIKRTVAAPSVFIFPP 55 | SDEQLKSGTASVVCLLNNFYPREAKVQWKVDNALQSGNSQESVTEQDSKDSTYSLSSTLT 56 | LSKADYEKHKVYACEVTHQGLSSPVTKSFNRGEC -------------------------------------------------------------------------------- /examples/ion-explorer/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ion-explorer" 3 | version = "0.1.0" 4 | authors.workspace = true 5 | edition.workspace = true 6 | license.workspace = true 7 | publish = false 8 | 9 | [dependencies] 10 | clap = { workspace = true } 11 | directories = { workspace = true } 12 | itertools = { workspace = true } 13 | mzdata = { workspace = true, features = ["mgf", "mzml", "thermo"] } 14 | rustyms = { path = "../../rustyms", default-features = false, features = [ 15 | "mzdata", 16 | "identification", 17 | ] } 18 | serde_json = { workspace = true } 19 | rayon = {workspace = true} 20 | 21 | [lints] 22 | workspace = true 23 | -------------------------------------------------------------------------------- /examples/ion-explorer/README.md: -------------------------------------------------------------------------------- 1 | # Ion explorer 2 | 3 | ``` 4 | argo run -p ion-explorer --release -- --in-path /home/douwe/Downloads/raw_data/COVID19_IgG_14_DENOVO_5.csv --raw-file-directory /home/douwe/Downloads/raw_data/ --out-path . 5 | ``` 6 | 7 | This takes an identified peptides file and extracts and bins all peaks surrounding the main fragment series. This helps in discovering which fragments and neutral losses are actually generated by the used fragmentation method. It returns a separate csv file for all fragments with the mz, count, and average intensity for all detected peaks. -------------------------------------------------------------------------------- /examples/multi-annotator/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "multi-annotator" 3 | version = "0.1.0" 4 | authors.workspace = true 5 | edition.workspace = true 6 | license.workspace = true 7 | publish = false 8 | 9 | [dependencies] 10 | clap = { workspace = true } 11 | directories = { workspace = true } 12 | itertools = { workspace = true } 13 | mzdata = { workspace = true, default-features=false, features = ["mgf", "mzml"] } 14 | rayon = { workspace = true } 15 | rustyms = { path = "../../rustyms", default-features=false, features = ["mzdata", "identification"] } 16 | serde_json = { workspace = true } 17 | 18 | [lints] 19 | workspace = true 20 | -------------------------------------------------------------------------------- /examples/multi-annotator/README.md: -------------------------------------------------------------------------------- 1 | # Multi annotator 2 | 3 | Usage: 4 | ``` 5 | cargo run --release --bin multi-annotator -- --in-path .\CIDcurves_file_to_match.csv --out-path out.csv 6 | ``` 7 | Note: the examples files are not present. 8 | 9 | This takes a CSV file as input that contains a peptide and the rawfile it originated from, it then annotates the spectrum with the theoretical fragmentation from rustyms and delivers some statistics on the annotation in a resulting CSV file. This can be used to get a global impression over a whole dataset, so for example see if a certain fragmentation energy increases or decreases the coverage of a particular ion series (peptide or glycan). -------------------------------------------------------------------------------- /fuzz/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rustyms-fuzz" 3 | version = "0.0.0" 4 | authors.workspace = true 5 | edition.workspace = true 6 | license.workspace = true 7 | publish = false 8 | 9 | [package.metadata] 10 | cargo-fuzz = true 11 | 12 | [dependencies] 13 | afl = { workspace = true } 14 | rustyms = { path = "../rustyms" } 15 | 16 | [[bin]] 17 | name = "pro_forma" 18 | path = "fuzz_targets/pro_forma.rs" 19 | test = false 20 | doc = false 21 | bench = false 22 | 23 | [[bin]] 24 | name = "sloppy_pro_forma" 25 | path = "fuzz_targets/sloppy_pro_forma.rs" 26 | test = false 27 | doc = false 28 | bench = false 29 | 30 | [[bin]] 31 | name = "peaks" 32 | path = "fuzz_targets/peaks.rs" 33 | test = false 34 | doc = false 35 | bench = false 36 | 37 | [lints] 38 | workspace = true 39 | -------------------------------------------------------------------------------- /fuzz/README.md: -------------------------------------------------------------------------------- 1 | # Fuzzing 2 | 3 | Uses [cargo-afl](https://crates.io/crates/cargo-afl) for [fuzz testing](https://en.wikipedia.org/wiki/Fuzzing). Note that this only works on Linux. 4 | 5 | From root directory 6 | ``` 7 | cargo-afl afl system-config 8 | cargo afl build --release -p rustyms-fuzz 9 | cargo afl fuzz -i fuzz/in_pro_forma -o out_pro_forma target/release/pro_forma 10 | cargo afl fuzz -i fuzz/in_pro_forma -o out_sloppy_pro_forma target/release/sloppy_pro_forma 11 | cargo afl fuzz -i fuzz/in_peaks -o out_peaks target/release/peaks 12 | ``` 13 | Several fuzz targets are defined: `pro_forma`, `sloppy_pro_forma`, and `peaks`. The two peptide targets share the `in_pro_forma` directory with input examples. The peaks target has `in_peaks` as directory of input examples. 14 | 15 | After running the fuzzer the following commands can be used to easily save all crashes into a single file. 16 | ``` 17 | open out_pro_forma/default/crashes/* | save crashes.txt -f (nushell) 18 | cat out_pro_forma/default/crashes/* >> crashes.txt (bash) 19 | ``` -------------------------------------------------------------------------------- /fuzz/fuzz_targets/peaks.rs: -------------------------------------------------------------------------------- 1 | //! Fuzz target for Peaks CSV file parsing 2 | use std::io::BufReader; 3 | 4 | use afl::*; 5 | use rustyms::identification::{IdentifiedPeptidoformSource, PeaksData, csv}; 6 | 7 | use std::io::Read; 8 | use std::io::Result; 9 | use std::slice::Iter; 10 | 11 | /// Thanks to crate 'stringreader' 12 | #[derive(Debug)] 13 | pub struct StringReader<'a> { 14 | iter: Iter<'a, u8>, 15 | } 16 | 17 | impl<'a> StringReader<'a> { 18 | /// Wrap a string in a `StringReader`, which implements `std::io::Read`. 19 | pub fn new(data: &'a str) -> Self { 20 | Self { 21 | iter: data.as_bytes().iter(), 22 | } 23 | } 24 | } 25 | 26 | impl Read for StringReader<'_> { 27 | fn read(&mut self, buf: &mut [u8]) -> Result { 28 | for (i, item) in buf.iter_mut().enumerate() { 29 | if let Some(x) = self.iter.next() { 30 | *item = *x; 31 | } else { 32 | return Ok(i); 33 | } 34 | } 35 | Ok(buf.len()) 36 | } 37 | } 38 | 39 | fn main() { 40 | fuzz!(|data: &[u8]| { 41 | if let Ok(s) = std::str::from_utf8(data) { 42 | if let Ok(csv) = csv::parse_csv_raw(BufReader::new(StringReader::new(s)), b',', None) { 43 | let _unused: Vec<_> = PeaksData::parse_many(csv, None, false, None).collect(); 44 | } 45 | } 46 | }); 47 | } 48 | -------------------------------------------------------------------------------- /fuzz/fuzz_targets/pro_forma.rs: -------------------------------------------------------------------------------- 1 | //! Fuzz target for parsing ProForma sequences 2 | use afl::*; 3 | 4 | fn main() { 5 | fuzz!(|data: &[u8]| { 6 | if let Ok(s) = std::str::from_utf8(data) { 7 | let _unused = rustyms::sequence::CompoundPeptidoformIon::pro_forma(s, None); 8 | } 9 | }); 10 | } 11 | -------------------------------------------------------------------------------- /fuzz/fuzz_targets/sloppy_pro_forma.rs: -------------------------------------------------------------------------------- 1 | //! Fuzz target for parsing general peptide sequences aka 'sloppy ProForma' 2 | use afl::*; 3 | 4 | fn main() { 5 | fuzz!(|data: &[u8]| { 6 | if let Ok(s) = std::str::from_utf8(data) { 7 | let _unused = rustyms::sequence::Peptidoform::sloppy_pro_forma( 8 | s, 9 | 0..s.len(), 10 | None, 11 | &rustyms::sequence::SloppyParsingParameters::default(), 12 | ); 13 | } 14 | }); 15 | } 16 | -------------------------------------------------------------------------------- /fuzz/in_peaks/11.csv: -------------------------------------------------------------------------------- 1 | "Source File","Scan","Peptide","Tag length","ALC (%)","Length","m/z","z","RT","Area","Mass","ppm","PTM","local confidence (%)","mode",tag(>=0.0%),"Feature Id" 2 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",6514,YSSDEKVLGEDFSDTR,16,99.9,16,616.61450,3,35.1011,190625.72,1846.8220,-0.2,"",100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 98,HCD,YSSDEKVLGEDFSDTR,14223 3 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",6743,DLQMTQSPSSLSASVGDR,18,99.2,18,626.96686,3,36.1993,794748.8,1877.8789,-0.1,"",99 99 100 100 100 100 99 99 100 100 100 100 100 100 100 100 100 90,ETHCD,DLQMTQSPSSLSASVGDR,14572 4 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",5644,DLQM(+15.99)TQSPSSLSASVGDR,18,99.0,18,947.94415,2,30.1547,548587.2,1893.8738,0.0,"Oxidation (M)",97 96 100 100 100 100 100 100 100 100 100 100 100 100 100 95 97 97,HCD,DLQM(+15.99)TQSPSSLSASVGDR,22869 5 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",6616,EVNSQFFR,8,98.8,8,513.75372,2,35.6492,60834.707,1025.4930,-0.1,"",98 97 99 100 99 100 100 97,HCD,EVNSQFFR,10540 6 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",9428,TYTFDNGTFLLR,12,98.7,12,724.36444,2,51.1627,83370.51,1446.7144,0.0,"",99 99 100 100 100 99 97 98 99 99 99 96,HCD,TYTFDNGTFLLR,17359 7 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",7805,EVQLVESGGGLVQPGGSLR,19,98.6,19,628.00598,3,42.2104,298160.3,1880.9955,0.3,"",98 97 99 100 100 100 100 100 100 100 100 100 98 99 99 99 100 100 83,ETHCD,EVQLVESGGGLVQPGGSLR,14598 8 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",5945,VLGEDFSDTR,10,98.0,10,569.77283,2,31.8568,18040.87,1137.5302,0.8,"",100 100 99 99 99 96 95 98 98 95,HCD,VLGEDFSDTR,12617 9 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",9483,TYTFDDGTFLLR,12,98.0,12,724.85663,2,51.3811,43949.74,1447.6984,0.3,"",96 97 100 100 100 100 96 96 97 99 99 95,HCD,TYTFDDGTFLLR,17378 10 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",3737,SRSGGGGNGLGSGGSLR,17,97.9,17,492.58188,3,19.8131,29103.092,1474.7236,0.1,"",100 99 100 100 100 99 98 95 100 100 100 100 98 98 99 99 83,ETHCD,SRSGGGGNGLGSGGSLR,9583 11 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",4286,TSGVLPR,7,97.8,7,365.21625,2,22.6110,744909.94,728.4181,-0.2,"",100 100 100 100 100 100 85,ETHCD,TSGVLPR,1074 12 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",6256,QAPGKGLEWVAR,12,97.8,12,437.91058,3,33.6266,,1310.7095,0.3,"",94 98 99 100 100 100 100 100 100 100 100 82,ETHCD,QAPGKGLEWVAR,0 13 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",4163,HEYTHYLQGR,10,97.6,10,435.21124,3,22.1258,218619.0,1302.6105,1.1,"",100 100 100 100 100 100 100 100 100 78,ETHCD,HEYTHYLQGR,6395 14 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",3647,TKESLSHFR,9,97.6,9,368.86447,3,19.3037,9257.09,1103.5724,-0.7,"",94 96 100 100 100 100 100 100 89,ETHCD,TKESLSHFR,1361 15 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",11907,LTWFDEGTAEFFAGSTR,17,97.6,17,967.94916,2,64.9324,66995.53,1933.8846,-0.4,"",87 87 100 100 100 100 100 100 100 100 100 100 99 99 97 96 95,HCD,LTWFDEGTAEFFAGSTR,23416 16 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",4773,DTLM(+15.99)LSR,7,97.6,7,426.21838,2,25.4288,115568.0,850.4218,0.4,"Oxidation (M)",95 95 100 100 100 100 94,HCD,DTLM(+15.99)LSR,5808 17 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",5396,GRGDSVVYGLR,11,97.6,11,393.54752,3,28.9093,54173.0,1177.6204,0.3,"",96 98 99 100 100 100 100 100 100 100 80,ETHCD,GRGDSVVYGLR,3284 18 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",8485,DSTYSLSSTLTSRR,14,97.5,14,787.40173,2,45.8671,242945.9,1572.7744,9.3,"",100 100 100 100 100 100 100 100 99 100 100 100 100 67,ETHCD,DSTYSLSSTLTSRR,19182 19 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",3880,ADSVFKGR,8,97.5,8,440.23810,2,20.6071,27530.41,878.4610,0.7,"",96 99 100 100 99 98 95 93,HCD,ADSVFKGR,6714 20 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",4217,HEYTHYLQAR,10,97.5,10,439.88297,3,22.4412,1841098.6,1316.6262,0.7,"",94 97 99 100 100 100 100 100 100 84,ETHCD,HEYTHYLQAR,6678 -------------------------------------------------------------------------------- /fuzz/in_peaks/11_custom.csv: -------------------------------------------------------------------------------- 1 | "Source File","Scan","Peptide","Tag length","ALC (%)","Length","m/z","z","RT","Area","Mass","ppm","PTM","local confidence (%)","mode",tag(>=0.0%),"Feature Id" 2 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",6514,YSSDEKVLGEDFSDTR,16,99.9,16,616.61450,3,35.1011,190625.72,1846.8220,-0.2,"",100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 98,HCD,YSSDEKVLGEDFSDTR,14223 3 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",6743,DLQMTQSPSSLSASVGDR,18,99.2,18,626.96686,3,36.1993,794748.8,1877.8789,-0.1,"",99 99 100 100 100 100 99 99 100 100 100 100 100 100 100 100 100 90,ETHCD,DLQMTQSPSSLSASVGDR,14572 4 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",5644,DLQM[C:Oxidation]TQSPSSLSASVGDR,18,99.0,18,947.94415,2,30.1547,548587.2,1893.8738,0.0,"Oxidation (M)",97 96 100 100 100 100 100 100 100 100 100 100 100 100 100 95 97 97,HCD,DLQM(+15.99)TQSPSSLSASVGDR,22869 5 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",6616,EVNSQFFR,8,98.8,8,513.75372,2,35.6492,60834.707,1025.4930,-0.1,"",98 97 99 100 99 100 100 97,HCD,EVNSQFFR,10540 6 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",9428,TYTFDNGTFLLR,12,98.7,12,724.36444,2,51.1627,83370.51,1446.7144,0.0,"",99 99 100 100 100 99 97 98 99 99 99 96,HCD,TYTFDNGTFLLR,17359 7 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",7805,EVQLVESGGGLVQPGGSLR,19,98.6,19,628.00598,3,42.2104,298160.3,1880.9955,0.3,"",98 97 99 100 100 100 100 100 100 100 100 100 98 99 99 99 100 100 83,ETHCD,EVQLVESGGGLVQPGGSLR,14598 8 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",5945,VLGEDFSDTR,10,98.0,10,569.77283,2,31.8568,18040.87,1137.5302,0.8,"",100 100 99 99 99 96 95 98 98 95,HCD,VLGEDFSDTR,12617 9 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",9483,TYTFDDGTFLLR,12,98.0,12,724.85663,2,51.3811,43949.74,1447.6984,0.3,"",96 97 100 100 100 100 96 96 97 99 99 95,HCD,TYTFDDGTFLLR,17378 10 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",3737,SRSGGGGNGLGSGGSLR,17,97.9,17,492.58188,3,19.8131,29103.092,1474.7236,0.1,"",100 99 100 100 100 99 98 95 100 100 100 100 98 98 99 99 83,ETHCD,SRSGGGGNGLGSGGSLR,9583 11 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",4286,TSGVLPR,7,97.8,7,365.21625,2,22.6110,744909.94,728.4181,-0.2,"",100 100 100 100 100 100 85,ETHCD,TSGVLPR,1074 12 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",6256,QAPGKGLEWVAR,12,97.8,12,437.91058,3,33.6266,,1310.7095,0.3,"",94 98 99 100 100 100 100 100 100 100 100 82,ETHCD,QAPGKGLEWVAR,0 13 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",4163,HEYTHYLQGR,10,97.6,10,435.21124,3,22.1258,218619.0,1302.6105,1.1,"",100 100 100 100 100 100 100 100 100 78,ETHCD,HEYTHYLQGR,6395 14 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",3647,TKESLSHFR,9,97.6,9,368.86447,3,19.3037,9257.09,1103.5724,-0.7,"",94 96 100 100 100 100 100 100 89,ETHCD,TKESLSHFR,1361 15 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",11907,LTWFDEGTAEFFAGSTR,17,97.6,17,967.94916,2,64.9324,66995.53,1933.8846,-0.4,"",87 87 100 100 100 100 100 100 100 100 100 100 99 99 97 96 95,HCD,LTWFDEGTAEFFAGSTR,23416 16 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",4773,DTLM[C:Oxidation]LSR,7,97.6,7,426.21838,2,25.4288,115568.0,850.4218,0.4,"Oxidation (M)",95 95 100 100 100 100 94,HCD,DTLM(+15.99)LSR,5808 17 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",5396,GRGDSVVYGLR,11,97.6,11,393.54752,3,28.9093,54173.0,1177.6204,0.3,"",96 98 99 100 100 100 100 100 100 100 80,ETHCD,GRGDSVVYGLR,3284 18 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",8485,DSTYSLSSTLTSRR,14,97.5,14,787.40173,2,45.8671,242945.9,1572.7744,9.3,"",100 100 100 100 100 100 100 100 99 100 100 100 100 67,ETHCD,DSTYSLSSTLTSRR,19182 19 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",3880,ADSVFKGR,8,97.5,8,440.23810,2,20.6071,27530.41,878.4610,0.7,"",96 99 100 100 99 98 95 93,HCD,ADSVFKGR,6714 20 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",4217,HEYTHYLQAR,10,97.5,10,439.88297,3,22.4412,1841098.6,1316.6262,0.7,"",94 97 99 100 100 100 100 100 100 84,ETHCD,HEYTHYLQAR,6678 -------------------------------------------------------------------------------- /fuzz/in_peaks/ab.csv: -------------------------------------------------------------------------------- 1 | Scan,Peptide,Tag Length,ALC (%),length,m/z,z,RT,Area,Mass,ppm,Accession,PTM,local confidence (%),tag (>=0%),mode 2 | F2:10351,MHQN(+.98)WLWL,8,98,8,564.7653,2,23.75,5.73E7,1127.5222,-5.5,,Deamidation (NQ),96 98 98 99 99 100 99 99,MHQN(+.98)WLWL,CID 3 | F3:3063,M(+15.99)PHNHHTE,8,98,8,509.7123,2,10.99,4.42E6,1017.4087,1.4,,Oxidation (M),98 98 98 98 99 100 100 96,M(+15.99)PHNHHTE,CID 4 | F3:3534,M(+15.99)PHNHHTE,8,98,8,509.7128,2,11.79,1.82E6,1017.4087,2.4,,Oxidation (M),98 99 99 98 99 99 100 95,M(+15.99)PHNHHTE,CID 5 | F3:2117,HNHHTE,6,97,6,387.6678,2,8.52,2.03E6,773.3205,0.8,,,97 96 98 99 99 96,HNHHTE,CID 6 | F2:13745,STMHWV,6,97,6,380.6751,2,30.62,2.73E6,759.3374,-2.2,,,98 99 95 95 99 99,STMHWV,CID 7 | F1:20191,LFLN(+.98)ESHLTHAF,12,97,12,715.3615,2,37.09,4.4E6,1428.7036,3.3,,Deamidation (NQ),85 97 99 98 98 94 98 99 99 99 100 99,LFLN(+.98)ESHLTHAF,CID 8 | F3:14603,APNTFTCSVLHE,12,97,12,659.8101,2,38.73,9.59E7,1317.6023,2.5,constructed_protein_Heavy,,96 96 98 99 100 99 96 95 96 99 98 94,APNTFTCSVLHE,CID 9 | F3:15521,FTLNLHPVEEE,11,97,11,664.3321,2,41.05,2.65E6,1326.6455,3.1,,,99 99 99 97 99 99 90 92 99 100 94,FTLNLHPVEEE,CID 10 | F4:8195,SNNYATHYAENK(+72.06),12,97,12,742.3466,2,18.77,6.26E7,1482.6792,-0.3,,Carboxymethyl1,83 94 98 99 99 99 98 99 99 100 97 99,SNNYATHYAENK(+72.06),CID 11 | F2:13141,WFVDLEEVHTA,11,97,11,673.3289,2,29.59,1.25E7,1344.6350,6.2,,,92 99 99 98 88 95 99 99 100 99 98,WFVDLEEVHTA,CID 12 | F3:2323,HN(+.98)HHTE,6,97,6,388.1600,2,9.21,4.17E4,774.3045,1.2,,Deamidation (NQ),97 97 99 99 99 91,HN(+.98)HHTE,CID 13 | F4:7286,ANN(+.98)HATYYAENK(+72.06),12,96,12,734.8412,2,17.49,7.73E6,1467.6682,-0.2,,Deamidation (NQ); Carboxymethyl1,82 94 99 99 100 99 99 99 99 100 95 96,ANN(+.98)HATYYAENK(+72.06),CID 14 | F2:7215,HYLHEV,6,96,6,399.1997,2,18.41,8.67E6,796.3868,-2.5,,,95 95 97 97 99 99,HYLHEV,CID 15 | F1:20356,YLDQTEQWQLY,11,96,11,743.8483,2,37.34,1.04E7,1485.6775,3.1,,,90 97 99 96 99 99 96 98 94 97 96,YLDQTEQWQLY,CID 16 | F3:14820,APNTFTCSVLHE,12,96,12,659.8107,2,39.24,6.09E6,1317.6023,3.5,constructed_protein_Heavy,,92 89 98 99 100 99 99 98 97 98 93 94,APNTFTCSVLHE,CID 17 | F4:9062,SDNYATHYAENK(+72.06),12,96,12,742.8393,2,20.43,5.92E7,1483.6631,0.6,,Carboxymethyl1,84 95 98 99 99 99 99 99 99 100 89 97,SDNYATHYAENK(+72.06),CID 18 | F4:6305,NHATYYAENK(+72.06),10,96,10,641.8087,2,16.22,2.99E6,1281.6040,-1.0,,Carboxymethyl1,85 96 99 99 99 98 98 100 94 94,NHATYYAENK(+72.06),CID 19 | F2:8831,VCAAVHGV,8,96,8,378.1942,2,21.04,3.21E6,754.3796,-7.5,,,84 92 98 99 99 100 99 99,VCAAVHGV,CID 20 | F4:3135,TPVSEHQK(+72.06),8,96,8,499.2701,2,10.87,3.28E7,996.5292,-3.5,,Carboxymethyl1,99 99 99 97 99 94 88 95,TPVSEHQK(+72.06),CID -------------------------------------------------------------------------------- /fuzz/in_peaks/x.csv: -------------------------------------------------------------------------------- 1 | Fraction,Source File,Feature,Peptide,Scan,Tag Length,ALC (%),length,m/z,z,RT,Area,Mass,ppm,PTM,local confidence (%),tag (>=0%),mode 2 | 1,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Tryp01.raw,F1:5056,LLYLVSK,F1:6994,7,99,7,418.2689,2,39.59,1.47E6,834.5215,2.2,,100 100 100 100 100 100 100,LLYLVSK,ETHCD 3 | 2,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Chym01.raw,-,MYYSKL,F2:6253,6,99,6,402.7029,2,35.37,,803.3887,3.2,,100 100 100 100 100 100,MYYSKL,ETHCD 4 | 4,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_LysN01.raw,F4:9634,KAAVFNHFLSDGVK,F4:6537,14,99,14,511.6133,3,36.67,2.16E6,1531.8147,2.2,,100 100 100 100 100 100 100 100 100 100 100 100 100 100,KAAVFNHFLSDGVK,ETHCD 5 | 6,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_TL01.raw,F6:4316,LLSDHRGATYA,F6:4340,11,99,11,401.8766,3,24.21,7.2E5,1202.6042,3.2,,100 100 100 100 100 100 100 100 100 100 100,LLSDHRGATYA,ETHCD 6 | 2,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Chym01.raw,F2:137,KLAKVF,F2:5266,6,99,6,353.2372,2,29.28,6.29E7,704.4584,2.1,,100 100 100 100 100 100,KLAKVF,ETHCD 7 | 6,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_TL01.raw,F6:8687,LLKYASQS,F6:4154,8,99,8,455.2574,2,23.10,5.71E5,908.4967,3.9,,100 100 100 100 100 100 100 100,LLKYASQS,ETHCD 8 | 2,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Chym01.raw,F2:137,KLAKVF,F2:5206,6,99,6,353.2372,2,29.28,6.29E7,704.4584,2.1,,100 100 100 100 100 100,KLAKVF,ETHCD 9 | 1,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Tryp01.raw,F1:412,FTLSRDDSK,F1:4190,9,99,9,356.8489,3,23.11,1.72E6,1067.5247,0.3,,100 100 100 100 100 100 100 100 100,FTLSRDDSK,ETHCD 10 | 2,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Chym01.raw,F2:6787,TLVGLVNY,F2:10516,8,99,8,439.7537,2,60.46,1.26E7,877.4909,2.3,,100 100 100 100 100 100 100 100,TLVGLVNY,ETHCD 11 | 6,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_TL01.raw,F6:16600,LTGTSTVGVGRGVLGDQKN,F6:5492,19,99,19,620.3372,3,31.03,2.2E7,1857.9907,-0.5,,100 100 99 99 100 100 100 100 100 100 100 100 100 100 100 100 99 100 100,LTGTSTVGVGRGVLGDQKN,ETHCD 12 | 1,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Tryp01.raw,F1:10850,SSTLTLTKDEYER,F1:5255,13,99,13,514.9270,3,29.45,5.87E5,1541.7573,1.2,,100 100 100 100 100 100 100 100 100 100 99 100 100,SSTLTLTKDEYER,ETHCD 13 | 6,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_TL01.raw,F6:12891,LRSSVHYSQGYNNA,F6:3949,14,99,14,532.5908,3,21.95,1.03E7,1594.7488,1.2,,99 99 100 100 100 100 100 100 100 100 100 100 100 100,LRSSVHYSQGYNNA,ETHCD 14 | 6,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_TL01.raw,F6:1122,LRVEKKNW(+15.99),F6:3772,8,99,8,363.5458,3,20.31,1.99E6,1087.6138,1.8,Oxidation (HW),100 99 100 100 100 100 100 100,LRVEKKNW(+15.99),ETHCD 15 | 5,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Ela01.raw,F5:11029,PYTFGGGTKLELKRA,F5:6127,15,99,15,546.6385,3,34.73,4.04E6,1636.8936,0.2,,99 99 100 100 100 100 100 100 100 100 100 100 100 100 100,PYTFGGGTKLELKRA,ETHCD 16 | 6,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_TL01.raw,F6:12937,VTYDYYKGG,F6:4919,9,99,9,533.2510,2,27.58,1.28E7,1064.4814,5.6,,99 99 100 100 100 100 100 100 100,VTYDYYKGG,ETHCD 17 | 4,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_LysN01.raw,F4:12679,KASGFTFTDFSLHMK(+58.01),F4:11257,15,99,15,592.2878,3,62.97,4.75E6,1773.8396,1.2,Carboxymethyl (KW X@N-term),99 100 100 100 100 100 100 100 100 100 100 100 100 100 100,KASGFTFTDFSLHMK(+58.01),ETHCD 18 | 6,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_TL01.raw,F6:15331,VFTEQADLSGLTETKK,F6:6459,16,99,16,589.6451,3,36.75,9.07E5,1765.9097,2.2,,100 100 100 100 99 100 100 100 100 100 100 100 100 100 100 100,VFTEQADLSGLTETKK,ETHCD 19 | 5,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Ela01.raw,F5:6860,TFGAGTKLELKRA,F5:5414,13,99,13,464.6069,3,30.47,2.49E6,1390.7932,4.0,,100 100 100 100 100 100 100 100 100 100 100 100 100,TFGAGTKLELKRA,ETHCD 20 | 2,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Chym01.raw,F2:7876,TLSRDDSKSSVY,F2:3962,12,99,12,453.2252,3,21.77,3.86E6,1356.6521,1.1,,100 100 100 100 100 100 100 100 100 99 100 100,TLSRDDSKSSVY,ETHCD -------------------------------------------------------------------------------- /fuzz/in_pro_forma/0: -------------------------------------------------------------------------------- 1 | [iTRAQ4plex]-EM[Oxidation]EVNES[Phospho]PEK[iTRAQ4plex]-[Methyl] -------------------------------------------------------------------------------- /fuzz/in_pro_forma/1: -------------------------------------------------------------------------------- 1 | SEQUEN[Formula:[13C2][12C-2]H2N]CE -------------------------------------------------------------------------------- /fuzz/in_pro_forma/10: -------------------------------------------------------------------------------- 1 | EVQLVESGGGLVQPGGSLRLSC[dehydro#xl1]AASGFNIKDTYIHWVRQAPGKGLEWVARIYPTNGYTRYADSVKGRFTISADTSKNTAYLQMNSLRAEDTAVYYC[#xl1]SRWGGDGFYAMDYWGQGTLVTVSSASTKGPSVFPLAPSSKSTSGGTAALGC[dehydro#xl2]LVKDYFPEPVTVSWNSGALTSGVHTFPAVLQSSGLYSLSSVVTVPSSSLGTQTYIC[#xl2]NVNHKPSNTKVDKKVEPKSC[C:Disulfide#XLChains]DK//DIQMTQSPSSLSASVGDRVTITC[Dehydro#xlLC1]RASQDVNTAVAWYQQKPGKAPKLLIYSASFLYSGVPSRFSGSRSGTDFTLTISSLQPEDFATYYC[#XLLC1]QQHYTTPPTFGQGTKVEIKRTVAAPSVFIFPPSDEQLKSGTASVVC[dehydro#xlLC2]LLNNFYPREAKVQWKVDNALQSGNSQESVTEQDSKDSTYSLSSTLTLSKADYEKHKVYAC[XLLC2]EVTHQGLSSPVTKSFNRGEC[#XLChains] -------------------------------------------------------------------------------- /fuzz/in_pro_forma/11: -------------------------------------------------------------------------------- 1 | ELVIS[Phospho|INFO:newly discovered|INFO:Created by software Tool1]K -------------------------------------------------------------------------------- /fuzz/in_pro_forma/12: -------------------------------------------------------------------------------- 1 | AA(?AA)AA -------------------------------------------------------------------------------- /fuzz/in_pro_forma/13: -------------------------------------------------------------------------------- 1 | [dehydro]^3?Q[gln->pyro-glu]SC -------------------------------------------------------------------------------- /fuzz/in_pro_forma/14: -------------------------------------------------------------------------------- 1 | MPGLVDSNPAPPESQEKKPLK(PCCACPETKKARDACIIEKGEEHCGHLIEAHKECMRALGFKI)[Oxidation]^2[half cystine][half cystine] -------------------------------------------------------------------------------- /fuzz/in_pro_forma/15: -------------------------------------------------------------------------------- 1 | {Glycan:Hex}[iTRAQ4plex]-EM[Oxidation]EVNES[Phospho]PEK[iTRAQ4plex]-[Methyl] -------------------------------------------------------------------------------- /fuzz/in_pro_forma/2: -------------------------------------------------------------------------------- 1 | SEK[XLMOD:02001#XL1]UENCE//EMEVTK[XLMOD:02001#XL1]SESPEK -------------------------------------------------------------------------------- /fuzz/in_pro_forma/3: -------------------------------------------------------------------------------- 1 | ELVIS[Phospho|INFO:newly discovered|INFO:really awesome]K -------------------------------------------------------------------------------- /fuzz/in_pro_forma/4: -------------------------------------------------------------------------------- 1 | <[TMT6plex]@K,N-term>ATPEILTCNSIGCLK -------------------------------------------------------------------------------- /fuzz/in_pro_forma/5: -------------------------------------------------------------------------------- 1 | EMK[XLMOD:02000#XL1]EVTKSE[XLMOD:02010#XL2]SK[#XL1]PEK[#XL2]AR -------------------------------------------------------------------------------- /fuzz/in_pro_forma/6: -------------------------------------------------------------------------------- 1 | EMEVEESPEK/3[+2Na+,+H+] -------------------------------------------------------------------------------- /fuzz/in_pro_forma/7: -------------------------------------------------------------------------------- 1 | MPGLVDSNPAPPESQEKKPLK(PCCACPETKKARDACIIEKGEEHCGHLIEAHKECMRALGFKI)[Oxidation]^2[half cystine][half cystine] -------------------------------------------------------------------------------- /fuzz/in_pro_forma/8: -------------------------------------------------------------------------------- 1 | [U:iTRAQ4plex]-EM[U:Oxidation]EVNES[U:Phospho]PEK[U:iTRAQ4plex]-[U:Methyl]/3 -------------------------------------------------------------------------------- /fuzz/in_pro_forma/9: -------------------------------------------------------------------------------- 1 | ELVIS[Phospho|O-phospho-L-serine|Obs:+79.966]K -------------------------------------------------------------------------------- /rustyms-generate-databases/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rustyms-generate-databases" 3 | version = "0.1.0" 4 | edition.workspace = true 5 | license.workspace = true 6 | authors.workspace = true 7 | publish = false 8 | 9 | [dependencies] 10 | bincode = { workspace = true } 11 | flate2 = { workspace = true } 12 | itertools = { workspace = true } 13 | ordered-float = { workspace = true } 14 | regex = { workspace = true } 15 | roxmltree = { workspace = true } 16 | thin-vec = { workspace = true } 17 | rustyms = { path = "../rustyms", features = ["internal-no-data"] } 18 | 19 | [features] 20 | rayon = [] 21 | 22 | [lints] 23 | workspace = true 24 | -------------------------------------------------------------------------------- /rustyms-generate-databases/src/main.rs: -------------------------------------------------------------------------------- 1 | //! Parse modification ontologies and generate the binary blobs for rustyms 2 | use std::path::Path; 3 | 4 | mod atomic_masses; 5 | mod gnome; 6 | mod obo; 7 | mod ontology_modification; 8 | mod psi_mod; 9 | mod resid; 10 | mod unimod; 11 | mod xlmod; 12 | 13 | use atomic_masses::*; 14 | use gnome::*; 15 | use ontology_modification::*; 16 | use psi_mod::*; 17 | use resid::*; 18 | use unimod::*; 19 | use xlmod::*; 20 | 21 | fn main() { 22 | let out_dir = Path::new("rustyms/src/databases"); 23 | build_atomic_masses(out_dir); 24 | build_gnome_ontology(out_dir); 25 | build_psi_mod_ontology(out_dir); 26 | build_resid_ontology(out_dir); 27 | build_unimod_ontology(out_dir); 28 | build_xlmod_ontology(out_dir); 29 | } 30 | -------------------------------------------------------------------------------- /rustyms-generate-imgt/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rustyms-generate-imgt" 3 | version = "0.1.0" 4 | edition.workspace = true 5 | license.workspace = true 6 | authors.workspace = true 7 | publish = false 8 | 9 | [dependencies] 10 | bincode = { workspace = true } 11 | itertools = { workspace = true } 12 | rustyms = { path = "../rustyms", default-features = false, features = [ 13 | "align", 14 | "imgt", 15 | "internal-no-data", 16 | ] } 17 | 18 | [features] 19 | rayon = [] 20 | 21 | [lints] 22 | workspace = true 23 | -------------------------------------------------------------------------------- /rustyms-py/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | ## Before you begin 4 | 5 | If you have an idea for a feature, use case to add or an approach for a bugfix, you are welcome to communicate it with the community by opening a thread in GitHub Discussions or in GitHub Issues. 6 | 7 | Not sure where to start? Check out the rustyms Rust code and see which parts are missing in the Python bindings. Also check out the open issues that carry the `good first issue` or `help wanted` labels. 8 | 9 | ## Development setup 10 | 11 | Both Rust and Python are required: 12 | 13 | - [Rust](https://rustup.rs/) 14 | - [Python](https://github.com/pyenv/pyenv?tab=readme-ov-file#getting-pyenv) 15 | 16 | Ideally, setup a virtual environment for Python: 17 | 18 | ```bash 19 | python -m venv .venv 20 | source .venv/bin/activate 21 | ``` 22 | 23 | PyO3 and Maturin are used to build the Rust extensions for Python. 24 | 25 | Clone the repository: 26 | 27 | ```bash 28 | git clone https://github.com/snijderlab/rustyms 29 | cd rustyms 30 | ``` 31 | 32 | Either install Maturin and use it to build and install the Python bindings (recommended): 33 | 34 | ```bash 35 | pip install maturin 36 | maturin develop -m ./rustyms-py/Cargo.toml 37 | ``` 38 | 39 | Or use pip: 40 | 41 | ```bash 42 | pip install --editable ./rustyms-py 43 | ``` 44 | 45 | ## Documentation 46 | 47 | The Python documentation is built with Sphinx and hosted on Read the Docs. To build the documentation locally, install the `docs` dependencies and run `sphinx-autobuild`: 48 | 49 | ```bash 50 | pip install -e ./rustyms-py[docs] 51 | sphinx-autobuild docs/python/source/ docs/python/_build 52 | ``` 53 | -------------------------------------------------------------------------------- /rustyms-py/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rustyms-py" 3 | authors.workspace = true 4 | edition.workspace = true 5 | license.workspace = true 6 | publish = false 7 | version.workspace = true 8 | 9 | [lib] 10 | name = "rustyms_py" 11 | crate-type = ["cdylib"] 12 | 13 | [dependencies] 14 | pyo3 = { workspace = true } 15 | rustyms = { path = "../rustyms" } 16 | ordered-float = { workspace = true } 17 | 18 | [lints] 19 | workspace = true 20 | -------------------------------------------------------------------------------- /rustyms-py/README.md: -------------------------------------------------------------------------------- 1 | # Python bindings to rustyms 2 | 3 | Python bindings to the [rustyms](https://docs.rs/rustyms/) library for proteomics 4 | and mass spectrometry. 5 | 6 | ## Full documentation 7 | 8 | The full documentation, including a quickstart guide and Python API reference is available on 9 | [rustyms.readthedocs.io](https://rustyms.readthedocs.io/). 10 | 11 | ## Contributing and development 12 | 13 | See `CONTRIBUTING.md` for information on the development setup and how to contribute to the rustyms 14 | Python bindings. 15 | -------------------------------------------------------------------------------- /rustyms-py/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["maturin>=1.4,<2.0"] 3 | build-backend = "maturin" 4 | 5 | [project] 6 | name = "rustyms" 7 | requires-python = ">=3.9,<3.14" 8 | classifiers = [ 9 | "Intended Audience :: Science/Research", 10 | "Programming Language :: Rust", 11 | "Programming Language :: Python :: 3 :: Only", 12 | "Programming Language :: Python :: Implementation :: CPython", 13 | "Topic :: Scientific/Engineering :: Bio-Informatics", 14 | ] 15 | dynamic = ["version"] 16 | description = "A library to handle proteomic mass spectrometry data and match peptides to spectra." 17 | license = { text = "MIT OR Apache-2.0" } 18 | 19 | [project.urls] 20 | Homepage = "https://github.com/snijderlab/rustyms" 21 | Documentation = "https://rustyms.readthedocs.io/" 22 | Repository = "https://github.com/snijderlab/rustyms.git" 23 | 24 | [project.optional-dependencies] 25 | dev = ["maturin"] 26 | docs = [ 27 | "sphinx", 28 | "numpydoc>=1,<2", 29 | "myst-parser", 30 | "sphinx_rtd_theme", 31 | "sphinx-autobuild", 32 | "sphinx-automodapi", 33 | ] 34 | 35 | [tool.maturin] 36 | features = ["pyo3/extension-module"] 37 | module-name = "rustyms" 38 | -------------------------------------------------------------------------------- /rustyms/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rustyms" 3 | authors.workspace = true 4 | edition.workspace = true 5 | license.workspace = true 6 | publish = true 7 | rust-version.workspace = true 8 | version.workspace = true 9 | description = "A library to handle proteomic mass spectrometry data and match peptides to spectra." 10 | categories = ["science::bioinformatics::proteomics"] 11 | keywords = ["spectra", "mass-spectrometry", "bio", "fragmentation", "proforma"] 12 | repository = "https://github.com/snijderlab/rustyms" 13 | readme = "README.md" 14 | include = ["src/**/*", "images/**/*", "README.md", "build.rs", "benches/**/*"] 15 | 16 | [dependencies] 17 | bincode = { workspace = true } 18 | flate2 = { workspace = true } 19 | itertools = { workspace = true } 20 | mzdata = { workspace = true, optional = true } 21 | ndarray = { workspace = true, optional = true } 22 | ordered-float = { workspace = true } 23 | probability = { workspace = true, optional = true } 24 | rand = { workspace = true, optional = true } 25 | rayon = { workspace = true, optional = true } 26 | regex = { workspace = true } 27 | serde = { workspace = true } 28 | similar = { workspace = true } 29 | swash = { workspace = true, optional = true } 30 | thin-vec = { workspace = true } 31 | uom = { workspace = true } 32 | zeno = { workspace = true, optional = true } 33 | 34 | [dev-dependencies] 35 | base64 = { workspace = true } 36 | iai-callgrind = { workspace = true } 37 | png = { workspace = true } 38 | serde_json = { workspace = true } 39 | directories = { workspace = true } 40 | 41 | [features] 42 | default = [ 43 | "imgt", 44 | "align", 45 | "identification", 46 | "rayon", 47 | "isotopes", 48 | "rand", 49 | "mzdata", 50 | "glycan-render", 51 | "glycan-render-bitmap", 52 | ] 53 | imgt = [] 54 | align = [] 55 | identification = [] 56 | isotopes = ["probability", "ndarray"] 57 | glycan-render = [] 58 | glycan-render-bitmap = ["zeno", "swash", "glycan-render"] 59 | internal-no-data = [] 60 | 61 | [[bench]] 62 | name = "iai" 63 | harness = false 64 | 65 | [lints] 66 | workspace = true 67 | -------------------------------------------------------------------------------- /rustyms/benches/iai.rs: -------------------------------------------------------------------------------- 1 | use std::hint::black_box; 2 | 3 | use rustyms::SimpleLinear; 4 | use rustyms::align::*; 5 | use rustyms::*; 6 | 7 | use iai_callgrind::{ 8 | LibraryBenchmarkConfig, Tool, ValgrindTool, library_benchmark, library_benchmark_group, main, 9 | }; 10 | 11 | #[inline(never)] 12 | fn setup(a: &str, b: &str) -> (Peptidoform, Peptidoform) { 13 | let _force_elements_init = black_box(AminoAcid::Alanine.formulas()); 14 | ( 15 | Peptidoform::pro_forma(a, None) 16 | .unwrap() 17 | .into_simple_linear() 18 | .unwrap(), 19 | Peptidoform::pro_forma(b, None) 20 | .unwrap() 21 | .into_simple_linear() 22 | .unwrap(), 23 | ) 24 | } 25 | 26 | #[inline(never)] 27 | fn setup_simple() -> (Peptidoform, Peptidoform) { 28 | setup("ANAGRS", "AGGQRS") 29 | } 30 | 31 | #[inline(never)] 32 | fn setup_igha() -> (Peptidoform, Peptidoform) { 33 | setup( 34 | "ASPTSPKVFPLSLDSTPQDGNVVVACLVQGFFPQEPLSVTWSESGQNVTARNFPPSQDASGDLYTTSSQLTLPATQCPDGKSVTCHVKHYTNSSQDVTVPCRVPPPPPCCHPRLSLHRPALEDLLLGSEANLTCTLTGLRDASGATFTWTPSSGKSAVQGPPERDLCGCYSVSSVLPGCAQPWNHGETFTCTAAHPELKTPLTANITKSGNTFRPEVHLLPPPSEELALNELVTLTCLARGFSPKDVLVRWLQGSQELPREKYLTWASRQEPSQGTTTYAVTSILRVAAEDWKKGETFSCMVGHEALPLAFTQKTIDRMAGSCCVADWQMPPPYVVLDLPQETLEEETPGANLWPTTITFLTLFLLSLFYSTALTVTSVRGPSGKREGPQY", 35 | "ASPTSPKVFPLSLCSTQPDGNVVIACLVQGFFPQEPLSVTWSESGQGVTARNFPPSQDASGDLYTTSSQLTLPATQCLAGKSVTCHVKHYTNPSQDVTVPCPVPSTPPTPSPSTPPTPSPSCCHPRLSLHRPALEDLLLGSEANLTCTLTGLRDASGVTFTWTPSSGKSAVQGPPERDLCGCYSVSSVLPGCAEPWNHGKTFTCTAAYPESKTPLTATLSKSGNTFRPEVHLLPPPSEELALNELVTLTCLARGFSPKDVLVRWLQGSQELPREKYLTWASRQEPSQGTTTFAVTSILRVAAEDWKKGDTFSCMVGHEALPLAFTQKTIDRLADWQMPPPYVVLDLPQETLEEETPGANLWPTTITFLTLFLLSLFYSTALTVTSVRGPSGNREGPQY", 36 | ) 37 | } 38 | 39 | #[library_benchmark] 40 | #[bench::simple_1(setup_simple())] 41 | #[bench::igha_1(setup_igha())] 42 | pub fn align_1(setup: (Peptidoform, Peptidoform)) { 43 | align::<1, SimpleLinear, SimpleLinear>( 44 | &setup.0, 45 | &setup.1, 46 | AlignScoring::default(), 47 | AlignType::GLOBAL, 48 | ); 49 | } 50 | 51 | #[library_benchmark] 52 | #[bench::simple_4(setup_simple())] 53 | #[bench::igha_4(setup_igha())] 54 | #[bench::ambiguous_not(setup("ANQRS", "ANQRS"))] 55 | #[bench::ambiguous_a(setup("ANZRS", "ANQRS"))] 56 | #[bench::ambiguous_b(setup("ANQRS", "ABQRS"))] 57 | #[bench::ambiguous_ab(setup("ANZRS", "ABQRS"))] 58 | // #[bench::igha_8(setup_igha(Some(8)))] 59 | pub fn align_4(setup: (Peptidoform, Peptidoform)) { 60 | align::<4, SimpleLinear, SimpleLinear>( 61 | &setup.0, 62 | &setup.1, 63 | AlignScoring::default(), 64 | AlignType::GLOBAL, 65 | ); 66 | } 67 | 68 | #[library_benchmark] 69 | #[bench::simple_unbounded(setup_simple())] 70 | // #[bench::igha_8(setup_igha(Some(8)))] 71 | pub fn align_unbounded(setup: (Peptidoform, Peptidoform)) { 72 | align::<{ u16::MAX }, SimpleLinear, SimpleLinear>( 73 | &setup.0, 74 | &setup.1, 75 | AlignScoring::default(), 76 | AlignType::GLOBAL, 77 | ); 78 | } 79 | 80 | library_benchmark_group!(name = alignment; benchmarks = align_1, align_4, align_unbounded); 81 | 82 | main!(config = LibraryBenchmarkConfig::default() 83 | .tool(Tool::new(ValgrindTool::DHAT)).tool(Tool::new(ValgrindTool::Massif)); library_benchmark_groups = alignment); 84 | -------------------------------------------------------------------------------- /rustyms/data/200305_HER_test_04_DENOVO.csv.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/data/200305_HER_test_04_DENOVO.csv.gz -------------------------------------------------------------------------------- /rustyms/data/chimeric_example.mgf: -------------------------------------------------------------------------------- 1 | BEGIN IONS 2 | TITLE=Chimeric Example 3 | SCANS=0 4 | SEQUENCE=VAEINPSNGGTT+FNEKFKGGKATJ 5 | 6 | 100.075690 100 7 | 171.112804 100 8 | 300.155397 100 9 | 413.239461 100 10 | 527.282389 100 11 | 624.335153 100 12 | 711.367181 100 13 | 825.410109 100 14 | 882.431572 100 15 | 939.453036 100 16 | 1040.500715 100 17 | 1060.490544 100 18 | 989.453430 100 19 | 860.410837 100 20 | 747.326773 100 21 | 633.283845 100 22 | 536.231082 100 23 | 449.199053 100 24 | 335.156126 100 25 | 278.134662 100 26 | 221.113198 100 27 | 120.065520 100 28 | 1159.558958 100 29 | 30 | 148.075690 200 31 | 262.118618 200 32 | 391.161211 200 33 | 519.256174 200 34 | 666.324588 200 35 | 794.419551 200 36 | 851.441015 200 37 | 908.462479 200 38 | 1036.557442 200 39 | 1107.594555 200 40 | 1208.642234 200 41 | 1192.668449 200 42 | 1078.625521 200 43 | 949.582928 200 44 | 821.487965 200 45 | 674.419551 200 46 | 546.324588 200 47 | 489.303124 200 48 | 432.281661 200 49 | 304.186697 200 50 | 233.149584 200 51 | 132.101905 200 52 | 1339.736863 200 53 | 54 | END IONS -------------------------------------------------------------------------------- /rustyms/data/example.mgf: -------------------------------------------------------------------------------- 1 | BEGIN IONS 2 | PEPMASS=413.26611887841 3 | CHARGE=1+ 4 | TITLE=MS/MS scan at 1.535 min with Intensity: 604.0 5 | 6 | 189.48956 5050.0 7 | 283.62076 5050.0 8 | 301.22977 5050.0 9 | 311.08008 5050.0 10 | 399.99106 5050.0 11 | 12 | END IONS -------------------------------------------------------------------------------- /rustyms/data/glycan.mgf: -------------------------------------------------------------------------------- 1 | BEGIN IONS 2 | PEPMASS=660.2457879192369 3 | CHARGE=1+ 4 | TITLE=MS/MS scan at 1.535 min with Intensity: 604.0 5 | SEQUENCE=N[G:G01141WK] 6 | 7 | 189.48956 5050.0 8 | 283.62076 5050.0 9 | 301.22977 5050.0 10 | 311.08008 5050.0 11 | 399.99106 5050.0 12 | 366.1394723824929 7000 13 | 186.07608428415693 7000 14 | 325.1129232825489 7000 15 | 660.2457879192369 7000 16 | 145.04953518421294 7000 17 | 115.05020389039694 7000 18 | 19 | END IONS -------------------------------------------------------------------------------- /rustyms/data/intra_link.mgf: -------------------------------------------------------------------------------- 1 | BEGIN IONS 2 | TITLE=20240311_EX1_UM3_Perez044_SA_EXT00_MitoDSSO_WT3_F18.10043.10043.2.0 3 | SEQUENCE=K[Formula:C6O5H2N-2S1#XL1]GK[#XL1]FLK 4 | CHARGE=2+ 5 | 878.472 2 6 | 202.05 1.16091e+06 7 | 203.053 125220 8 | 207.948 59294.2 9 | 209.091 121486 10 | 211.119 126944 11 | 224.114 58880.7 12 | 226.119 473398 13 | 227.102 109812 14 | 233.164 118395 15 | 244.129 208709 16 | 245.113 97107.3 17 | 250.119 155704 18 | 252.108 367429 19 | 260.196 227824 20 | 262.139 917949 21 | 263.143 153018 22 | 265.108 301083 23 | 266.111 88532.9 24 | 267.122 65390 25 | 276.101 198422 26 | 278.113 181147 27 | 279.097 72900.4 28 | 293.102 441981 29 | 295.118 267770 30 | 296.148 484494 31 | 296.648 85533 32 | 311.113 1.81167e+06 33 | 312.116 258102 34 | 338.123 81486.6 35 | 338.656 337847 36 | 339.108 1.37933e+06 37 | 340.111 228673 38 | 340.136 92096 39 | 341.115 70401.5 40 | 346.653 97632.1 41 | 352.689 81316.3 42 | 356.135 281606 43 | 357.644 177961 44 | 393.139 90809.7 45 | 395.71 68464.2 46 | 397.16 99908.8 47 | 400.23 84130.5 48 | 404.221 73111.1 49 | 407.265 396427 50 | 408.268 107841 51 | 413.156 65250.2 52 | 416.175 155425 53 | 416.67 91690.1 54 | 421.166 149284 55 | 421.661 110033 56 | 422.164 174209 57 | 425.156 168631 58 | 425.205 439647 59 | 426.201 94672.8 60 | 430.171 1.29507e+06 61 | 430.659 869088 62 | 431.169 320975 63 | 431.187 264357 64 | 431.228 135281 65 | 431.681 182382 66 | 435.14 194014 67 | 439.177 1.28265e+07 68 | 439.68 5.02722e+06 69 | 439.739 1.82224e+07 70 | 440.181 1.35618e+06 71 | 440.241 8.46633e+06 72 | 440.742 255064 73 | 453.151 1.30979e+06 74 | 454.155 175931 75 | 472.214 2.32282e+06 76 | 473.218 356952 77 | 484.288 146217 78 | 512.184 68077.9 79 | 522.219 270120 80 | 523.219 72197.4 81 | 530.198 194330 82 | 539.245 1.35029e+06 83 | 540.247 242144 84 | 541.167 70871.7 85 | 548.7 68101.1 86 | 565.229 80803.3 87 | 569.784 99909.9 88 | 570.217 81840.6 89 | 570.271 169138 90 | 570.771 122208 91 | 588.219 200902 92 | 591.288 156371 93 | 597.975 63168.4 94 | 599.185 78568.7 95 | 616.214 369413 96 | 617.211 118485 97 | 619.282 3.18988e+06 98 | 620.285 991880 99 | 658.293 91317.9 100 | 659.279 218912 101 | 676.303 1.02343e+06 102 | 677.307 331826 103 | 684.341 86303.3 104 | 687.271 116493 105 | 696.206 75754.6 106 | 704.37 1.08837e+06 107 | 705.374 392347 108 | 713.23 195830 109 | 714.219 261267 110 | 715.22 82416.6 111 | 731.239 1.02319e+06 112 | 732.243 483977 113 | 732.365 2.35307e+06 114 | 733.239 131855 115 | 733.37 791050 116 | 749.254 413880 117 | 749.393 155605 118 | 750.26 101576 119 | 750.38 115159 120 | 1005.9 71084.9 121 | 1233.59 73247.3 122 | 1415.61 76185.3 123 | 1944.61 78387 124 | END IONS -------------------------------------------------------------------------------- /rustyms/src/align/bad_alignments.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::missing_panics_doc)] 2 | 3 | use crate::{ 4 | align::{AlignScoring, AlignType, align}, 5 | sequence::{Peptidoform, SimpleLinear}, 6 | }; 7 | 8 | #[test] 9 | fn overextended_rotation() { 10 | test_alignment("IVQEVS", "LEVQVES", "1i1I2=2r1="); 11 | } 12 | 13 | fn test_alignment(peptide_one: &str, peptide_two: &str, path: &str) { 14 | let first_peptide = Peptidoform::pro_forma(peptide_one, None) 15 | .unwrap() 16 | .into_simple_linear() 17 | .unwrap(); 18 | let second_peptide = Peptidoform::pro_forma(peptide_two, None) 19 | .unwrap() 20 | .into_simple_linear() 21 | .unwrap(); 22 | let alignment = align::<4, SimpleLinear, SimpleLinear>( 23 | &first_peptide, 24 | &second_peptide, 25 | AlignScoring::default(), 26 | AlignType::GLOBAL, 27 | ); 28 | assert_eq!( 29 | alignment.short(), 30 | path, 31 | "Alignment of {peptide_one} vs {peptide_two} did not go to plan" 32 | ); 33 | } 34 | -------------------------------------------------------------------------------- /rustyms/src/align/matrices/blosum45.txt: -------------------------------------------------------------------------------- 1 | &[ 2 | [5,-2,-1,-2,-1,-1,-1,0,-2,-1,-1,-1,-1,-2,-1,1,0,-2,-2,0,-1,-1,-1,-2,-1,-1], 3 | [-2,7,0,-1,-3,1,0,-2,0,-3,-2,3,-1,-2,-2,-1,-1,-2,-1,-2,-1,-3,1,-1,0,-1], 4 | [-1,0,6,2,-2,0,0,0,1,-2,-3,0,-2,-2,-2,1,0,-4,-2,-3,5,-3,0,3,0,-1], 5 | [-2,-1,2,7,-3,0,2,-1,0,-4,-3,0,-3,-4,-1,0,-1,-4,-2,-3,6,-3,1,4,1,-1], 6 | [-1,-3,-2,-3,12,-3,-3,-3,-3,-3,-2,-3,-2,-2,-4,-1,-1,-5,-3,-1,-2,-2,-3,-3,-3,-1], 7 | [-1,1,0,0,-3,6,2,-2,1,-2,-2,1,0,-4,-1,0,-1,-2,-1,-3,0,-2,4,0,3,-1], 8 | [-1,0,0,2,-3,2,6,-2,0,-3,-2,1,-2,-3,0,0,-1,-3,-2,-3,1,-3,5,1,4,-1], 9 | [0,-2,0,-1,-3,-2,-2,7,-2,-4,-3,-2,-2,-3,-2,0,-2,-2,-3,-3,-1,-4,-2,-1,-2,-1], 10 | [-2,0,1,0,-3,1,0,-2,10,-3,-2,-1,0,-2,-2,-1,-2,-3,2,-3,0,-2,0,0,0,-1], 11 | [-1,-3,-2,-4,-3,-2,-3,-4,-3,5,2,-3,2,0,-2,-2,-1,-2,0,3,-3,4,-3,-3,-3,-1], 12 | [-1,-2,-3,-3,-2,-2,-2,-3,-2,2,5,-3,2,1,-3,-3,-1,-2,0,1,-3,4,-2,-4,-3,-1], 13 | [-1,3,0,0,-3,1,1,-2,-1,-3,-3,5,-1,-3,-1,-1,-1,-2,-1,-2,0,-3,1,0,1,-1], 14 | [-1,-1,-2,-3,-2,0,-2,-2,0,2,2,-1,6,0,-2,-2,-1,-2,0,1,-2,2,-1,-3,-1,-1], 15 | [-2,-2,-2,-4,-2,-4,-3,-3,-2,0,1,-3,0,8,-3,-2,-1,1,3,0,-3,1,-3,-3,-3,-1], 16 | [-1,-2,-2,-1,-4,-1,0,-2,-2,-2,-3,-1,-2,-3,9,-1,-1,-3,-3,-3,-2,-3,-1,-2,-1,-1], 17 | [1,-1,1,0,-1,0,0,0,-1,-2,-3,-1,-2,-2,-1,4,2,-4,-2,-1,0,-2,0,0,0,-1], 18 | [0,-1,0,-1,-1,-1,-1,-2,-2,-1,-1,-1,-1,-1,-1,2,5,-3,-1,0,0,-1,-1,-1,-1,-1], 19 | [-2,-2,-4,-4,-5,-2,-3,-2,-3,-2,-2,-2,-2,1,-3,-4,-3,15,3,-3,-4,-2,-2,-4,-3,-1], 20 | [-2,-1,-2,-2,-3,-1,-2,-3,2,0,0,-1,0,3,-3,-2,-1,3,8,-1,-2,0,-2,-3,-2,-1], 21 | [0,-2,-3,-3,-1,-3,-3,-3,-3,3,1,-2,1,0,-3,-1,0,-3,-1,5,-3,2,-3,-3,-2,-1], 22 | [-1,-1,5,6,-2,0,1,-1,0,-3,-3,0,-2,-3,-2,0,0,-4,-2,-3,5,-3,1,3,0,-1], 23 | [-1,-3,-3,-3,-2,-2,-3,-4,-2,4,4,-3,2,1,-3,-2,-1,-2,0,2,-3,4,-2,-3,-3,-1], 24 | [-1,1,0,1,-3,4,5,-2,0,-3,-2,1,-1,-3,-1,0,-1,-2,-2,-3,1,-2,5,0,3,-1], 25 | [-2,-1,3,4,-3,0,1,-1,0,-3,-4,0,-3,-3,-2,0,-1,-4,-3,-3,3,-3,0,4,1,-1], 26 | [-1,0,0,1,-3,3,4,-2,0,-3,-3,1,-1,-3,-1,0,-1,-3,-2,-2,0,-3,3,1,4,-1], 27 | [-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1], 28 | ] -------------------------------------------------------------------------------- /rustyms/src/align/matrices/blosum50.txt: -------------------------------------------------------------------------------- 1 | &[ 2 | [5,-2,-1,-2,-1,-1,-1,0,-2,-1,-2,-1,-1,-3,-1,1,0,-3,-2,0,-2,-2,-1,-2,-1,-1], 3 | [-2,7,-1,-2,-4,1,0,-3,0,-4,-3,3,-2,-3,-3,-1,-1,-3,-1,-3,-1,-3,0,-1,0,-1], 4 | [-1,-1,7,2,-2,0,0,0,1,-3,-4,0,-2,-4,-2,1,0,-4,-2,-3,5,-4,0,3,0,-1], 5 | [-2,-2,2,8,-4,0,2,-1,-1,-4,-4,-1,-4,-5,-1,0,-1,-5,-3,-4,6,-4,1,4,1,-1], 6 | [-1,-4,-2,-4,13,-3,-3,-3,-3,-2,-2,-3,-2,-2,-4,-1,-1,-5,-3,-1,-3,-2,-3,-3,-3,-1], 7 | [-1,1,0,0,-3,7,2,-2,1,-3,-2,2,0,-4,-1,0,-1,-1,-1,-3,0,-3,4,0,3,-1], 8 | [-1,0,0,2,-3,2,6,-3,0,-4,-3,1,-2,-3,-1,-1,-1,-3,-2,-3,1,-3,5,1,4,-1], 9 | [0,-3,0,-1,-3,-2,-3,8,-2,-4,-4,-2,-3,-4,-2,0,-2,-3,-3,-4,-1,-4,-2,-1,-2,-1], 10 | [-2,0,1,-1,-3,1,0,-2,10,-4,-3,0,-1,-1,-2,-1,-2,-3,2,-4,0,-3,0,0,0,-1], 11 | [-1,-4,-3,-4,-2,-3,-4,-4,-4,5,2,-3,2,0,-3,-3,-1,-3,-1,4,-4,4,-3,-3,-3,-1], 12 | [-2,-3,-4,-4,-2,-2,-3,-4,-3,2,5,-3,3,1,-4,-3,-1,-2,-1,1,-4,4,-3,-4,-3,-1], 13 | [-1,3,0,-1,-3,2,1,-2,0,-3,-3,6,-2,-4,-1,0,-1,-3,-2,-3,0,-3,1,0,1,-1], 14 | [-1,-2,-2,-4,-2,0,-2,-3,-1,2,3,-2,7,0,-3,-2,-1,-1,0,1,-3,2,-1,-3,-1,-1], 15 | [-3,-3,-4,-5,-2,-4,-3,-4,-1,0,1,-4,0,8,-4,-3,-2,1,4,-1,-4,1,-4,-3,-3,-1], 16 | [-1,-3,-2,-1,-4,-1,-1,-2,-2,-3,-4,-1,-3,-4,10,-1,-1,-4,-3,-3,-2,-3,-1,-2,-1,-1], 17 | [1,-1,1,0,-1,0,-1,0,-1,-3,-3,0,-2,-3,-1,5,2,-4,-2,-2,0,-3,0,0,0,-1], 18 | [0,-1,0,-1,-1,-1,-1,-2,-2,-1,-1,-1,-1,-2,-1,2,5,-3,-2,0,0,-1,-1,-1,-1,-1], 19 | [-3,-3,-4,-5,-5,-1,-3,-3,-3,-3,-2,-3,-1,1,-4,-4,-3,15,2,-3,-5,-2,-2,-4,-3,-1], 20 | [-2,-1,-2,-3,-3,-1,-2,-3,2,-1,-1,-2,0,4,-3,-2,-2,2,8,-1,-3,-1,-2,-3,-2,-1], 21 | [0,-3,-3,-4,-1,-3,-3,-4,-4,4,1,-3,1,-1,-3,-2,0,-3,-1,5,-3,2,-3,-3,-2,-1], 22 | [-2,-1,5,6,-3,0,1,-1,0,-4,-4,0,-3,-4,-2,0,0,-5,-3,-3,6,-4,1,3,0,-1], 23 | [-2,-3,-4,-4,-2,-3,-3,-4,-3,4,4,-3,2,1,-3,-3,-1,-2,-1,2,-4,4,-3,-3,-3,-1], 24 | [-1,0,0,1,-3,4,5,-2,0,-3,-3,1,-1,-4,-1,0,-1,-2,-2,-3,1,-3,5,0,3,-1], 25 | [-2,-1,3,4,-3,0,1,-1,0,-3,-4,0,-3,-3,-2,0,-1,-4,-3,-3,3,-3,0,4,1,-1], 26 | [-1,0,0,1,-3,3,4,-2,0,-3,-3,1,-1,-3,-1,0,-1,-3,-2,-2,0,-3,3,1,4,-1], 27 | [-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1], 28 | ] -------------------------------------------------------------------------------- /rustyms/src/align/matrices/blosum62.txt: -------------------------------------------------------------------------------- 1 | &[ 2 | [4,-1,-2,-2,0,-1,-1,0,-2,-1,-1,-1,-1,-2,-1,1,0,-3,-2,0,-2,-1,-1,-2,-1,-1], 3 | [-1,5,0,-2,-3,1,0,-2,0,-3,-2,2,-1,-3,-2,-1,-1,-3,-2,-3,-1,-2,0,-1,0,-1], 4 | [-2,0,6,1,-3,0,0,0,1,-3,-3,0,-2,-3,-2,1,0,-4,-2,-3,4,-3,0,3,0,-1], 5 | [-2,-2,1,6,-3,0,2,-1,-1,-3,-4,-1,-3,-3,-1,0,-1,-4,-3,-3,4,-3,1,4,1,-1], 6 | [0,-3,-3,-3,9,-3,-4,-3,-3,-1,-1,-3,-1,-2,-3,-1,-1,-2,-2,-1,-3,-1,-3,-3,-3,-1], 7 | [-1,1,0,0,-3,5,2,-2,0,-3,-2,1,0,-3,-1,0,-1,-2,-1,-2,0,-2,4,0,3,-1], 8 | [-1,0,0,2,-4,2,5,-2,0,-3,-3,1,-2,-3,-1,0,-1,-3,-2,-2,1,-3,4,1,4,-1], 9 | [0,-2,0,-1,-3,-2,-2,6,-2,-4,-4,-2,-3,-3,-2,0,-2,-2,-3,-3,-1,-4,-2,-1,-2,-1], 10 | [-2,0,1,-1,-3,0,0,-2,8,-3,-3,-1,-2,-1,-2,-1,-2,-2,2,-3,0,-3,0,0,0,-1], 11 | [-1,-3,-3,-3,-1,-3,-3,-4,-3,4,2,-3,1,0,-3,-2,-1,-3,-1,3,-3,3,-3,-3,-3,-1], 12 | [-1,-2,-3,-4,-1,-2,-3,-4,-3,2,4,-2,2,0,-3,-2,-1,-2,-1,1,-4,3,-3,-4,-3,-1], 13 | [-1,2,0,-1,-3,1,1,-2,-1,-3,-2,5,-1,-3,-1,0,-1,-3,-2,-2,0,-3,1,0,1,-1], 14 | [-1,-1,-2,-3,-1,0,-2,-3,-2,1,2,-1,5,0,-2,-1,-1,-1,-1,1,-3,2,-1,-3,-1,-1], 15 | [-2,-3,-3,-3,-2,-3,-3,-3,-1,0,0,-3,0,6,-4,-2,-2,1,3,-1,-3,0,-3,-3,-3,-1], 16 | [-1,-2,-2,-1,-3,-1,-1,-2,-2,-3,-3,-1,-2,-4,7,-1,-1,-4,-3,-2,-2,-3,-1,-2,-1,-1], 17 | [1,-1,1,0,-1,0,0,0,-1,-2,-2,0,-1,-2,-1,4,1,-3,-2,-2,0,-2,0,0,0,-1], 18 | [0,-1,0,-1,-1,-1,-1,-2,-2,-1,-1,-1,-1,-2,-1,1,5,-2,-2,0,-1,-1,-1,-1,-1,-1], 19 | [-3,-3,-4,-4,-2,-2,-3,-2,-2,-3,-2,-3,-1,1,-4,-3,-2,11,2,-3,-4,-2,-2,-4,-3,-1], 20 | [-2,-2,-2,-3,-2,-1,-2,-3,2,-1,-1,-2,-1,3,-3,-2,-2,2,7,-1,-3,-1,-2,-3,-2,-1], 21 | [0,-3,-3,-3,-1,-2,-2,-3,-3,3,1,-2,1,-1,-2,-2,0,-3,-1,4,-3,2,-2,-3,-2,-1], 22 | [-2,-1,4,4,-3,0,1,-1,0,-3,-4,0,-3,-3,-2,0,-1,-4,-3,-3,4,-3,0,3,0,-1], 23 | [-1,-2,-3,-3,-1,-2,-3,-4,-3,3,3,-3,2,0,-3,-2,-1,-2,-1,2,-3,3,-3,-3,-3,-1], 24 | [-1,0,0,1,-3,4,4,-2,0,-3,-3,1,-1,-3,-1,0,-1,-2,-2,-2,0,-3,4,0,3,-1], 25 | [-2,-1,3,4,-3,0,1,-1,0,-3,-4,0,-3,-3,-2,0,-1,-4,-3,-3,3,-3,0,4,1,-1], 26 | [-1,0,0,1,-3,3,4,-2,0,-3,-3,1,-1,-3,-1,0,-1,-3,-2,-2,0,-3,3,1,4,-1], 27 | [-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1], 28 | ] -------------------------------------------------------------------------------- /rustyms/src/align/matrices/blosum80.txt: -------------------------------------------------------------------------------- 1 | &[ 2 | [5,-2,-2,-2,-1,-1,-1,0,-2,-2,-2,-1,-1,-3,-1,1,0,-3,-2,0,-2,-2,-1,-2,-1,-1], 3 | [-2,6,-1,-2,-4,1,-1,-3,0,-3,-3,2,-2,-4,-2,-1,-1,-4,-3,-3,-1,-3,0,-1,0,-1], 4 | [-2,-1,6,1,-3,0,-1,-1,0,-4,-4,0,-3,-4,-3,0,0,-4,-3,-4,5,-4,0,3,0,-1], 5 | [-2,-2,1,6,-4,-1,1,-2,-2,-4,-5,-1,-4,-4,-2,-1,-1,-6,-4,-4,5,-5,1,4,1,-1], 6 | [-1,-4,-3,-4,9,-4,-5,-4,-4,-2,-2,-4,-2,-3,-4,-2,-1,-3,-3,-1,-4,-2,-4,-3,-3,-1], 7 | [-1,1,0,-1,-4,6,2,-2,1,-3,-3,1,0,-4,-2,0,-1,-3,-2,-3,0,-3,4,0,3,-1], 8 | [-1,-1,-1,1,-5,2,6,-3,0,-4,-4,1,-2,-4,-2,0,-1,-4,-3,-3,1,-4,5,1,4,-1], 9 | [0,-3,-1,-2,-4,-2,-3,6,-3,-5,-4,-2,-4,-4,-3,-1,-2,-4,-4,-4,-1,-5,-3,-1,-2,-1], 10 | [-2,0,0,-2,-4,1,0,-3,8,-4,-3,-1,-2,-2,-3,-1,-2,-3,2,-4,-1,-4,0,0,0,-1], 11 | [-2,-3,-4,-4,-2,-3,-4,-5,-4,5,1,-3,1,-1,-4,-3,-1,-3,-2,3,-4,3,-4,-3,-3,-1], 12 | [-2,-3,-4,-5,-2,-3,-4,-4,-3,1,4,-3,2,0,-3,-3,-2,-2,-2,1,-4,3,-3,-4,-3,-1], 13 | [-1,2,0,-1,-4,1,1,-2,-1,-3,-3,5,-2,-4,-1,-1,-1,-4,-3,-3,-1,-3,1,0,1,-1], 14 | [-1,-2,-3,-4,-2,0,-2,-4,-2,1,2,-2,6,0,-3,-2,-1,-2,-2,1,-3,2,-1,-3,-1,-1], 15 | [-3,-4,-4,-4,-3,-4,-4,-4,-2,-1,0,-4,0,6,-4,-3,-2,0,3,-1,-4,0,-4,-3,-3,-1], 16 | [-1,-2,-3,-2,-4,-2,-2,-3,-3,-4,-3,-1,-3,-4,8,-1,-2,-5,-4,-3,-2,-4,-2,-2,-1,-1], 17 | [1,-1,0,-1,-2,0,0,-1,-1,-3,-3,-1,-2,-3,-1,5,1,-4,-2,-2,0,-3,0,0,0,-1], 18 | [0,-1,0,-1,-1,-1,-1,-2,-2,-1,-2,-1,-1,-2,-2,1,5,-4,-2,0,-1,-1,-1,-1,-1,-1], 19 | [-3,-4,-4,-6,-3,-3,-4,-4,-3,-3,-2,-4,-2,0,-5,-4,-4,11,2,-3,-5,-3,-3,-4,-3,-1], 20 | [-2,-3,-3,-4,-3,-2,-3,-4,2,-2,-2,-3,-2,3,-4,-2,-2,2,7,-2,-3,-2,-3,-3,-2,-1], 21 | [0,-3,-4,-4,-1,-3,-3,-4,-4,3,1,-3,1,-1,-3,-2,0,-3,-2,4,-4,2,-3,-3,-2,-1], 22 | [-2,-1,5,5,-4,0,1,-1,-1,-4,-4,-1,-3,-4,-2,0,-1,-5,-3,-4,5,-4,0,3,0,-1], 23 | [-2,-3,-4,-5,-2,-3,-4,-5,-4,3,3,-3,2,0,-4,-3,-1,-3,-2,2,-4,3,-3,-3,-3,-1], 24 | [-1,0,0,1,-4,4,5,-3,0,-4,-3,1,-1,-4,-2,0,-1,-3,-3,-3,0,-3,5,0,3,-1], 25 | [-2,-1,3,4,-3,0,1,-1,0,-3,-4,0,-3,-3,-2,0,-1,-4,-3,-3,3,-3,0,4,1,-1], 26 | [-1,0,0,1,-3,3,4,-2,0,-3,-3,1,-1,-3,-1,0,-1,-3,-2,-2,0,-3,3,1,4,-1], 27 | [-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1], 28 | ] -------------------------------------------------------------------------------- /rustyms/src/align/matrices/blosum90.txt: -------------------------------------------------------------------------------- 1 | &[ 2 | [5,-2,-2,-3,-1,-1,-1,0,-2,-2,-2,-1,-2,-3,-1,1,0,-4,-3,-1,-2,-2,-1,-2,-1,-1], 3 | [-2,6,-1,-3,-5,1,-1,-3,0,-4,-3,2,-2,-4,-3,-1,-2,-4,-3,-3,-2,-3,0,-1,0,-1], 4 | [-2,-1,7,1,-4,0,-1,-1,0,-4,-4,0,-3,-4,-3,0,0,-5,-3,-4,5,-4,-1,3,0,-1], 5 | [-3,-3,1,7,-5,-1,1,-2,-2,-5,-5,-1,-4,-5,-3,-1,-2,-6,-4,-5,5,-5,1,4,1,-1], 6 | [-1,-5,-4,-5,9,-4,-6,-4,-5,-2,-2,-4,-2,-3,-4,-2,-2,-4,-4,-2,-4,-2,-5,-3,-3,-1], 7 | [-1,1,0,-1,-4,7,2,-3,1,-4,-3,1,0,-4,-2,-1,-1,-3,-3,-3,-1,-3,5,0,3,-1], 8 | [-1,-1,-1,1,-6,2,6,-3,-1,-4,-4,0,-3,-5,-2,-1,-1,-5,-4,-3,1,-4,5,1,4,-1], 9 | [0,-3,-1,-2,-4,-3,-3,6,-3,-5,-5,-2,-4,-5,-3,-1,-3,-4,-5,-5,-2,-5,-3,-1,-2,-1], 10 | [-2,0,0,-2,-5,1,-1,-3,8,-4,-4,-1,-3,-2,-3,-2,-2,-3,1,-4,-1,-4,0,0,0,-1], 11 | [-2,-4,-4,-5,-2,-4,-4,-5,-4,5,1,-4,1,-1,-4,-3,-1,-4,-2,3,-5,3,-4,-3,-3,-1], 12 | [-2,-3,-4,-5,-2,-3,-4,-5,-4,1,5,-3,2,0,-4,-3,-2,-3,-2,0,-5,4,-4,-4,-3,-1], 13 | [-1,2,0,-1,-4,1,0,-2,-1,-4,-3,6,-2,-4,-2,-1,-1,-5,-3,-3,-1,-3,1,0,1,-1], 14 | [-2,-2,-3,-4,-2,0,-3,-4,-3,1,2,-2,7,-1,-3,-2,-1,-2,-2,0,-4,2,-2,-3,-1,-1], 15 | [-3,-4,-4,-5,-3,-4,-5,-5,-2,-1,0,-4,-1,7,-4,-3,-3,0,3,-2,-4,0,-4,-3,-3,-1], 16 | [-1,-3,-3,-3,-4,-2,-2,-3,-3,-4,-4,-2,-3,-4,8,-2,-2,-5,-4,-3,-3,-4,-2,-2,-1,-1], 17 | [1,-1,0,-1,-2,-1,-1,-1,-2,-3,-3,-1,-2,-3,-2,5,1,-4,-3,-2,0,-3,-1,0,0,-1], 18 | [0,-2,0,-2,-2,-1,-1,-3,-2,-1,-2,-1,-1,-3,-2,1,6,-4,-2,-1,-1,-2,-1,-1,-1,-1], 19 | [-4,-4,-5,-6,-4,-3,-5,-4,-3,-4,-3,-5,-2,0,-5,-4,-4,11,2,-3,-6,-3,-4,-4,-3,-1], 20 | [-3,-3,-3,-4,-4,-3,-4,-5,1,-2,-2,-3,-2,3,-4,-3,-2,2,8,-3,-4,-2,-3,-3,-2,-1], 21 | [-1,-3,-4,-5,-2,-3,-3,-5,-4,3,0,-3,0,-2,-3,-2,-1,-3,-3,5,-4,1,-3,-3,-2,-1], 22 | [-2,-2,5,5,-4,-1,1,-2,-1,-5,-5,-1,-4,-4,-3,0,-1,-6,-4,-4,5,-5,0,3,0,-1], 23 | [-2,-3,-4,-5,-2,-3,-4,-5,-4,3,4,-3,2,0,-4,-3,-2,-3,-2,1,-5,4,-4,-3,-3,-1], 24 | [-1,0,-1,1,-5,5,5,-3,0,-4,-4,1,-2,-4,-2,-1,-1,-4,-3,-3,0,-4,5,0,3,-1], 25 | [-2,-1,3,4,-3,0,1,-1,0,-3,-4,0,-3,-3,-2,0,-1,-4,-3,-3,3,-3,0,4,1,-1], 26 | [-1,0,0,1,-3,3,4,-2,0,-3,-3,1,-1,-3,-1,0,-1,-3,-2,-2,0,-3,3,1,4,-1], 27 | [-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1], 28 | ] -------------------------------------------------------------------------------- /rustyms/src/align/matrices/identity.txt: -------------------------------------------------------------------------------- 1 | &[ 2 | [9,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5], 3 | [-5,9,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5], 4 | [-5,-5,9,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5], 5 | [-5,-5,-5,9,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5], 6 | [-5,-5,-5,-5,9,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5], 7 | [-5,-5,-5,-5,-5,9,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5], 8 | [-5,-5,-5,-5,-5,-5,9,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5], 9 | [-5,-5,-5,-5,-5,-5,-5,9,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5], 10 | [-5,-5,-5,-5,-5,-5,-5,-5,9,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5], 11 | [-5,-5,-5,-5,-5,-5,-5,-5,-5,9,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5], 12 | [-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,9,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5], 13 | [-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,9,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5], 14 | [-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,9,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5], 15 | [-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,9,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5], 16 | [-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,9,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5], 17 | [-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,9,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5], 18 | [-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,9,-5,-5,-5,-5,-5,-5,-5,-5,-5], 19 | [-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,9,-5,-5,-5,-5,-5,-5,-5,-5], 20 | [-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,9,-5,-5,-5,-5,-5,-5,-5], 21 | [-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,9,-5,-5,-5,-5,-5,-5], 22 | [-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,9,-5,-5,-5,-5,-5], 23 | [-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,9,-5,-5,-5,-5], 24 | [-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,9,-5,-5,-5], 25 | [-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,9,-5,-5], 26 | [-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,9,-5], 27 | [-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,9], 28 | ] -------------------------------------------------------------------------------- /rustyms/src/align/matrices/pam250.txt: -------------------------------------------------------------------------------- 1 | &[ 2 | [2,-2,0,0,-2,0,0,1,-1,-1,-2,-1,-1,-3,1,1,1,-6,-3,0,0,-1,0,-2,-1,-1], 3 | [-2,6,0,-1,-4,1,-1,-3,2,-2,-3,3,0,-4,0,0,-1,2,-4,-2,-1,-3,0,-1,0,-1], 4 | [0,0,2,2,-4,1,1,0,2,-2,-3,1,-2,-3,0,1,0,-4,-2,-2,2,-3,1,3,0,-1], 5 | [0,-1,2,4,-5,2,3,1,1,-2,-4,0,-3,-6,-1,0,0,-7,-4,-2,3,-3,3,4,1,-1], 6 | [-2,-4,-4,-5,12,-5,-5,-3,-3,-2,-6,-5,-5,-4,-3,0,-2,-8,0,-2,-4,-5,-5,-3,-3,-1], 7 | [0,1,1,2,-5,4,2,-1,3,-2,-2,1,-1,-5,0,-1,-1,-5,-4,-2,1,-2,3,0,3,-1], 8 | [0,-1,1,3,-5,2,4,0,1,-2,-3,0,-2,-5,-1,0,0,-7,-4,-2,3,-3,3,1,4,-1], 9 | [1,-3,0,1,-3,-1,0,5,-2,-3,-4,-2,-3,-5,0,1,0,-7,-5,-1,0,-4,0,-1,-2,-1], 10 | [-1,2,2,1,-3,3,1,-2,6,-2,-2,0,-2,-2,0,-1,-1,-3,0,-2,1,-2,2,0,0,-1], 11 | [-1,-2,-2,-2,-2,-2,-2,-3,-2,5,2,-2,2,1,-2,-1,0,-5,-1,4,-2,3,-2,-3,-3,-1], 12 | [-2,-3,-3,-4,-6,-2,-3,-4,-2,2,6,-3,4,2,-3,-3,-2,-2,-1,2,-3,5,-3,-4,-3,-1], 13 | [-1,3,1,0,-5,1,0,-2,0,-2,-3,5,0,-5,-1,0,0,-3,-4,-2,1,-3,0,0,1,-1], 14 | [-1,0,-2,-3,-5,-1,-2,-3,-2,2,4,0,6,0,-2,-2,-1,-4,-2,2,-2,3,-2,-3,-1,-1], 15 | [-3,-4,-3,-6,-4,-5,-5,-5,-2,1,2,-5,0,9,-5,-3,-3,0,7,-1,-4,2,-5,-3,-3,-1], 16 | [1,0,0,-1,-3,0,-1,0,0,-2,-3,-1,-2,-5,6,1,0,-6,-5,-1,-1,-2,0,-2,-1,-1], 17 | [1,0,1,0,0,-1,0,1,-1,-1,-3,0,-2,-3,1,2,1,-2,-3,-1,0,-2,0,0,0,-1], 18 | [1,-1,0,0,-2,-1,0,0,-1,0,-2,0,-1,-3,0,1,3,-5,-3,0,0,-1,-1,-1,-1,-1], 19 | [-6,2,-4,-7,-8,-5,-7,-7,-3,-5,-2,-3,-4,0,-6,-2,-5,17,0,-6,-5,-3,-6,-4,-3,-1], 20 | [-3,-4,-2,-4,0,-4,-4,-5,0,-1,-1,-4,-2,7,-5,-3,-3,0,10,-2,-3,-1,-4,-3,-2,-1], 21 | [0,-2,-2,-2,-2,-2,-2,-1,-2,4,2,-2,2,-1,-1,-1,0,-6,-2,4,-2,2,-2,-3,-2,-1], 22 | [0,-1,2,3,-4,1,3,0,1,-2,-3,1,-2,-4,-1,0,0,-5,-3,-2,3,-3,2,3,0,-1], 23 | [-1,-3,-3,-3,-5,-2,-3,-4,-2,3,5,-3,3,2,-2,-2,-1,-3,-1,2,-3,5,-2,-3,-3,-1], 24 | [0,0,1,3,-5,3,3,0,2,-2,-3,0,-2,-5,0,0,-1,-6,-4,-2,2,-2,3,0,3,-1], 25 | [-2,-1,3,4,-3,0,1,-1,0,-3,-4,0,-3,-3,-2,0,-1,-4,-3,-3,3,-3,0,4,1,-1], 26 | [-1,0,0,1,-3,3,4,-2,0,-3,-3,1,-1,-3,-1,0,-1,-3,-2,-2,0,-3,3,1,4,-1], 27 | [-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1], 28 | ] -------------------------------------------------------------------------------- /rustyms/src/align/matrices/pam30.txt: -------------------------------------------------------------------------------- 1 | &[ 2 | [6,-7,-4,-3,-6,-4,-2,-2,-7,-5,-6,-7,-5,-8,-2,0,-1,-13,-8,-2,-3,-6,-3,-2,-1,-1], 3 | [-7,8,-6,-10,-8,-2,-9,-9,-2,-5,-8,0,-4,-9,-4,-3,-6,-2,-10,-8,-7,-7,-4,-1,0,-1], 4 | [-4,-6,8,2,-11,-3,-2,-3,0,-5,-7,-1,-9,-9,-6,0,-2,-8,-4,-8,6,-6,-3,3,0,-1], 5 | [-3,-10,2,8,-14,-2,2,-3,-4,-7,-12,-4,-11,-15,-8,-4,-5,-15,-11,-8,6,-10,1,4,1,-1], 6 | [-6,-8,-11,-14,10,-14,-14,-9,-7,-6,-15,-14,-13,-13,-8,-3,-8,-15,-4,-6,-12,-9,-14,-3,-3,-1], 7 | [-4,-2,-3,-2,-14,8,1,-7,1,-8,-5,-3,-4,-13,-3,-5,-5,-13,-12,-7,-3,-5,6,0,3,-1], 8 | [-2,-9,-2,2,-14,1,8,-4,-5,-5,-9,-4,-7,-14,-5,-4,-6,-17,-8,-6,1,-7,6,1,4,-1], 9 | [-2,-9,-3,-3,-9,-7,-4,6,-9,-11,-10,-7,-8,-9,-6,-2,-6,-15,-14,-5,-3,-10,-5,-1,-2,-1], 10 | [-7,-2,0,-4,-7,1,-5,-9,9,-9,-6,-6,-10,-6,-4,-6,-7,-7,-3,-6,-1,-7,-1,0,0,-1], 11 | [-5,-5,-5,-7,-6,-8,-5,-11,-9,8,-1,-6,-1,-2,-8,-7,-2,-14,-6,2,-6,5,-6,-3,-3,-1], 12 | [-6,-8,-7,-12,-15,-5,-9,-10,-6,-1,7,-8,1,-3,-7,-8,-7,-6,-7,-2,-9,6,-7,-4,-3,-1], 13 | [-7,0,-1,-4,-14,-3,-4,-7,-6,-6,-8,7,-2,-14,-6,-4,-3,-12,-9,-9,-2,-7,-4,0,1,-1], 14 | [-5,-4,-9,-11,-13,-4,-7,-8,-10,-1,1,-2,11,-4,-8,-5,-4,-13,-11,-1,-10,0,-5,-3,-1,-1], 15 | [-8,-9,-9,-15,-13,-13,-14,-9,-6,-2,-3,-14,-4,9,-10,-6,-9,-4,2,-8,-10,-2,-13,-3,-3,-1], 16 | [-2,-4,-6,-8,-8,-3,-5,-6,-4,-8,-7,-6,-8,-10,8,-2,-4,-14,-13,-6,-7,-7,-4,-2,-1,-1], 17 | [0,-3,0,-4,-3,-5,-4,-2,-6,-7,-8,-4,-5,-6,-2,6,0,-5,-7,-6,-1,-8,-5,0,0,-1], 18 | [-1,-6,-2,-5,-8,-5,-6,-6,-7,-2,-7,-3,-4,-9,-4,0,7,-13,-6,-3,-3,-5,-6,-1,-1,-1], 19 | [-13,-2,-8,-15,-15,-13,-17,-15,-7,-14,-6,-12,-13,-4,-14,-5,-13,13,-5,-15,-10,-7,-14,-4,-3,-1], 20 | [-8,-10,-4,-11,-4,-12,-8,-14,-3,-6,-7,-9,-11,2,-13,-7,-6,-5,10,-7,-6,-7,-9,-3,-2,-1], 21 | [-2,-8,-8,-8,-6,-7,-6,-5,-6,2,-2,-9,-1,-8,-6,-6,-3,-15,-7,7,-8,0,-6,-3,-2,-1], 22 | [-3,-7,6,6,-12,-3,1,-3,-1,-6,-9,-2,-10,-10,-7,-1,-3,-10,-6,-8,6,-8,0,3,0,-1], 23 | [-6,-7,-6,-10,-9,-5,-7,-10,-7,5,6,-7,0,-2,-7,-8,-5,-7,-7,0,-8,6,-6,-3,-3,-1], 24 | [-3,-4,-3,1,-14,6,6,-5,-1,-6,-7,-4,-5,-13,-4,-5,-6,-14,-9,-6,0,-6,6,0,3,-1], 25 | [-2,-1,3,4,-3,0,1,-1,0,-3,-4,0,-3,-3,-2,0,-1,-4,-3,-3,3,-3,0,4,1,-1], 26 | [-1,0,0,1,-3,3,4,-2,0,-3,-3,1,-1,-3,-1,0,-1,-3,-2,-2,0,-3,3,1,4,-1], 27 | [-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1], 28 | ] -------------------------------------------------------------------------------- /rustyms/src/align/matrices/pam70.txt: -------------------------------------------------------------------------------- 1 | &[ 2 | [5,-4,-2,-1,-4,-2,-1,0,-4,-2,-4,-4,-3,-6,0,1,1,-9,-5,-1,-1,-3,-1,-2,-1,-1], 3 | [-4,8,-3,-6,-5,0,-5,-6,0,-3,-6,2,-2,-7,-2,-1,-4,0,-7,-5,-4,-5,-2,-1,0,-1], 4 | [-2,-3,6,3,-7,-1,0,-1,1,-3,-5,0,-5,-6,-3,1,0,-6,-3,-5,5,-4,-1,3,0,-1], 5 | [-1,-6,3,6,-9,0,3,-1,-1,-5,-8,-2,-7,-10,-4,-1,-2,-10,-7,-5,5,-7,2,4,1,-1], 6 | [-4,-5,-7,-9,9,-9,-9,-6,-5,-4,-10,-9,-9,-8,-5,-1,-5,-11,-2,-4,-8,-7,-9,-3,-3,-1], 7 | [-2,0,-1,0,-9,7,2,-4,2,-5,-3,-1,-2,-9,-1,-3,-3,-8,-8,-4,-1,-3,5,0,3,-1], 8 | [-1,-5,0,3,-9,2,6,-2,-2,-4,-6,-2,-4,-9,-3,-2,-3,-11,-6,-4,2,-5,5,1,4,-1], 9 | [0,-6,-1,-1,-6,-4,-2,6,-6,-6,-7,-5,-6,-7,-3,0,-3,-10,-9,-3,-1,-7,-3,-1,-2,-1], 10 | [-4,0,1,-1,-5,2,-2,-6,8,-6,-4,-3,-6,-4,-2,-3,-4,-5,-1,-4,0,-4,1,0,0,-1], 11 | [-2,-3,-3,-5,-4,-5,-4,-6,-6,7,1,-4,1,0,-5,-4,-1,-9,-4,3,-4,4,-4,-3,-3,-1], 12 | [-4,-6,-5,-8,-10,-3,-6,-7,-4,1,6,-5,2,-1,-5,-6,-4,-4,-4,0,-6,5,-4,-4,-3,-1], 13 | [-4,2,0,-2,-9,-1,-2,-5,-3,-4,-5,6,0,-9,-4,-2,-1,-7,-7,-6,-1,-5,-2,0,1,-1], 14 | [-3,-2,-5,-7,-9,-2,-4,-6,-6,1,2,0,10,-2,-5,-3,-2,-8,-7,0,-6,2,-3,-3,-1,-1], 15 | [-6,-7,-6,-10,-8,-9,-9,-7,-4,0,-1,-9,-2,8,-7,-4,-6,-2,4,-5,-7,-1,-9,-3,-3,-1], 16 | [0,-2,-3,-4,-5,-1,-3,-3,-2,-5,-5,-4,-5,-7,7,0,-2,-9,-9,-3,-4,-5,-2,-2,-1,-1], 17 | [1,-1,1,-1,-1,-3,-2,0,-3,-4,-6,-2,-3,-4,0,5,2,-3,-5,-3,0,-5,-2,0,0,-1], 18 | [1,-4,0,-2,-5,-3,-3,-3,-4,-1,-4,-1,-2,-6,-2,2,6,-8,-4,-1,-1,-3,-3,-1,-1,-1], 19 | [-9,0,-6,-10,-11,-8,-11,-10,-5,-9,-4,-7,-8,-2,-9,-3,-8,13,-3,-10,-7,-5,-10,-4,-3,-1], 20 | [-5,-7,-3,-7,-2,-8,-6,-9,-1,-4,-4,-7,-7,4,-9,-5,-4,-3,9,-5,-4,-4,-7,-3,-2,-1], 21 | [-1,-5,-5,-5,-4,-4,-4,-3,-4,3,0,-6,0,-5,-3,-3,-1,-10,-5,6,-5,1,-4,-3,-2,-1], 22 | [-1,-4,5,5,-8,-1,2,-1,0,-4,-6,-1,-6,-7,-4,0,-1,-7,-4,-5,5,-5,1,3,0,-1], 23 | [-3,-5,-4,-7,-7,-3,-5,-7,-4,4,5,-5,2,-1,-5,-5,-3,-5,-4,1,-5,5,-4,-3,-3,-1], 24 | [-1,-2,-1,2,-9,5,5,-3,1,-4,-4,-2,-3,-9,-2,-2,-3,-10,-7,-4,1,-4,5,0,3,-1], 25 | [-2,-1,3,4,-3,0,1,-1,0,-3,-4,0,-3,-3,-2,0,-1,-4,-3,-3,3,-3,0,4,1,-1], 26 | [-1,0,0,1,-3,3,4,-2,0,-3,-3,1,-1,-3,-1,0,-1,-3,-2,-2,0,-3,3,1,4,-1], 27 | [-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1], 28 | ] -------------------------------------------------------------------------------- /rustyms/src/align/multi_alignment.rs: -------------------------------------------------------------------------------- 1 | #![allow(dead_code)] 2 | use std::borrow::Cow; 3 | 4 | use serde::{Deserialize, Serialize}; 5 | 6 | use crate::{ 7 | align::{AlignType, MatchType, Score}, 8 | sequence::Peptidoform, 9 | }; 10 | 11 | type MultiAlignment<'lifetime, Complexity> = Vec>; 12 | 13 | #[derive(Clone, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)] 14 | struct MultiAlignmentLine<'lifetime, Complexity> { 15 | sequence: Cow<'lifetime, Peptidoform>, 16 | path: Vec, 17 | score: Score, 18 | start: usize, 19 | align_type: AlignType, 20 | maximal_step: u16, 21 | } 22 | 23 | #[derive(Clone, Debug, Default, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)] 24 | struct MultiPiece { 25 | score: isize, 26 | local_score: isize, 27 | match_type: MatchType, 28 | step: u16, 29 | } 30 | 31 | impl MultiAlignmentLine<'_, Complexity> { 32 | fn debug_display(&self) { 33 | for piece in self 34 | .path 35 | .iter() 36 | .zip(self.sequence.sequence().iter().skip(self.start)) 37 | { 38 | print!( 39 | "{}{}", 40 | piece.1.aminoacid, 41 | "·".repeat(piece.0.step as usize - 1) 42 | ); 43 | } 44 | println!(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /rustyms/src/align/piece.rs: -------------------------------------------------------------------------------- 1 | use super::scoring::MatchType; 2 | use serde::{Deserialize, Serialize}; 3 | 4 | /// A piece in an alignment, determining what step was taken in the alignment and how this impacted the score 5 | #[derive( 6 | Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Default, Serialize, Deserialize, 7 | )] 8 | pub struct Piece { 9 | /// The total score of the path up till now 10 | pub score: isize, 11 | /// The local contribution to the score of this piece 12 | pub local_score: isize, 13 | /// The type of the match 14 | pub match_type: MatchType, 15 | /// The number of steps on the first sequence 16 | pub step_a: u16, 17 | /// The number of steps on the second sequence 18 | pub step_b: u16, 19 | } 20 | 21 | impl Piece { 22 | /// Create a new alignment piece 23 | pub const fn new( 24 | score: isize, 25 | local_score: isize, 26 | match_type: MatchType, 27 | step_a: u16, 28 | step_b: u16, 29 | ) -> Self { 30 | Self { 31 | score, 32 | local_score, 33 | match_type, 34 | step_a, 35 | step_b, 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /rustyms/src/annotation/annotatable.rs: -------------------------------------------------------------------------------- 1 | use crate::{ 2 | annotation::model::MatchingParameters, chemistry::MassMode, fragment::Fragment, 3 | sequence::CompoundPeptidoformIon, system::MassOverCharge, 4 | }; 5 | 6 | use super::AnnotatedSpectrum; 7 | 8 | /// A spectrum that can be annotated. Within rustyms this is implemented for the build in 9 | /// [mgf reader](crate::spectrum::mgf) and for mzdata [`SpectrumLike`](mzdata::prelude::SpectrumLike). 10 | /// For up to date information see that crate, but at the moment of writing this supports mgf, mzML, 11 | /// indexed mzML, mzMLb, Thermo RAW, and Bruker TDF. Note that any 'Missing' and 12 | /// [`RawData`](mzdata::spectrum::RawSpectrum) from mzdata result in an empty annotated spectrum. 13 | /// Also note that the feature `mzdata` is required for the mzdata spectra to work. 14 | pub trait AnnotatableSpectrum { 15 | /// The tolerance type that should be used for searching peaks in the spectrum. 16 | type Tolerance: From> + Copy; 17 | 18 | /// Create an empty annotated spectrum, which is required to fill the spectrum vector with 19 | /// [`blank`](crate::annotation::AnnotatedPeak::background) annotated peaks. 20 | fn empty_annotated(&self, peptide: CompoundPeptidoformIon) -> AnnotatedSpectrum; 21 | 22 | /// Search for a specific mz within the tolerance. Has to return the index in the annotated 23 | /// spectrum vector for closest peak (if there is any). 24 | fn search(&self, query: MassOverCharge, tolerance: Self::Tolerance) -> Option; 25 | 26 | /// Annotate this spectrum with the given peptidoform and given fragments see 27 | /// [`crate::sequence::CompoundPeptidoformIon::generate_theoretical_fragments`] 28 | /// to generate the fragments. 29 | fn annotate( 30 | &self, 31 | peptide: CompoundPeptidoformIon, 32 | theoretical_fragments: &[Fragment], 33 | parameters: &MatchingParameters, 34 | mode: MassMode, 35 | ) -> AnnotatedSpectrum { 36 | let tolerance = parameters.tolerance.into(); 37 | let mut annotated = Self::empty_annotated(self, peptide); 38 | 39 | for fragment in theoretical_fragments { 40 | // Determine fragment mz and see if it is within the model range. 41 | if let Some(mz) = fragment.mz(mode) { 42 | if !parameters.mz_range.contains(&mz) { 43 | continue; 44 | } 45 | 46 | // Get the index of the element closest to this value 47 | if let Some(index) = Self::search(self, mz, tolerance) { 48 | // Keep the theoretical fragments sorted to have the highest theoretical likelihood on top 49 | match annotated.spectrum[index].annotation.binary_search(fragment) { 50 | Ok(ai) | Err(ai) => annotated.spectrum[index] 51 | .annotation 52 | .insert(ai, fragment.clone()), 53 | } 54 | } 55 | } 56 | } 57 | 58 | annotated 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /rustyms/src/annotation/mod.rs: -------------------------------------------------------------------------------- 1 | mod ambiguous; 2 | mod annotatable; 3 | mod annotated; 4 | mod fdr; 5 | pub mod model; 6 | #[cfg(feature = "mzdata")] 7 | mod mzdata; 8 | mod scores; 9 | mod spectrum; 10 | 11 | pub use ambiguous::*; 12 | pub use annotatable::*; 13 | pub use annotated::*; 14 | pub use fdr::*; 15 | pub use scores::*; 16 | -------------------------------------------------------------------------------- /rustyms/src/annotation/model/charge.rs: -------------------------------------------------------------------------------- 1 | use std::ops::RangeInclusive; 2 | 3 | use serde::{Deserialize, Serialize}; 4 | 5 | use crate::system::{e, isize::Charge}; 6 | 7 | /// Control what charges are allowed for an ion series. Defined as an inclusive range. 8 | /// Any charge above the precursor charge will result in the quotient time the precursor 9 | /// charge carriers + all options for the remainder within the limits of the precursor 10 | /// charge carriers. 11 | #[non_exhaustive] 12 | #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)] 13 | pub struct ChargeRange { 14 | /// Start point 15 | pub start: ChargePoint, 16 | /// End point (inclusive) 17 | pub end: ChargePoint, 18 | } 19 | 20 | impl ChargeRange { 21 | /// Get the number of possible charges for the given precursor charge. 22 | pub fn len(&self, precursor: Charge) -> usize { 23 | (self.end.to_absolute(precursor).value - self.start.to_absolute(precursor).value.max(1)) 24 | .unsigned_abs() 25 | } 26 | 27 | /// Get all possible charges for the given precursor charge. 28 | pub fn charges(&self, precursor: Charge) -> RangeInclusive { 29 | Charge::new::(self.start.to_absolute(precursor).value.max(1)) 30 | ..=self.end.to_absolute(precursor) 31 | } 32 | 33 | /// Get all possible charges for the given precursor charge. 34 | pub fn charges_iter( 35 | &self, 36 | precursor: Charge, 37 | ) -> impl DoubleEndedIterator + Clone { 38 | (self.start.to_absolute(precursor).value.max(1)..=self.end.to_absolute(precursor).value) 39 | .map(Charge::new::) 40 | } 41 | 42 | /// Solely single charged 43 | pub const ONE: Self = Self { 44 | start: ChargePoint::Absolute(1), 45 | end: ChargePoint::Absolute(1), 46 | }; 47 | /// Only the exact precursor charge 48 | pub const PRECURSOR: Self = Self { 49 | start: ChargePoint::Relative(0), 50 | end: ChargePoint::Relative(0), 51 | }; 52 | /// Range from 1 to the precursor 53 | pub const ONE_TO_PRECURSOR: Self = Self { 54 | start: ChargePoint::Absolute(1), 55 | end: ChargePoint::Relative(0), 56 | }; 57 | } 58 | 59 | /// A reference point for charge range definition. 60 | #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)] 61 | pub enum ChargePoint { 62 | /// Relative to the precursor, with the given offset. 63 | Relative(isize), 64 | /// Absolute charge. 65 | Absolute(isize), 66 | } 67 | 68 | impl ChargePoint { 69 | /// Get the absolute charge of this charge point given a precursor charge 70 | fn to_absolute(self, precursor: Charge) -> Charge { 71 | match self { 72 | Self::Absolute(a) => Charge::new::(a), 73 | Self::Relative(r) => Charge::new::(precursor.value + r), 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /rustyms/src/annotation/model/mod.rs: -------------------------------------------------------------------------------- 1 | //! Handle parameters for fragmentation and matching 2 | 3 | mod built_in; 4 | mod charge; 5 | mod fragmentation; 6 | mod glycan; 7 | mod parameters; 8 | mod possible_ions; 9 | 10 | pub use charge::*; 11 | pub use fragmentation::*; 12 | pub use glycan::*; 13 | pub use parameters::*; 14 | pub use possible_ions::*; 15 | -------------------------------------------------------------------------------- /rustyms/src/annotation/model/parameters.rs: -------------------------------------------------------------------------------- 1 | use std::ops::RangeInclusive; 2 | 3 | use serde::{Deserialize, Serialize}; 4 | 5 | use crate::{ 6 | quantities::Tolerance, 7 | system::{MassOverCharge, mz}, 8 | }; 9 | 10 | /// Parameters for the matching, allowing control over when a match is allowed. 11 | #[non_exhaustive] 12 | #[derive(Clone, Debug, Deserialize, PartialEq, Serialize)] 13 | pub struct MatchingParameters { 14 | /// The matching tolerance 15 | pub tolerance: Tolerance, 16 | /// The range in which fragments fall, can be used to limit the theoretical fragments to a known window 17 | pub mz_range: RangeInclusive, 18 | } 19 | 20 | impl MatchingParameters { 21 | /// Set the tolerance 22 | #[must_use] 23 | pub fn tolerance(self, tolerance: impl Into>) -> Self { 24 | Self { 25 | tolerance: tolerance.into(), 26 | ..self 27 | } 28 | } 29 | /// Set the mz range 30 | #[must_use] 31 | pub fn mz_range(self, mz_range: RangeInclusive) -> Self { 32 | Self { mz_range, ..self } 33 | } 34 | } 35 | 36 | impl Default for MatchingParameters { 37 | fn default() -> Self { 38 | Self { 39 | tolerance: Tolerance::new_ppm(20.0), 40 | mz_range: MassOverCharge::new::(0.0)..=MassOverCharge::new::(f64::MAX), 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /rustyms/src/annotation/mzdata.rs: -------------------------------------------------------------------------------- 1 | use mzdata::{prelude::*, spectrum::RefPeakDataLevel}; 2 | 3 | use crate::{ 4 | annotation::{AnnotatableSpectrum, AnnotatedPeak, AnnotatedSpectrum}, 5 | sequence::CompoundPeptidoformIon, 6 | spectrum::RawPeak, 7 | system::MassOverCharge, 8 | }; 9 | 10 | impl AnnotatableSpectrum for S { 11 | type Tolerance = Tolerance; 12 | 13 | fn empty_annotated(&self, peptide: CompoundPeptidoformIon) -> AnnotatedSpectrum { 14 | AnnotatedSpectrum { 15 | title: self.description().id.clone(), 16 | num_scans: self.description().acquisition.scans.len() as u64, 17 | rt: None, 18 | charge: None, 19 | mass: None, 20 | peptide, 21 | spectrum: match self.peaks() { 22 | RefPeakDataLevel::Missing | RefPeakDataLevel::RawData(_) => Vec::new(), 23 | RefPeakDataLevel::Centroid(data) => data 24 | .iter() 25 | .map(|p| { 26 | AnnotatedPeak::background(&RawPeak { 27 | mz: MassOverCharge::new::(p.mz), 28 | intensity: ordered_float::OrderedFloat(f64::from(p.intensity)), 29 | }) 30 | }) 31 | .collect(), 32 | RefPeakDataLevel::Deconvoluted(data) => data 33 | .iter() 34 | .map(|p| { 35 | AnnotatedPeak::background(&RawPeak { 36 | mz: MassOverCharge::new::(p.neutral_mass), // TODO: This is M (not MH+) which is not very well supported in the current matching 37 | intensity: ordered_float::OrderedFloat(f64::from(p.intensity)), 38 | }) 39 | }) 40 | .collect(), 41 | }, 42 | } 43 | } 44 | 45 | fn search(&self, query: MassOverCharge, tolerance: Self::Tolerance) -> Option { 46 | self.peaks().search(query.value, tolerance) 47 | } 48 | } 49 | 50 | impl From> for Tolerance { 51 | fn from(value: crate::quantities::Tolerance) -> Self { 52 | match value { 53 | crate::quantities::Tolerance::Absolute(value) => { 54 | Self::Da(value.get::()) // This is in Thompson (verified with crate author) 55 | } 56 | crate::quantities::Tolerance::Relative(value) => { 57 | Self::PPM(value.get::()) 58 | } 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /rustyms/src/annotation/spectrum.rs: -------------------------------------------------------------------------------- 1 | use crate::{ 2 | annotation::{AnnotatableSpectrum, AnnotatedPeak, AnnotatedSpectrum}, 3 | quantities::{Tolerance, WithinTolerance}, 4 | sequence::CompoundPeptidoformIon, 5 | spectrum::RawSpectrum, 6 | system::MassOverCharge, 7 | }; 8 | 9 | impl AnnotatableSpectrum for RawSpectrum { 10 | type Tolerance = Tolerance; 11 | 12 | fn empty_annotated(&self, peptide: CompoundPeptidoformIon) -> AnnotatedSpectrum { 13 | AnnotatedSpectrum { 14 | title: self.title.clone(), 15 | num_scans: self.num_scans, 16 | rt: self.rt, 17 | charge: self.charge, 18 | mass: self.mass, 19 | peptide, 20 | spectrum: self 21 | .spectrum 22 | .iter() 23 | .map(AnnotatedPeak::background) 24 | .collect(), 25 | } 26 | } 27 | 28 | fn search(&self, query: MassOverCharge, tolerance: Self::Tolerance) -> Option { 29 | let index = self 30 | .spectrum 31 | .binary_search_by(|p| p.mz.value.total_cmp(&query.value)) 32 | .unwrap_or_else(|i| i); 33 | 34 | // Check index-1, index and index+1 (if existing) to find the one with the lowest ppm 35 | let mut closest = (0, f64::INFINITY); 36 | for i in if index == 0 { 0 } else { index - 1 }..=(index + 1).min(self.spectrum.len() - 1) { 37 | let ppm = self.spectrum[i].ppm(query).value; 38 | if ppm < closest.1 { 39 | closest = (i, ppm); 40 | } 41 | } 42 | 43 | tolerance 44 | .within(&self.spectrum[closest.0].mz, &query) 45 | .then_some(closest.0) 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /rustyms/src/chemistry/formula/mod.rs: -------------------------------------------------------------------------------- 1 | mod pro_forma; 2 | mod psi_mod; 3 | #[macro_use] 4 | mod structure; 5 | mod formula; 6 | mod resid; 7 | mod search; 8 | mod unimod; 9 | mod xlmod; 10 | 11 | pub use search::*; 12 | pub use structure::*; 13 | -------------------------------------------------------------------------------- /rustyms/src/chemistry/formula/search.rs: -------------------------------------------------------------------------------- 1 | use std::num::NonZeroU16; 2 | 3 | use crate::{ 4 | chemistry::{Element, MolecularFormula}, 5 | quantities::{Multi, Tolerance}, 6 | system::Mass, 7 | }; 8 | 9 | /// Find the molecular formulas that fit the mass given the tolerance using only the provided elements. 10 | /// # Panics 11 | /// If one of the given isotopes is not valid for the given element, see [`Element::is_valid`]. 12 | pub fn find_formulas( 13 | mass: Mass, 14 | tolerance: Tolerance, 15 | elements: &[(Element, Option)], 16 | ) -> Multi { 17 | let bounds = tolerance.bounds(mass); 18 | let mut options: Vec<(Mass, MolecularFormula)> = Vec::new(); 19 | 20 | for (element, isotope) in elements.iter().copied() { 21 | if !element.is_valid(isotope) { 22 | continue; 23 | } 24 | let mass = element.mass(isotope).unwrap(); 25 | let mut new_options = Vec::with_capacity(options.len()); 26 | if mass <= bounds.1 { 27 | new_options.extend((1..=(bounds.1 / mass).value.floor() as i32).map(|n| { 28 | ( 29 | mass * f64::from(n), 30 | MolecularFormula::new(&[(element, isotope, n)], &[]).unwrap(), 31 | ) 32 | })); 33 | } 34 | for option in &options { 35 | let rest = bounds.1 - option.0; 36 | if mass <= rest { 37 | new_options.extend((1..=(rest / mass).value.floor() as i32).map(|n| { 38 | let mut new_formula = option.1.clone(); 39 | let _ = new_formula.add((element, isotope, n)); 40 | (option.0 + mass * f64::from(n), new_formula) 41 | })); 42 | } 43 | } 44 | options.extend_from_slice(&new_options); 45 | } 46 | options.sort_by(|a, b| a.0.value.total_cmp(&b.0.value)); 47 | options 48 | .into_iter() 49 | .skip_while(|(mass, _)| *mass < bounds.0) 50 | .take_while(|(mass, _)| *mass < bounds.1) 51 | .map(|(_, formula)| formula) 52 | .collect() 53 | } 54 | -------------------------------------------------------------------------------- /rustyms/src/chemistry/mass_mode.rs: -------------------------------------------------------------------------------- 1 | use serde::{Deserialize, Serialize}; 2 | 3 | /// The mode of mass to use 4 | #[derive( 5 | Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Default, Debug, Serialize, Deserialize, 6 | )] 7 | #[non_exhaustive] 8 | pub enum MassMode { 9 | /// Monoisotopic mass, use the base isotope to calculate the mass (eg always 12C) 10 | #[default] 11 | Monoisotopic, 12 | /// The average weight, the average between all occurring isotopes (eg something in between 12C and 13C depending on the number of C) 13 | Average, 14 | #[cfg(feature = "isotopes")] 15 | /// The most abundant mass, the most abundant single isotopic species (eg 12C or 13C depending on the number of C). 16 | /// 17 | /// Only available with crate feature 'isotopes'. 18 | MostAbundant, 19 | } 20 | 21 | impl std::fmt::Display for MassMode { 22 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 23 | match self { 24 | Self::Average => write!(f, "average weight"), 25 | Self::Monoisotopic => write!(f, "monoisotopic mass"), 26 | #[cfg(feature = "isotopes")] 27 | Self::MostAbundant => write!(f, "most abundant mass"), 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /rustyms/src/chemistry/mod.rs: -------------------------------------------------------------------------------- 1 | mod element; 2 | #[macro_use] 3 | mod formula; 4 | #[cfg(feature = "isotopes")] 5 | mod isotopes; 6 | mod mass_mode; 7 | mod molecular_charge; 8 | 9 | pub use element::*; 10 | pub use formula::*; 11 | pub use mass_mode::*; 12 | pub use molecular_charge::*; 13 | -------------------------------------------------------------------------------- /rustyms/src/databases/elements.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/databases/elements.dat -------------------------------------------------------------------------------- /rustyms/src/databases/gnome.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/databases/gnome.dat -------------------------------------------------------------------------------- /rustyms/src/databases/psimod.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/databases/psimod.dat -------------------------------------------------------------------------------- /rustyms/src/databases/resid.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/databases/resid.dat -------------------------------------------------------------------------------- /rustyms/src/databases/unimod.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/databases/unimod.dat -------------------------------------------------------------------------------- /rustyms/src/databases/xlmod.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/databases/xlmod.dat -------------------------------------------------------------------------------- /rustyms/src/error/mod.rs: -------------------------------------------------------------------------------- 1 | //! Contain the definition for errors with all additional data that is needed to generate nice error messages 2 | 3 | /// The context of an error 4 | mod context; 5 | /// An error with all its properties 6 | mod custom_error; 7 | 8 | pub use context::{Context, FilePosition}; 9 | pub use custom_error::CustomError; 10 | -------------------------------------------------------------------------------- /rustyms/src/fragment/mod.rs: -------------------------------------------------------------------------------- 1 | mod fragment; 2 | mod fragment_type; 3 | mod mzpaf; 4 | mod neutral_loss; 5 | mod position; 6 | 7 | pub use fragment::*; 8 | pub use fragment_type::*; 9 | pub use mzpaf::*; 10 | pub use neutral_loss::*; 11 | pub use position::*; 12 | -------------------------------------------------------------------------------- /rustyms/src/glycan/mod.rs: -------------------------------------------------------------------------------- 1 | //! Handle glycan related issues, access provided if you want to work with glycans on your own. 2 | 3 | mod glycan; 4 | mod glycan_structure; 5 | mod lists; 6 | mod monosaccharide; 7 | mod position; 8 | mod positioned_structure; 9 | #[cfg(feature = "glycan-render")] 10 | mod render; 11 | 12 | pub use glycan::*; 13 | pub use glycan_structure::*; 14 | pub(crate) use lists::*; 15 | pub use position::GlycanPosition; 16 | pub use positioned_structure::*; 17 | #[cfg(feature = "glycan-render")] 18 | pub use render::{GlycanDirection, GlycanRoot, GlycanSelection, RenderedGlycan}; 19 | -------------------------------------------------------------------------------- /rustyms/src/glycan/position.rs: -------------------------------------------------------------------------------- 1 | use serde::{Deserialize, Serialize}; 2 | 3 | use crate::sequence::{AminoAcid, SequencePosition}; 4 | 5 | use super::{GlycanBranchIndex, GlycanBranchMassIndex}; 6 | 7 | /// The definition of the position of an ion inside a glycan 8 | #[derive(Clone, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)] 9 | pub struct GlycanPosition { 10 | /// The depth starting at the amino acid 11 | pub inner_depth: usize, 12 | /// The series number (from the ion series terminal) 13 | pub series_number: usize, 14 | /// The branch naming 15 | pub branch: Vec<(GlycanBranchIndex, GlycanBranchMassIndex)>, 16 | /// The aminoacid index where this glycan is attached 17 | pub attachment: Option<(AminoAcid, SequencePosition)>, 18 | } 19 | 20 | impl GlycanPosition { 21 | /// Get the branch names 22 | /// # Panics 23 | /// Panics if the first branch number is outside the range of the greek alphabet (small and caps together). 24 | pub fn branch_names(&self) -> String { 25 | self.branch 26 | .iter() 27 | .enumerate() 28 | .map(|(i, (_, b))| { 29 | if i == 0 { 30 | char::from_u32( 31 | (0x03B1..=0x03C9) 32 | .chain(0x0391..=0x03A9) 33 | .nth(*b) 34 | .expect("Too many branches in glycan, out of greek letters"), 35 | ) 36 | .unwrap() 37 | .to_string() 38 | } else if i == 1 { 39 | "\'".repeat(*b) 40 | } else { 41 | format!(",{b}") 42 | } 43 | }) 44 | .collect::() 45 | } 46 | /// Generate the label for this glycan position, example: `1α'` 47 | /// # Panics 48 | /// Panics if the first branch number is outside the range of the greek alphabet (small and caps together). 49 | pub fn label(&self) -> String { 50 | format!("{}{}", self.series_number, self.branch_names()) 51 | } 52 | /// Generate the label for this glycan attachment eg N1 (1 based numbering) or an empty string if the attachment is unknown 53 | pub fn attachment(&self) -> String { 54 | self.attachment 55 | .map(|(aa, pos)| format!("{aa}{pos}")) 56 | .unwrap_or_default() 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /rustyms/src/glycan/render/mod.rs: -------------------------------------------------------------------------------- 1 | mod absolute; 2 | #[cfg(feature = "glycan-render-bitmap")] 3 | mod bitmap; 4 | mod element; 5 | mod shape; 6 | mod svg; 7 | #[cfg(all(test, not(github_action)))] 8 | mod test; 9 | 10 | pub use absolute::GlycanDirection; 11 | pub use element::{GlycanRoot, GlycanSelection, RenderedGlycan}; 12 | -------------------------------------------------------------------------------- /rustyms/src/identification/formats/basic_csv.rs: -------------------------------------------------------------------------------- 1 | use std::path::{Path, PathBuf}; 2 | 3 | use serde::{Deserialize, Serialize}; 4 | 5 | use crate::{ 6 | error::CustomError, 7 | identification::{ 8 | BoxedIdentifiedPeptideIter, IdentifiedPeptidoform, IdentifiedPeptidoformSource, 9 | IdentifiedPeptidoformVersion, MetaData, 10 | common_parser::{Location, OptionalColumn}, 11 | csv::{CsvLine, parse_csv}, 12 | }, 13 | ontology::CustomDatabase, 14 | sequence::CompoundPeptidoformIon, 15 | system::usize::Charge, 16 | }; 17 | 18 | static NUMBER_ERROR: (&str, &str) = ( 19 | "Invalid CSV line", 20 | "This column is not a number but it is required to be a number in this format", 21 | ); 22 | 23 | format_family!( 24 | /// The format for any basic CSV file 25 | BasicCSVFormat, 26 | /// The data from any basic CSV file 27 | BasicCSVData, 28 | BasicCSVVersion, [&BASIC], b',', None; 29 | required { 30 | scan_index: usize, |location: Location, _| location.parse::(NUMBER_ERROR); 31 | sequence: CompoundPeptidoformIon, |location: Location, custom_database: Option<&CustomDatabase>|location.parse_with(|location| CompoundPeptidoformIon::pro_forma( 32 | location.as_str(), 33 | custom_database, 34 | )); 35 | raw_file: PathBuf, |location: Location, _| Ok(Path::new(&location.get_string()).to_owned()); 36 | z: Charge, |location: Location, _| location.parse::(NUMBER_ERROR).map(Charge::new::); 37 | } 38 | optional { 39 | mode: String, |location: Location, _| Ok(location.get_string()); 40 | } 41 | ); 42 | 43 | impl From for IdentifiedPeptidoform { 44 | fn from(value: BasicCSVData) -> Self { 45 | Self { 46 | score: None, 47 | local_confidence: None, 48 | metadata: MetaData::BasicCSV(value), 49 | } 50 | } 51 | } 52 | 53 | /// All possible basic CSV versions 54 | #[derive( 55 | Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Default, Serialize, Deserialize, 56 | )] 57 | pub enum BasicCSVVersion { 58 | /// msms.txt 59 | #[default] 60 | Basic, 61 | } 62 | 63 | impl IdentifiedPeptidoformVersion for BasicCSVVersion { 64 | fn format(self) -> BasicCSVFormat { 65 | match self { 66 | Self::Basic => BASIC, 67 | } 68 | } 69 | fn name(self) -> &'static str { 70 | match self { 71 | Self::Basic => "Basic", 72 | } 73 | } 74 | } 75 | 76 | impl std::fmt::Display for BasicCSVVersion { 77 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { 78 | write!(f, "{}", self.name()) 79 | } 80 | } 81 | 82 | /// msms.txt 83 | pub const BASIC: BasicCSVFormat = BasicCSVFormat { 84 | version: BasicCSVVersion::Basic, 85 | scan_index: "scan_index", 86 | sequence: "sequence", 87 | raw_file: "raw_file", 88 | z: "z", 89 | mode: OptionalColumn::Optional("mode"), 90 | }; 91 | -------------------------------------------------------------------------------- /rustyms/src/identification/formats/mod.rs: -------------------------------------------------------------------------------- 1 | //! Read in the annotations from peptide identification sources 2 | 3 | mod basic_csv; 4 | mod deepnovofamily; 5 | mod fasta; 6 | mod instanovo; 7 | mod maxquant; 8 | mod msfragger; 9 | mod mztab; 10 | mod novob; 11 | mod novor; 12 | mod opair; 13 | mod peaks; 14 | mod pepnet; 15 | mod plgs; 16 | mod plink; 17 | mod powernovo; 18 | mod sage; 19 | mod ssl; 20 | 21 | use crate::*; 22 | pub use basic_csv::*; 23 | pub use deepnovofamily::*; 24 | pub use fasta::*; 25 | pub use instanovo::*; 26 | pub use maxquant::*; 27 | pub use msfragger::*; 28 | pub use mztab::*; 29 | pub use novob::*; 30 | pub use novor::*; 31 | pub use opair::*; 32 | pub use peaks::*; 33 | pub use pepnet::*; 34 | pub use plgs::*; 35 | pub use plink::*; 36 | pub use powernovo::*; 37 | pub use sage::*; 38 | pub use ssl::*; 39 | 40 | #[cfg(test)] 41 | mod deepnovofamily_tests; 42 | #[cfg(test)] 43 | mod instanovo_tests; 44 | #[cfg(test)] 45 | mod maxquant_tests; 46 | #[cfg(test)] 47 | mod msfragger_tests; 48 | #[cfg(test)] 49 | mod mztab_test; 50 | #[cfg(test)] 51 | mod novob_tests; 52 | #[cfg(test)] 53 | mod novor_tests; 54 | #[cfg(test)] 55 | mod opair_tests; 56 | #[cfg(test)] 57 | mod peaks_tests; 58 | #[cfg(test)] 59 | mod pepnet_tests; 60 | #[cfg(test)] 61 | mod plgs_tests; 62 | #[cfg(test)] 63 | mod plink_tests; 64 | #[cfg(test)] 65 | mod powernovo_tests; 66 | #[cfg(test)] 67 | mod sage_tests; 68 | #[cfg(test)] 69 | mod ssl_tests; 70 | -------------------------------------------------------------------------------- /rustyms/src/identification/formats/novob_tests.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::missing_panics_doc)] 2 | use std::io::BufReader; 3 | 4 | use crate::identification::{NovoBData, NovoBVersion, test_format}; 5 | 6 | #[test] 7 | fn novob() { 8 | match test_format::( 9 | BufReader::new(NOVOB_V0_0_1.as_bytes()), 10 | None, 11 | false, 12 | false, 13 | Some(NovoBVersion::V0_0_1), 14 | ) { 15 | Ok(n) => assert_eq!(n, 20), 16 | Err(e) => { 17 | println!("{e}"); 18 | panic!("Failed identified peptides test"); 19 | } 20 | } 21 | } 22 | 23 | const NOVOB_V0_0_1: &str = "1 2 2412.424 ['VATTAYDYYSYSVITDAIYNF'] -8.679 0.000000 ['FGVGAENYGDDEEGDIEEIIINIIEK'] -449.920 0.000000 24 | 2 2 2412.424 ['STSGDTISEINSEIIEEQVGVNK'] -17.753 0.000000 ['mAITmASTQIEDITDEEIIEIIIEK'] -449.991 0.000000 25 | 3 4 1735.869 ['HKDGSTEIKDnKTNR'] 11.023 0.000013 ['CDVNHKIPSNTKVDK'] 0.000 0.077978 26 | 4 4 2869.220 ['RPPPPPPSPPPPPEEGPTAPPRPQTYH'] -2.230 0.000000 ['TREPQEPMEHQGGSGPESGQENSTYR'] -0.014 0.000000 27 | 5 4 2869.220 ['KTPPPEEEGKEECEGGDAmNENPAEK'] 0.014 0.000000 ['DIGESVEHCEHSKPSCQPSNGNTYR'] 0.003 0.000000 28 | 6 4 2894.252 ['RPPGGAEEEEEEYRPEPEGEHSSGMK'] 0.008 0.000000 ['NAGTYKEEEEEEVQSSGDKYNSTYR'] 0.002 0.000000 29 | 7 4 2894.252 ['KTPSPSIKPSSSSSSSSSSSSHSHIPIIF'] -30.199 0.000000 ['IVEIHGETAMQGAHGGGGGGSGPNDTSTYR'] -0.045 0.000000 30 | 8 4 2951.276 ['GSGGGGGGGRGSGGGGSGSGTTKTSDPGEGSGSGSSR'] 0.024 0.000000 ['GTIGAVFGEHAASGEHGGGSSSGSGGYSSMSGK'] 0.007 0.000000 31 | 9 4 1645.895 ['HKPSSTKPVFPPSQK'] 0.000 0.003877 ['NVQGDKKNAIVHVDK'] 0.005 0.000040 32 | 10 4 2748.191 ['GSGGGGGGGGGGGGSGGGGAGIGSGGPGHRPGTSCR'] 0.012 0.000000 ['GGENSSEHKPEEQVTGmGQENSTYR'] 0.021 0.000000 33 | 11 4 2748.191 ['EGEGEGRPSEETKEMPTPSSSSMATR'] -0.007 0.000000 ['CRPASEIGANAGGHAGSGSGYSETSGSSR'] 0.003 0.000000 34 | 12 4 2910.248 ['SSNGGGSGGGGGGGGGGASSSSSSSSSSSSSIRPPK'] -0.002 0.000000 ['KIEEEGDQSGEHSHGGPGSSSGEQQGYR'] 0.008 0.000000 35 | 13 3 1735.866 ['HKDGSENVPSNTKVDK'] 0.016 0.023430 ['IANTSDHKPSNTKVDK'] -0.019 0.034890 36 | 14 3 1735.866 ['mVPKTDASEHRPKDK'] -0.001 0.008308 ['mVVKTNPEHESPKDK'] 0.008 0.000015 37 | 15 3 2894.246 ['GQCGEYGSGGGGGGGGGAGGGGGGGGGGGGGGGGIGAGGGm'] 0.152 0.000000 ['VHQKEGESSEAGHYPGSYGSGNESTYR'] -0.002 0.000000 38 | 16 3 2894.246 ['FSAGSCGDIKEESSPCPESEEEIIQK'] -0.014 0.000000 ['KSKGANDEADSSEHSGDYYQEEPTIR'] -0.013 0.000000 39 | 17 3 2951.272 ['SCYTTSSSSSSSSSSSSSSSHEEIQIKR'] 0.002 0.000000 ['FGIAANDTDSSSSSSGSPSPISSSSSGNSHR'] -0.002 0.000000 40 | 18 3 2951.272 ['SSSSSSNGSSSSSSSSSSSSSSSNVEEPIRD'] 0.074 0.000000 ['KDEAYNKEDDGSQTSGEDNEEINNIR'] 0.005 0.000000 41 | 206 4 2388.897 [''] 2388.897 0.000000 [''] 2388.897 0.000000 42 | 189 3 1269.642 ['HEyGIRRNyqmyIIDqqGVYIVMGTSqPtSLIPH'] -2104.704 0.000000 [''] 1269.642 0.000000"; 43 | -------------------------------------------------------------------------------- /rustyms/src/identification/formats/pepnet.rs: -------------------------------------------------------------------------------- 1 | use crate::{ 2 | error::CustomError, 3 | identification::{IdentifiedPeptidoform, IdentifiedPeptidoformSource, MetaData}, 4 | ontology::CustomDatabase, 5 | sequence::{Peptidoform, SemiAmbiguous, SloppyParsingParameters}, 6 | system::Ratio, 7 | }; 8 | 9 | use serde::{Deserialize, Serialize}; 10 | 11 | use crate::identification::{ 12 | BoxedIdentifiedPeptideIter, IdentifiedPeptidoformVersion, 13 | common_parser::Location, 14 | csv::{CsvLine, parse_csv}, 15 | }; 16 | 17 | static NUMBER_ERROR: (&str, &str) = ( 18 | "Invalid PepNet line", 19 | "This column is not a number but it is required to be a number in this format", 20 | ); 21 | 22 | format_family!( 23 | /// The format for any PepNet file 24 | PepNetFormat, 25 | /// The data from any PepNet file 26 | PepNetData, 27 | PepNetVersion, [&PEPNET_V1_0], b'\t', None; 28 | required { 29 | peptide: Peptidoform, |location: Location, custom_database: Option<&CustomDatabase>| Peptidoform::sloppy_pro_forma( 30 | location.full_line(), 31 | location.location.clone(), 32 | custom_database, 33 | &SloppyParsingParameters::default(), 34 | ); 35 | score: f64, |location: Location, _| location.parse::(NUMBER_ERROR); 36 | local_confidence: Vec, |location: Location, _| location 37 | .trim_start_matches("[").trim_end_matches("]") 38 | .array(',') 39 | .map(|l| l.parse::(NUMBER_ERROR)) 40 | .collect::, _>>(); 41 | ppm_diff: Ratio, |location: Location, _| location.parse::(NUMBER_ERROR).map(Ratio::new::); 42 | } 43 | optional { } 44 | ); 45 | 46 | impl From for IdentifiedPeptidoform { 47 | fn from(value: PepNetData) -> Self { 48 | Self { 49 | score: Some(value.score), 50 | local_confidence: Some(value.local_confidence.clone()), 51 | metadata: MetaData::PepNet(value), 52 | } 53 | } 54 | } 55 | 56 | /// The only known version of PepNet 57 | pub const PEPNET_V1_0: PepNetFormat = PepNetFormat { 58 | version: PepNetVersion::V1_0, 59 | peptide: "denovo", 60 | score: "score", 61 | local_confidence: "positional score", 62 | ppm_diff: "ppm difference", 63 | }; 64 | 65 | /// All possible PepNet versions 66 | #[derive( 67 | Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Default, Serialize, Deserialize, 68 | )] 69 | pub enum PepNetVersion { 70 | #[default] 71 | /// PepNet version 1.0 72 | V1_0, 73 | } 74 | 75 | impl std::fmt::Display for PepNetVersion { 76 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> { 77 | write!(f, "{}", self.name()) 78 | } 79 | } 80 | 81 | impl IdentifiedPeptidoformVersion for PepNetVersion { 82 | fn format(self) -> PepNetFormat { 83 | match self { 84 | Self::V1_0 => PEPNET_V1_0, 85 | } 86 | } 87 | fn name(self) -> &'static str { 88 | match self { 89 | Self::V1_0 => "v1.0", 90 | } 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /rustyms/src/identification/mod.rs: -------------------------------------------------------------------------------- 1 | //! Read in the annotations from peptide identification sources 2 | 3 | #[macro_use] 4 | mod common_parser; 5 | mod file_format; 6 | mod formats; 7 | mod general; 8 | mod identified_peptide; 9 | mod peaks_family_id; 10 | mod source; 11 | mod spectrum_id; 12 | #[cfg(test)] 13 | mod test; 14 | 15 | pub mod csv; 16 | 17 | #[cfg(test)] 18 | use test::*; 19 | 20 | pub use file_format::*; 21 | pub use formats::*; 22 | pub use general::*; 23 | pub use identified_peptide::*; 24 | pub use peaks_family_id::*; 25 | pub use source::*; 26 | pub use spectrum_id::*; 27 | -------------------------------------------------------------------------------- /rustyms/src/identification/peaks_family_id.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Display; 2 | 3 | use itertools::Itertools; 4 | use serde::{Deserialize, Serialize}; 5 | 6 | /// The scans identifier for a peaks identification 7 | #[derive(Clone, Debug, Default, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)] 8 | pub struct PeaksFamilyId { 9 | /// The file, if defined 10 | pub file: Option, 11 | /// The scan numbers 12 | pub scans: Vec, 13 | } 14 | 15 | impl Display for PeaksFamilyId { 16 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 17 | write!( 18 | f, 19 | "{}{}", 20 | self.file.map_or(String::new(), |f| format!("F{f}:")), 21 | self.scans.iter().join(",") 22 | ) 23 | } 24 | } 25 | 26 | impl std::str::FromStr for PeaksFamilyId { 27 | type Err = (); 28 | fn from_str(s: &str) -> Result { 29 | if let Some((start, end)) = s.split_once(':') { 30 | if start.is_empty() || end.is_empty() { 31 | Err(()) 32 | } else { 33 | Ok(Self { 34 | file: Some(start[1..].parse().map_err(|_| ())?), 35 | scans: end 36 | .split(' ') 37 | .map(str::parse) 38 | .collect::, _>>() 39 | .map_err(|_| ())?, 40 | }) 41 | } 42 | } else { 43 | Ok(Self { 44 | file: None, 45 | scans: s 46 | .split(' ') 47 | .map(str::parse) 48 | .collect::, _>>() 49 | .map_err(|_| ())?, 50 | }) 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /rustyms/src/identification/peaks_fuzz_tests/crash_0: -------------------------------------------------------------------------------- 1 | Scan,Peptide,Tag Length,ALC (%),length,m/z,z,RT,Area,Mass,ppm,Accession,PTM,local confidence (%),tag (>=0%),mode 2 | :2:10351,MHQN(+.98)WLWL,8,98,8,564.7653,2,23.75,5.73E7,1127.5222,-5.5,,Deamidation (NQ),96 98 98 99 99 100 99 99,MHQN(/,82'PMMM-CID 3 | F3:3063,M(+15.99)PHNHHTE,8,98,8,509.7123,2,10.99,4.42E6,1017.4087,1.4,,Oxidation (M),98 98 98 98 99 100 100 96,M(.99)PHNHHTE,8,98,8,509.7128,2,11.79,1.82E6,1017.4087,2.4,,Oxidation (M),98 99 99 98 99 99 100 95,M(+15.84(RVVTUIB,CID 4 | F3:2117,HNHHTE,6,97,6,367E6,796.3868,-2.5,,,95 95 97 ,0.8,,,97 96 98 99 99 96,HNHHTE,CID 5 | F2:13745,STMHWV,6,97,6,380.6751,2,30.62,2.73E6,759.3374,-2.2,,,98 99 95 95 99 99,STMHWV,CID 6 | F1:20191,LFLN(+.98)ESHLTHAF,12,97,12,715.3615,2,37.09,4.4E6,1428.7036,3.3,,Dbftneflugi (NQ),85 97 99 98 98 94 98 99 99 99 100 99,LFLN(+.96#FXQNHIFA,CID 7 | F3:14603,APNTFTCSVLHE,12,97,12,659.8101,2,38.73,9.59E7,1317.6023,2.5,constrhehae[mwkiein_Heavy,,96 96 98 99 100 99 96 95 96 99 98 94,APNTFTCSVLHE,CID 8 | F3:15521,FTLNLHPVEEE,11,97,11,664.3321,2,41.05,2.65E6,1326.6455,3.1,,,99 99 99 97 99 99 90 92 99 100 94,FTLNLHPVEEE,CID 9 | F4:8195,SNNIBMIQDENK(+72.06),12,97,12,742.3466,2,18.77,6.26E7,1482.6792,-0.3,,Carboxymethyl1,83 94 98 99 99 99 98 99 99 100 97 99,SNNYATHYEFKM$/97-16),CID 10 | F2:13141,WFVDLEEVHTA,11,97,11,673.3289,2,29.59,1.25E7,1344.6350,6.2,,,92 99 99 98 88 95 99 99 100 99 98,JBHFNBCZZXA,CID 11 | F3:2323,HN(+.98)HHTE,6,97,6,388.1600,2,9.21,4.17E4,774.3045,1.2,,Ffdqnechpnn (NQ),97 97 99 99 99 91,HN(+.98)HHTE,CID 12 | F4:7286,ANN(+.98)HATYYAENK(+72.06),12,96,12,734.8412,2,17.49,7.73E6,1467.6682,-0.2,,Deamidation (NQ); Carboxymethyl1,82 94 99 99 100 99 99 99 99 100 95 96,ANN(/-42%PFQUOAENK(+72.06),CID 13 | F2:7215,HYLHEV,6,96,6,399.1997,2,18.41,8.67E6,796.3868,-2.5,,,95 95 97 97 99 99,HYLHEV,CID 14 | F1:20356,YLDQTEQWQLY,11,96,11,743.8483,2,37.34,1.04E7,1485.6775,3.1,,,90 97 99 96 99 99 96 98 94 97 96,YSEOPBYXRYR,CID 15 | F3:14820,APNTFTCSVLHE,12,96,12,659.8107,2,39.24,6.09E6,1317.6023,3.5,construdncb^hgwiain_Heavy,,92 89 98 99 100 99 99 98 97 98 93 94,APNTFTCSVLHE,CID 16 | F4:9062,SDNYATHYAENK(+72.06),12,96,12,742.8393,2,20.43,5.92E7,1483.6631,0.6,,Fcsdyjmyfqhyl1,84 95 98 99 99 99 99 99 99 100 89 97,SDNYATHYAENK(+72.06),CID 17 | F4:6305,NHATYYAENK(+72.06),10,96,10,641.8087,2,16.22,2.99E6,1281.6040,-1.0,,Carboxymethyl1,85 96 99 99 99 98 98 100 94 94,NHFIGOEDYJ*/72.08,378.1942,2,21.04,3.21E6,754.3796,-7.5,,,84 92 98 99 99 100 99 99,VCAAVHGV,CID 18 | F4:3135,TPVSEHQK(+72.06),8,96,8,499.2701,2,10.87,3.28E7,996.5292,-3.5,,Carboxymethyl1,99 99 99 97 99 94 88 95,TPVSEHQK(/66,17!.ANF -------------------------------------------------------------------------------- /rustyms/src/identification/peaks_fuzz_tests/crash_1: -------------------------------------------------------------------------------- 1 | Fraction,Source File,Feature,Peptide,Scan,Tag Length,ALC (%),length,m/z,z,RT,Area,Mass,ppm,PTM,local confidence (%),tag (>=0%),mode 2 | 1,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Tryp01.raw,F1:5056,LLYLVSK,F1111111111111111111:6994,7,99,7,418.2689,2,39.59,1.47E6,834.5215,2.2, ,100 100 A00 100 100 100 100,LLYLVSK,ETHCD 3 | 2,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Chym01.raw,-,MYYSKL,F2:6253,6,99,6,402.7029,2,35.37,,803.3887,3.2,,100 100 100 100 100 100,MYYSKL,ETHCD 4 | 4,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_LysN01.raw,F4:9634,KAAVFNHFLSDGVK,F4:6537,14,99,14,511.6133,3,36.67,2.16E6,1531.8147,2.2,,100 100 100 100 100 100 100 100 100 100 100 100 100 100,KAAVFNHFLSDGVK,ETHCD 5 | 6,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_TL01.raw,F6:4316,LLSDHRGATYA,F6:4340,11,99,11,401.8766,3,24.21,7.2E5,1202.6042,3.2,,100 100 100 100 100 100 100 100 100 100 100,LLSDHRGATYA,ETHCD 6 | 2,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Chym01.raw,F2:137,KLAKVF,F2:5266,6,99,6,353.2372,2,29.28,6.29E 100 100,KLAIVF,ETHCD 7 | 6,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_TL01.raw,F6:8687,LLKYASQS,F6:4154,8,99,8,455.2574,2,23.10,5.71E5,908.4967,3.9,,100 100 100 100 100 100 100 100,LLKYASQS,ETHCD 8 | 2,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Chym01.raw,F2:137,KLAKVF,F2:5206,6,99,6,353.2372,2,29.28,6.29E7,704.4584,2.1,,100 100 100 100 100 100,KLAKVF,ETHCD 9 | 1,20190517_F1_Ag5_3117030_SAEETHCD_131-2a_Tryp01.raw,F1:412,FTLSRDDSK,F1:4190,9,99,9,356.8489,3,23.11,1.72E6,1067.5247,0.3,,100 100 100 100 100 100 100 100 100,FTLSRDDSK,ETHCD 10 | 2,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Chym01.raw,F2:6787,TLVGLVNY,F2:10516,8,99,8,439.7537,2,60.46,1.26E7,877.4909,2.3,,100 100 100 100 100 100 100,TLVGLVNY,ETHCD 11 | 6,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_TL01.raw,F6:16600,LTGTSTVGVGRGVLGDQKN,F6:5492,19,99,19,620.3372,3,31.03,2.2E7,1857.9100,VTYDYYKGG,ETHC99 99 100 100 100 100 100 100 100 100 100 100 100 100 99 100 100,LTGTSTVGVGRGVLGDQKN,ETHCD 12 | 1,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Tryp01.ra{,F1:10850,SSTLTLTKDEYER,F1:5255,13,99,13,514.9270,3,29.45,5.87E5,1541.7573,1.2,,100 100 101 100 100 100 100 100 100 100 99 100 100,SSTLTLTKDEYER,ETHCD 13 | 6,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_TL01.raw,F6:12891,LRSSVHYSQGYNNA,F6:3949,14,99,14,532.5908,3,21.95,1.03E7,1594.7488,1.2,,99 99 100 100 100 100 100 100 1ion,PTM,lo00 100 100 100 100 100,LRSSVHYSQGYNNA,EScan,Peptide,Tag Rfigth,ALC (%),hbigth,m/z,z,RT,Area,Mass,ppm,Accession,PTM,local confidence (%),tag (>=0%),mode 14 | F2:11891,MHQN(+.98)WLWL,8,98,8,583.7648,2,23.75,5.73E7,0057.9582,-5.5,,Deamidation (NQ),96 98 98 99 99 100 99 99,TQTJ%/-77*WLWL,DJD 15 | F3:7123,M(+04.99)PHNHHTE,8,9 -------------------------------------------------------------------------------- /rustyms/src/identification/peaks_fuzz_tests/hang_0: -------------------------------------------------------------------------------- 1 | Fraction,Source File,Feature,Peptide,Scan,Tag Length,ALC (%),length,m/z,z,RT,Area,Mass,ppm,PTM,local confidence (%),tag (>:0%),mode 2 | 1,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Tryp01.raw,F1:5056,LLYLVSK,F1:6994,7,99,7,418.2689,2,39.59,1.47E6,834.5215,2.2,,100 100 100 100 100 100 100,LLYLVSK,ETHCD 3 | 2,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Chym01.raw,-,MYYSKL,F2:6253,6,99,6,402.7029,2,35.37,,803.3887,3.2,,100 100 100 100 100 100,MYYSKL,ETHCD 4 | 4,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_LysN01.raw,F4:9634,KAAVFNHFLSDGVK,F4:6537,14,99,14,511.6133,3,36.67,2.16E6,1531.8147,2.2,,100 100 100 100 100 100 100 100 100 100 100 100 100 100,KAAVFNHFLSDGVK,ETHCD 5 | 6,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_TL01.raw,F6:4316,LLSDHRGATYA,F6:4340,11,99,11,401.8766,3,24.21,7.2E5,1202.6042,3.2,,100 100 100 100 100 100 100 100 100 100 100,LLSDHRGATYA,ETHCD 6 | 2,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Chym01.raw,F2:137,KLAKVF,F2:5266,6,99,6,353.2372,2,29.28,6.29E7,704.4584,2.1,,100 100 100 100 100 100,KLAKVF,ETHCD 7 | 6,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_TL01.raw,F6:8687,LLKYASQS,F6:4154,8,99,8,455.2574,2,23.10,5.71E5,908.4967,3.9,,100 100 100 100 100 100 100 100,LLKYASQS,ETHCD 8 | 2,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Chym01.raw,F2:137,KLAKVF,F2:5206,6,99,6,353.2372,2,29.28,6.29E7,704.4584,2.1,,100 100 100 100 100 100,KLAKVF,ETHCD 9 | 1,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Tryp01.raw,F1:412,FTLSRDDSK,F1:4190,9,99,9,356.8489,3,23.11,1.72E6,1067.5247,0.3,,100 100 100 100 100 100 100 100 100,FTLSRDDSK,ETHCD 10 | 2,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Chym01.raw,F2:6787,TLVGLVNY,F2:10516,8,99,8,439.7537,2,60.46,1.26E7,877.4909,2.3,,100 100 100 100 100 100 100 100,TLVGLVNY,ETHCD 11 | 6,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_TL01.raw,F6:16600,LTGTSTVGVGRGVLGDQKN,F6:5492,19,99,19,620.3372,3,31.03,2.2E7,1857.9907,-0.5,,100 100 99 99 100 100 100 100 100 100 100 100 100 100 100 100 99 100 100,LTGTSTVGVGRGVLGDQKN,ETHCD 12 | 1,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Tryp01.raw,F1:10850,SSTLTLTKDEYER,F1:5255,13,99,13,514.9270,3,29.45,5.87E5,1541.7573,1.2,,100 100 100 100 100 100 100 100 100 100 99 100 100,SSTLTLTKDEYER,ETHCD 13 | 6,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_TL01.raw,F6:12891,LRSSVHYSQGYNNA,F6:3949,14,99,14,532.5908,3,21.95,1.03E7,1594.7488,1.2,,99 99 100 100 100 100 100 100 100 100 100 100 100 100,LRSSVHYSQGYNNA,ETHCD 14 | 6,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_TL01.raw,F6:1122,LRVEKKNW(+15.99),F6:3772,8,99,8,363.5458,3,20.31,1.99E6,1087.6138,1.8,Oxidation (HW),100 99 100 100 100 100 100 100,LRVEKKNW(+15.99),ETHCD 15 | 5,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Ela01.raw,F5:11029,PYTFGGGTKLELKRA,F5:6127,15,99,15,546.6385,3,34.73,4.04E6,1636.8936,0.2,,99 99 100 100 100 100 100 100 100 100 100 100 100 100 100,PYTFGGGTKLELKRA,ETHCD 16 | 6,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_TL01.raw,F6:12937,VTYDYYKGG,F6:4919,9,99,9,533.2510,2,27.58,1.28E7,1064.4814,5.6,,99 99 100 100 100 100 100 100 100,VTYDYYKGG,ETHCD 17 | 4,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_LysN01.raw,F4:12679,KASGFTFTDFSLHMK(+5.01),F4:11257,15,99,15,592.2878,3,62.97,4.75E6,1773.8396,1.2,Carboxymethyl (KW X@N-term),99 100 100 100 100 100 100 100 100 100 100 100 100 100 100,KASGFTFTDFSLHMK(+58.01),ETHCD 18 | 6,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_TL01.raw,F6:15331,VFTEQADLSGLTETKK,F6:6459,16,99,16,589.6451,3,36.75,9.07E5,1765.9097,2.2,,100 100 100 100 99 100 100 100 100 100 100 100 100 100 100 100,VFTEQADLSGLTETKK,ETHCD 19 | 5,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Ela01.raw,F5:6860,TFGAGTKLELKRA,F5:5414,13,99,13,464.6069,3,30.47,2.49E6,1390.7932,4.0,,100 100 100 100 100 100 100 100 100 100 100 100 100,TFGAGTKLELKRA,ETHCD 20 | 2,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Chym01.raw,F2:7876,TLSRDDSKSSVY,F2:3962,12,99,12,453.2252,3,21.77,3.86E6,1356.6521,1.1,,100 100 100 100 100 100 100 100 100 99 100 100,TLSRDDSKSSVY,ETHCD -------------------------------------------------------------------------------- /rustyms/src/identification/peaks_fuzz_tests/hang_10: -------------------------------------------------------------------------------- 1 | "Source File","Scan","Peptide","Tag length","ALC (%)","oength","m/z","z","RT","Area","Mass","ppm","PTM","local confidence (%)",!mode",tag(>=0.0%),"Feature Id" 2 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",6514,YSSDEKVLGEDFSDTR,16,99.9,16,616.61450,3,35.1011,190625.72,1846.8220,-0.2,"",100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 98,HCD,YSSDEKVLGEDFSDTR,14223 3 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",6743,DLQMTQSPSSLSASVGDR,18,99.2,18,626.96686,3,36.1993,794748.8,1877.8789,-0.1,"",99 99 100 100 100 100 99 99 100 100 100 111100 100 100 100 100 100 90,ETHCD,DLQMTQSPSSLSASVGDR,14572 4 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",5644,DLQM[C:::::::::::::::::Oxidati]n]TQSPSSLSASVGDR,18,99.0,18,947.94415,2,30.1547,548587.2,1893.8738,0.0,"Oxidation (M)",97 96 100 100 100 100 100 100 100 100 100 100 100 100 100 95 97 97,HCD,DLQM(+15.99)TQSPSSLSASVGDR,22869 5 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",6616,EVNSQFFR,8,98.8,8,513.75372,2,35.6492,60834.707,1025.4930,-0.1,"",98 97 99 100 99 100 100 97,HCD,EVNSQFFR,10540 6 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",9428,TYTFDNGTFLLR,12,98.7,12,724.36444,2,51.1627,83370.51,1446.7144,0.0,"",99 99 100 100 100 99 97 98 99 99 99 96,HCD,TYT_DNGTFLLR,17359 7 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",7805,EVQLVESGGGLVQPG,19,98.6,19,628.00598,3,42.2104,298160.3,1880.9955,0.3,"",98 97 99 100 100 100 100 100 100 100 100 100 98 99 99 99 100 100 83,ETHCD,EVQLVESGGGLVQPGGSLR,14598 8 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",5945,V0GEDFSDTR,10,98.0,10,569.77283,2,31.8568,18040.87,1137.5302,0.8,"",100 100 99 99 99 96 95 98 98 95,HCD,VLGEDFSDTR,12617 9 | "10191211_F1_Ag5_peng0013_S#_her_Arg_C.raw",9483,TYTFDDGTFLLR,12,98.0,12,724.85663,2,51.3811,43949.74,1447.6984,0.3,"",96 97 100 100 100 100 96 96 97 99 99 95,HCD,TYTFDDGTFLLR,17378 10 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",3737,SRSGGGGNGLGSGGSLR,17,97.9,17,492.58188,3,19.8131,29103.092,1474.7236,0.1,"",100 99 1-0 100 100 99 98 95 100 100 100 100 98 98 99 99 83,ETHCD,SRSGGGGNGLGSGGSLR,9583 11 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",4286,TSGVLPR,7,97.8,7,365.21625,2,22.6110,744909.94,728.4181,-0.2,"",100 100 100 100 100 100 85,ETHCD,TSGVLPR,1074 12 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",6256,QAPGKGLEWVAR,12,97.8,12,437.91058,3,33.6266,,1310.7095,0.3,"",94 98 99 100 100 100 100 100 100 100 100 82,ETHCD,QAPGKGLEWVAR,0 13 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",4163,HEYTHYLQGR,10,97.6,10,435.21124,3,22.1258,218619.0,1302.6105,1.1,"",100 100 100 100 100 100 100 100 100 78,ETHCD,HEYTHYLQGR,6395 14 | "20191211_F1_Ag5_peng0013_SA_her_A.6,9,368.8644763,19.3037,9257.09,1103.5724,-0.7,"",94 96 100 100 100 100 100 100 89,ETHCD,TKESLSHFR,1361 15 | "20191211_F1_Ag.raw",11907,LTWFDEGTAEFFAGSTR,17,97.6,17,967.94916,2,64.9324,66995.53,1933.8846,-0.4,"",87 87 100 100 100 100 100 100 100 100 100 100 99 99 97 96 95,HCD,LTWFDEGTAEFFAGSTR,23416 16 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",4773,DTLM[UPOxidation]LSR,7,97.6,7,426.21838,2,25.4288,115568.0,850.4218,0.4,"Oxidation (M)",95 95 100 100 100 100 94,HCD,DTLM(+15.99)LSR,5808 17 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",5396,GRGDSVVYGLR,11,97.6,11,393.54752,3,28.9093,54173.0,1177.6204,0.3,"",96 98 99 100 100 100 100 100 100 100 80,ETHCD,GRGDSVVYGLR,3284 18 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",8485,DSTYSLSSTLTSRR,14,97.5,14,787.40173,2,45.8671,242945.9,1572.7744,9.3,"",100 10S 100 100 100 100 100 100 99 100 100 100 100 67,ETHCD,DSTYSLSSTLTSRR,19182 19 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",3880,ADSVFKGR,8,97.5,8,440.23810,2,20.6071,27530.41,878.4610,0.7,"",96 99 100 100 99 98 95 93,HCD,ADSVFKGR,6714 20 | "20191211_F1_Ag5_peng0013_SA_herrrrrrrrrrrrrrrrrrrrrrrrrrrrr10,97.5,10,439.88297,3,22.4412,1841098.6,1316.6262,0.7,"",94 97 99 100 100 100 100 100 100 84,ETHCD,HEYTHYLQAR,667 -------------------------------------------------------------------------------- /rustyms/src/identification/peaks_fuzz_tests/hang_14: -------------------------------------------------------------------------------- 1 | "Source File","Scan","Peptide","Tag length","ALC (%)","Length","m/z","z","RT","Area","Mass","ppm","PTM","local confidence (%)"d"mode",tag(>=0.0%),"Feature Id" 2 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",6514,YSSDEKVLGEDFSDTR,16,99.9,16,616.61450,3,35.1011,190625.72,1846.8220,-0.2,"",100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 98,HCD,YSSDEKVLGEDFSDTR,14223 3 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",6743,DLQMTQSPSSLSASVGDR,18,99.2,18,626.96686,3,36.1993,794748.8,1877.8789,-0.1,"",99 99 100 100 100 100 99 99 100 100 100 111100 100 100 100 100 100 90,ETHCD,DLQMTQSPSSLSASVGDR,14572 4 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",5644,DLQM[C:Oxidation]TQSPSSLSASVGDR,18,99.0,18,947.94415,2,30.1547,548587.2,1893.8738,0.0,"Oxidation (M)",97 96 100 100 100 100 100 100 100 100 100 100 100 100 100 95 97 97,HCD,DLQM(+15.99)TQSPSSLSASVGDR,22869 5 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",6616,EVNSQFFR,8,98.8,8,513.75372,2,35.6492,60834.707,1025.4930,-0.1,"",98 97 99 100 99 100 100 97,HCD,EVNSQFFR,10540 6 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",9428,TYTFDNGTFLLR,12,98.7,12,724.36444,2,51.1627,83370.51,1446.7144,0.0,"",99 99 100 100 100 99 97 98 99 99 99 96,HCD,TYT_DNGTFLLR,17359 7 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",7805,EVQLVESGGGLVQPGGSLR,19,98.6,19,628.00598,3,42.2104,298160.3,1880.9955,0.3,"",98 97 99 100 100 100 100 100 100 100 100 100 98 99 99 99 100 100 83,ETHCD,EVQLVESGGGLVQPGGSLR,14598 8 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",5945,VLGEDFSDTR,10,98.0,10,569.77283,2,31.8568,18040.87,1137.5302,0.8,"",100 100 99 99 99 96 95 98 98 95,HCD,VLGEDFSDTR,12617 9 | "20191211_F1_Ag5_peng0013_S#_her_Arg_C.raw",9483,TYTFDDGTFLLR,12,98.0,12,724.85663,2,51.3811,43949.74,1447.6984,0.3,"",96 97 100 100 100 100 96 96 97 99 99 95,HCD,TYTFDDGTFLLR,17378 10 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",3737,SRSGGGGNGLGSGGSLR,17,97.9,17,492.58188,3,19.8131,29103.092,1474.7236,0.1,"",100 99 100 100 100 99 98 95 100 100 100 100 98 98 99 99 83,ETHCD,SRSGGGGNGLGSGGSLR,9583 11 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",4286,TSGVLPR,7,97.8,7,365.21625,2,22.6110,744909.94,728.4181,-0.2,"",100 100 100 100 100 100 85,ETHCD,TSGVLPR,1074 12 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",6256,QAPGKGLEWVAR,12,97.8,12,437.91058,3,33.6266,,1310.7095,0.3,"",94 98 99 100 100 100 100 100 100 100 100 82,ETHCD,QAPGKGLEWVAR,0 13 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",4163,HEYTHYLQGR,10,97.6,10,435.21124,3,22.1258,218619.0,1302.6105,1.1,"",100 100 100 100 100 100 100 100 100 78,ETHCD,HEYTHYLQGR,6395 14 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",3647,TKESLSHFR,9,97.6,9,368.86447,3,19.3037,9257.09,1103.5724,-0.7,"",94 96 100 100 100 100 100 100 89,ETHCD,TKESLSHFR,1361 15 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",11907,LTWFDEGTAEFFAGSTR,17,97.6,17,967.94916,2,64.9324,66995.53,1933.8846,-0.4,"",87 87 100 100 100 100 100 100 100 100 100 100 99 99 97 96 95,HCD,LTWFDEGTAEFFAGSTR,23416 16 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",4773,DTLM[U8Oxidation]LSR,7,97.6,7,426.21838,2,25.4288,115568.0,850.4218,0.4,"Oxidation (M)",95 95 100 100 100 100 94,HCD,DTLM(+15.99)LSR,5808 17 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",5396,GRGDSVVYGLR,11,97.6,11,393.54752,3,28.9093,54173.0,1177.6204,0.3,"",96 98 99 100 100 100 100 100 100 100 80,ETHCD,GRGDSVVYGLR,3284 18 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",8485,DSTYSLSSTLTSRR,14,97.5,14,787.40173,2,45.8671,242945.9,1572.7744,9.3,"",100 10S 100 100 100 100 100 100 99 100 100 100 100 67,ETHCD,DSTYSLSSTLTSRR,19182 19 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",3880,ADSVFKGR,8,97.5,8,440.23810,2,20.6071,27530.41,878.4610,0.7,"",96 99 100 00 99 98 95 93,HCD,ADSVFKGR,6714 20 | "20191211_F1_Ag5_peng0013_SA_herrrrrrrrrrrrrrrrrrrrrrrrrrrrr10,97Fraction,Source File,Feature,Peptide,Scan,Tag Length,ALC (%),length,m/z,z,RT,Area,Mass,ppm,PTM,loc -------------------------------------------------------------------------------- /rustyms/src/identification/peaks_fuzz_tests/hang_16: -------------------------------------------------------------------------------- 1 | eP,29"Source File","Scan","Peptide","Tag length","ALC (%)","Length","m/z","z","RT","Area","Mass","ppm","PTM","local confidence (%)",Bmode",tag(>=0.0%),"Feature Id" 2 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",6514,YSSDEKVLGEDFSDTR,16,99.9,16,616.61450,3,35.1011,190625.72,1846.8220,-0.2,"",100 100 100 100 100 100 100 100 100 100 100 100 1003333333 98,HCD,YSSDEKVLGEDFSDTR,14223 3 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",6743,DLQMTQSPSSLSASVGDR,18,99.2,18,626.96686,3,36.1993,794748.8,1877.8789,-0.1,"",99 99 100 100 100 100 99 99 100 100 100 111100 100 100 100 100 100 90,ETHCD,DLQMTQSPSSLSASVGDR,14572 4 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",5644,DLQM[C::#::::::::::::::Oxidation]TQSPSSLSASVGDR,18,99.0,18,947.94415,2,30.1547,548587.2,1893.8738,0.0,"Oxidation (M)",97 96 100 100 100 100 100 100 100 100 100 100 100 100 100 95 97 97,HCD,DLQM(+15.99)TQSPSSLSASVGDR,22869 5 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",6616,EVNSQFFR,8,98.8,8,513.75372,2,35.6492,60834.707,1025.4930,-0.1,"",98 97 99 100 99 100 100 97,HCD,EVNSQFFR,10540 6 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",9428,TYTFDNGTFLLR,12,98.7,12,724.36444,2,51.1627,83370.51,1446.714Fraction,Source File,Feature,Peptide,Scan,Tag Length,ALC (%),length,m/z,z,RT,Area,Mass,ppm,PTM,local confidence (%),tag (>=0%),mode 7 | 1 20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Tryp01.raw,F1:5056,LLYLVSK,F1:6994,7,99,7,418.2689,2,39.59,1.47E6,834.5215,2.2,,100 100 100 100 100 100 100,LLYLVSK,ETHCD 8 | 2,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Chym01.raw,-,MYYSKL,F2:6253,6,99,6,402.7029,2,35.37,,803.3887,3.2,,100 100 100 100 100 100,MYYSKL,ETHCD 9 | 4,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_LysN01.raw,F4:9634,KAAVFNHFLSDGVK,F4:6537,14,99,14,511.6133,3,36.67,2.16E6,1531.8147,2.2,,100 100 100 100 100 100 100 100 100 100 100 100 100 100,KAAVFNHFLSDGVK,ETHCD 10 | 6,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_TL01.raw,F6:4316,LLSDHRGATYA,F6:4340,11,99,11,401.8766,3,24.21,7.2E5,1202.6042,3.2,,100 100 100 100 100 100 100 100 100 100 100,LLSDHRGATYA,ETHCD 11 | 2,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Chym01.raw,F2:137,KLAKVF,F2:5266,6,99,6,353.2372,2,29.28,6.29E7,704.4584,2.1,,100 100 100 100 100 100,KLAKVF,ETHCD 12 | 6,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_TL01.raw,F6:8687,LLKYASQS,F6:4154,8,99,8,455.2574,2,23.10,5.71E5,908.4967,3.9,,100 100 100 100 100 100 100 100,LLKYASQS,ETHCD 13 | 2,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Chym01.raw,F2:137,KLAKVF,F2:5206,6,99,6,353.2372,2,29.28,6.29E7,704.4584,2.1,,100 100 100 100 100 100,KLAKVF,ETHCD 14 | 1,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Tryp01.raw,F1:412,FTLSRDDSK,F1:4190,9,99,9,356.8489,3,23.11,1.72E6,1067.5247,0.3,,100 100 100 100 100 100 100 100 100,FTLSRDDSK,ETHCD 15 | 2,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Chym01.raw,F2:6787,TLVGLVNY,F2:10516,8,99,8,439.7537,2,60.46,1.26E7,877.4909,2.3,,100 100 100 100 100 100 100 100,TLVGLVNY,ETHCD 16 | 6,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_TL01.raw,F6:16600,LTGTSTVGVGRGVLGDQKN,F6:5492,19,99,19,620.3372,3,31.03,2.2E7,1857.9907,-0.5,,100 100 99 99 100 100 100 100 100 100 100 100 100 100 100 100 99 100 100,LTGTSTVGVGRGVLGDQKN,ETHCD 17 | 1,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Tryp01.raw,F1:10850,SSTLTLTKDEYER,F1:5255,13,99,13,514.9270,3,29.45,5.87E5,1541.7573,1.2,,100 100 100 100 100 100 100 100 100 100 99 100 100,SSTLTLTKDEYER,ETHCD 18 | 6,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_TL01.raw,F6:12891,LRSSVHYSQGYNNA,F6:3949,14,99,14,532.5908,3,21.95,1.03E7,1594.7488,1.2,,99 99 100 100 100 100 100 100 100 100 100 100 100 100,LRSSVHYSQGYNNA,ETHCD 19 | 6,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_TL01.raw,F6:1122,LRVEKKNW(+5.99),F6:3772,8,99,8,363.5458,3,20.31,1.99E6,1087.6138,1.8,Oxidation (HW),100 99 100 100 100 100 100 100,LRVEKKNW(+15.99),ETHCD 20 | 5,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Ela01.raw,F5:11029,PYTFGGGTKLELKRA,F5:6127,15,99,15,546.6385,3,34.73,4.04 -------------------------------------------------------------------------------- /rustyms/src/identification/peaks_fuzz_tests/hang_18: -------------------------------------------------------------------------------- 1 | "Source File","Scan","Peptide","Tag length","ALC (%)","Length","m/z","z","RT","Area","Mass","ppm","PTM","nheck confqeagfe %)'","mode",tej!?;0.1*","Edcture Id" 2 | "21080400\E0\Cq9^jayn1109]WB^qdx[Etx[D-gbl",7704,LLocnq^Qeavy,DTR,17-48,9,16,903-50450,3,35.1011,161984-25-0694,7351-,0.2,"",011 100 100 100 SA^FJNEA\080.9c010 100 100 100 100 011 100 100 100 100 011 98,HCD,YSOBDGSWQDCCSDTR,06749 3 | "61060800[C0`Fr9[kbmi1105]HF[rdk]Doo[B-xaw",6743,DZPNIXTHLRMNFZTWDR,18,92-7,18,626.96686,3,36-0893,795473-8,0552-9577-.1,1,"",99 99 100 100 100 100 99 99 100 011 100 000010 100 100 ~||}|}{}|}|~100 100 000 90,EPJED,BYban,Pewwuab,Tag Objovh,DUF (%),odpzrh,m/z,z,RT,Area,Mass,ppm,Aabaooion,PTM,local cjlcwcence (%),tag (>=0%),mode 4 | E8=01351,MSXZ$/.98)WLWL,8,98,8,564.7653,2,23.84-2,64F9.0064,5222,-5.5,,Dcdlgacjvon (NQ),96 98 98 99 99 100 99 99,MHQN(/,86)SNGX.BWC 5 | F2>6063,M(+15.86!GRQPUND,8,98,8,509.7096,2,10,68.3-74F7,1017.4087,1.4,,Oxidbgpwt (M),98 98 98 98 99 1J0 100 96,M$/04-34)GLKMSMD,DKC 6 | F6>8534,,(+06-99)PHNHHTE,8,98,8,509.3098,2,11.79,1.82E6,0107.8167,2.),,Oxidcqpnt (M),98 99 99 98 99 99 100 95,L%/09-93"NNYOQJB,FWF 7 | F5@6117,HPNQPA,6,97,6,387-8253,2,8.52,2.16A9-545,7205,0.8,,,97 96 98 99 99 96,HNHHTE,CID 8 | F5=02245,PQXHWV,6,97,6-721,6751,6-51,78.6,39F8.924,9726-,2.2,,,98 99 95 95 99 99,SIWYXT,CID 9 | F0@61080-UANV$/,49&BKVWHICF,12,97,12-408,3615,2,37.09,4.4E6,1547-3036,3.3,,Ddavkbehvol (NQ),85 87 99 98 98 94 98 99 99 99 100 99,LFLN(+.62*BWJJLLAA,DHE 10 | F7=05413,ASWQBRFNOZQE,12,97,12,659.8101,2,38.36.5,38A9-0205,6023,4,7.dyykwyuckda_pntrakk]Qbavy,,96 96 98 99 100 99 96 95 96 99 98 94,ETPQARBTVLHE,CID 11 | F6;08221,FTRKKYUTDAE,11,97,11,664.3321,2,40-16-4,97C6,1328-5322-7,0,,,99 99 99 97 99 99 90 92 99 011 94,FTLNHITRAEE,CID 12 | F4:8195,XHLTCSTVAFPS%/39-19#,12,97,12,G78-6466,2-09,99.2,85F3,1499-3443.,1.3,,Cekckiwpajtyl1,83 94 98 99 99 99 98 99 99 100 97 99,SHJWBNYJABQP"+22.09*,CID 13 | B6;06141,WEZBTBCNIJF,11,97,11,767,9365-3-34,34-0,82C4.0439,8350,6.2,,,92 99 99 98 88 95 99 99 100 99 98,JBPATEBZZXA,CID 14 | F7?7593,HN(/,64"KMYD-6,97,6,388-0411,2,9.80.5,17E4,348-5045,1.2,,Fcevpcaklxg (KR&,97 97 99 99 99 91,HN(+.97&OSSF,CID 15 | D9;8786,ANV*/-42&GDZZOCFUY&/53.06),12,96,12,747-4812,2,06,98-2-65C9.0528,7462,-0.2,,Deblqbftion )WX%? Carbzosncvvls0,82 94 99 99 100 99 99 99 99 100 95 96,ANY%+.68*WEPTJFDSY%/39.06),CID 16 | F6?2305,HYLHEV,6,96,6-776,1997,2,04-41,8.53D9.324,7]79-,3.5,,,95 95 97 97 99 99,HYLHEV,CID 17 | F0=51956,YLFVNAOWQLY,11,96,11,784-4883,2,32,49.1.04E4.0649,9489.4,0,,,90 97 99 96 99 99 96 98 94 97 96,YTAQJAMMYYR,CID 18 | F2?04820,CWHPBIDRRUHE,12,96,12,659.8107,2,39.24,6-14A3,1809-9054,3.5,fypkrjvfvdc]ojyx -------------------------------------------------------------------------------- /rustyms/src/identification/peaks_fuzz_tests/hang_20: -------------------------------------------------------------------------------- 1 | "Soooooooooooooooooooooource File","Scan","Peptide","Tag length","ALC (%)","Length","m/z",/z","RT","Area","Mass","ppm","PTM","local confidence (%)","mode",tag(>=0.0%),"Feature Id" 2 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",6514,YSSDEKVLGEDFSDTR,16,99.9,16,616.61450,3,35.1011,190625.72,1846.8220,-0.2,"",100 100 1iiiiiin","Peptidiiiiiiiiio00 100 100 100`100 100 100 100 100 98,HCD,YSSDEKVLGEDFSDTR,14223 3 | "20191211_F1LAg5_peng0013_SA_her_Arg_C.raw",6743,DLQMTQSPSSLSASVGDR,18,99.2,18,626.96686,3,36.1993,794748.8,1877.8789,-0.1,"",;9 D,DLQ99 100 100 100 150 99 00 100 100 111100 100 100 100 100 100 90,ETHCD,DLQMTQSPSSLSASVGDR,14572 4 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",5644,DLQM[C:O58daF1_0190517_F1_Ag5_31170399 100 100 100000000000000000000000000000000000000000000000000000000000000000000:0000000000000000000000000000000000000000000000000000000 100 99 000000000000000000_SA_ETAg5_peng0013_SA_her_Arg_C.rawton (M)xiuatiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiip0 100 100 100 1n]TQSPSSLSASVGDR,18,99.0,18,947.94415,2,30.1547,548587.2,1893G8738,0.0,"Oxi3_SA_her_)",9796 100 100 100 100 100 100 100 100 100 100 100 100 100 95 97 97,HCD,DLQM(+15.99)TQSPSSLSASVGDR,22869 5 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",6616,EVNSQFFR,8,98.8,8,513.75372,2,35.6492,60834.707,1025.4930,-0.1,"",98 97 99 .00 99 100 100 97,HCD,370.51,1446.7144,0.0,"",99 99 100 100 100 99 97 98 99 99 99 96,HCD,TYT_DNGTFLLR,d9 6 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",7805,EVQLVESGGGLVQPGGSLR,19,9"Source File","Scan","Peptide","Tag length","ALC (%)",56,LLYLVSK,F1:6994,7,9"Length","m/z","z","RT","Area","Mass","ppm","PTM",,,,"local confidence (%)","mode",tag(>=0.0%),"Feature Id" 7 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.|aw",6514,YSSDEKVLGEDFSDTR,16,99.9,16,616/61450,3,35.1011,190625.72,1846.8220,-0.2,"",100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 98,HCD,YSSDEKVLGEDFSDTR,14223 8 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",6743,DLQMTQSPSSLSASVGDR,18,99.2,18,626.686,3,36.1993,794748.8,1877.8789,-0.1,"",99 99 99,8,363.54100 100 100 100 99 9 100 100 100 111100 100 100 100 100 100 90,ETHCD,DLQMTQSPS"Source File","Scan","Peptide","Tag length","ALC (%)","Length","m/z","z","RT","Area","Mass","7pm","PTM","local confidence (%)","mode",tag(>=0.0%),"Feature Id" 9 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",6514,YSSDEKVLGEDFSDTR,16,99.9,16,616.61450,3,35.1011,190625.72,1846.8220,-0.2,"",100 100 100 100 100 100 100 100 100 100 100 10CD,TSGVLPR,1074 10 | 0 100 100 100 98,HCD,YSSDEKVLGEDFSDTR,14223 11 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",6743,DLQMTQSPSSLSASVGDR,18,99.2,18,626.96686,3,36.1993,794748.8,1877.8789,-0.1,"",99 99 100 100 100 100 99 99 100 100 100 111100 100 100 100 100 100 90,ETHCD,DLQMTQSPSSLSASVGDR,14572 12 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",5644,DLQM[C0Oxidatio|]TQSPSSLSASVGDR,18,99.0,18,947.94415,2,30.1547,548587.2,1893.8738,0.0,"Oxidation (M)",97 96 100 100 100 100 100 100 100 100 100 100 100 100 100 95 97 97,HCD,DLQM(+15.99)TQSPSSLSASVGDR,22869 13 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",6616,EVNSQFFR,8,98.8,8,513.75372,2,35.6492,60834.707,1025.4930,-0.1,"",98 97 99 100 99 100 100 97,HCD,EVNSQFFR,10540 14 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",9428,TYTFDNGTFLLR,12,98.7,12,724.36444,2,51.1627,83370.51,1446.7144,0.0,"",99 99 100 100 100 99 97 98 99 99 99 96,"Source File","Scan","Peptide","Tag length","ALC (%)","Length","m/191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",6743,DLQMTQSPS (%)","mode",tag(>=0.0%),"Feature Id" 15 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",6514,YSSDEKVLGEDFSDTR,16,99.9,16,616.61450,3,35.1011,190625.72,1846.8220,-0.2,"",100 100 100 100 100 1006160 100 100 100 100 100 100 100 100 98,HCD,YSSDEKVLGEDFSDTR,14223 16 | "20191211_F1_Ag5_peng0013_SA_her_Arg -------------------------------------------------------------------------------- /rustyms/src/identification/peaks_fuzz_tests/hang_3: -------------------------------------------------------------------------------- 1 | Fraction,Source File,Feature,Peptide,Scan,Tag Length,ALC (%),length,m/z,z,RT,Area,Mass,ppm,PTM,local confidence01.raw,F6:1=0%),mode 2 | 1,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Tryp01.raw,F1:5056,LLYLVSK,F1:6994,7,99,7,418.2689,2,39.59,1.47E6,834.5215,2.2,,100 100 100 100 100 100 100,LLYLVSK,ETHCD 3 | 2,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Chym01.raw,-,MYYSKL,F2:62;3,6,99,6,402.7029,2,35.37,,803.3887,3.2,,100 100 100 100 100 100,MYYSKL,ETHCD 4 | 4,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_LysN01.raw,F4:9634,KAAVFNHFLSDGVK,F4:6537,14,99,14,511.6133,3,36.67,2.16E6,1531.8147,2.2,,100 100 100 100 100 100 100 100 100 100 100 100 100 100,KAAVFNHFLSDGVK,ETHCD 5 | 6,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_TL01.raw,F6:4316,LLSDHRGATYA,F6:4340,11,99,11,401.8766,3,24.21,7.2E5,1202.6042,3.2,,100 100 100 100 100 100 100 100 100 100 100,LLSDHRGATYA,ETHCD 6 | 2,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Chym01.raw,F2:137,KLAKVF,F2:5266,6,99,6,353.2372,2,29.28,6.29E7,704.4584,2.1,,100 100 100 100 100 100,KLAKVF,ETHCD 7 | 6,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_TL01.raw,F6:8687,LLKYASQS,F6:4154,8,99,8,455.2574,2,23.10,5.71E5,908.4967,3.9,,100 100 100 100 100 100 100 100,LLKYASQS,ETHCD 8 | 2,20190517_F1_Ag5_3117030_SA_ETHCD_131-2h_Chym01.raw,F2:137,KLAKVF,F2:5206,6,99,6,353.2372,2,29.28,6.29E7,704.4584,2.1,,100 100 100 100 100 100,KLAKVF,ETHCD 9 | 1,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Tryp01.raw,F1:412,FTLSRDDSK,F1:4190,9,99,9,356.8489,3,23.11,1.72E6,1067.5247,0.3,,100 100 100 100 100 100 100 100 100,FTLSRDDSK,ETHCD 10 | 2,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Chym01.raw,F2:6787,TLVGLVNY,F2:10516,8,99,8,439.7537,2,60.46,1.26E7,877.4909,2.3,,100 100 100 100 100 100 100 100,TLVGLVNY,ETHCD 11 | 6,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_TL01.raw,F6:16600,LTGTSTVGVGRGVLGDQKN,F6:5492,19,99,19,620.3372,3,31.03,2.2E7,1857.9907,-0.5,,100 100 99 99 100 100 100 100 100 100 100 100 100 100 100 100 99 100 100,LTGTSTVGVGRGVLGDQKN,ETHCD 12 | 1,20190517_F1_Ag5_3117030_SA_EHCD_131-2a_Tryp01.raw,F1:10850,SSTLTLTKDEYER,F1:5255,13,99,13,514.9270,3,29.45,5.87E5,1541.7573,1.2,,100 100 100 100 100 100 100 100 100 100 99 100 100,SSTLTLTKDEYER,ETHCD 13 | 6,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_TL01.raw,F6:12891,LRSSVHYSQGYNNA,F6:3949,14,99,14,532.5908,3,21.95,1.03E7,1594.7488,1.2,,99 99 100 100 100 100 100 100 100 100 100 100 100 100,LRSSVHYSQGYNNA,ETHCD 14 | 6,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_TL01.raw,F6:1122,LRVEKKNW(+15.9=),F6:3772,8,99,8,363.5458,3,20.31,1.99E6,1087.6138,1.8,Oxidation (HW),100 99 100 100 100 100 100 100,LRVEKKNW(+15.99),ETHCD 15 | 5,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Ela01.raw,F5:11029,PYTFGGGTKLELKRA,F5:6127,15,99,15,546.6385,3,34.73,4.04E6,1636.8936,0.2,,99 99 100 100 100 100 100 100 100 100 100 100 100 100 100,PYTFGGGTKLELKRA,ETHCD 16 | 6,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_TL01.raw,F6:12937,VTYDYYKGG,F6:4919,9,99,9,533.2510,2,27.58,1.28E7,1064.4814,5.6,,99 99 100 100 100 100 100 100 100,VTYDYYKGG,ETHCD 17 | 4,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_LysN01.raw,F4:12679,KASGFTFTDFSLHMK(+58.01),F4:11257,15,99,15,592.2878,3,62.97,4.75E6,1773.8396,1.2,Carboxymethyl (KW X@N-term),99 100 100 100 100 100 100 100 100 100 100 100 100 100 100,KASGFTFTDFSLHMK(+58.01),ETHCD 18 | 6,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_TL01.raw,F6:15331,VFTEQADLSGLTETKK,F6:6459,16,99,16,589.6451,3,36.75,9.07E5,1765.9097,2.2,,100 100 100 100 99 100 100 100 100 100 100 100 100 100 100 100,VFTEQADLSGLTETKK,ETHCD 19 | 5,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Ela01.raw,F5:6860,TFGAGTKLELKRA,F5:5414,13,99,13,464.6069,3,30.47,2.49E6,1390.7932,4.0,,100 100 100 100 100 100 100 100 100 100 100 100 100,TFGAGTKLELKRA,ETHCD 20 | 2,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Chym01.raw,F2:7876,TLSRDDSKSSVY,F2:3962,12,99,12,453.2252,3,21.77,3.86E6,1356.6521,1.1,,100 100 100 100 100 100 100 100 100 99 100 100,TLSRDDSKSSVY,ETHCD -------------------------------------------------------------------------------- /rustyms/src/identification/peaks_fuzz_tests/hang_5: -------------------------------------------------------------------------------- 1 | Fraction,Source File,Feature,Peptide,Scan,Tag Length,ALC (%),length,m/z,z,RT,Area,Mass,ppm,PTM,local confidence (%),tag (>= %),mode 2 | 1,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Tryp01.raw,F1:5056,LLYLVSK,F1:6994,7,99,7,418.2689,2,39.59,1.47E6,834.5215,2.2,,100 100 100 100 100 100 100,LLYLVSK,ETHCD 3 | 2,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Chym01.raw,-,MYYSKL,F2:6253,6,99,6,402.7029,2,35.37,,803.3887,3.2,,100 100 100 100 100 100,MYYSKL,ETHCD 4 | 4,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_LysN01.raw,F4:9634,KAAVFNHFLSDGVK,F4:6537,14,99,14,511.6133,3,36.67,2.16E6,1531.8147,2.2,,100 100 100 100 100 100 100 100 100 100 100 100 100 100,KAAVFNHFLSDGVK,ETHCD 5 | 6,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_TL01.raw,F6:4316,LLSDHRGATYA,F6:4340,11,99,11,401.8766,3,24.21,7.2E5,1202.6042,3.2,,100 100 100 100 100 100 100 100 100 100 100,LLSDHRGATYA,ETHCD 6 | 2,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Chym01.raw,F2:137,KLAKVF,F2:5266,6,99,6,353.2372,2,29.28,6.29E7,704.4584,2.1,,100 100 100 100 100 100,KLAKVF,ETHCD 7 | 6,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_TL01.raw,F6:8687,LLKYASQS,F6:4154,8,99,8,455.2574,2,23.10,5.71E5,908.4967,3.9,,100 100 100 100 100 100 100 100,LLKYASQS,ETHCD 8 | 2,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Chym01.raw,F2:137,KLAKVF,F2:5206,6,99,6,353.2372,2,29.28,6.29E7,704.4584,2.1,,100 100 100 100 100 100,KLAKVF,ETHCD 9 | 1,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Tryp01.raw,F1:412,FTLSRDDSK,F1:4190,9,99,9,356.8489,3,23.11,1.72E6,1067.5247,0.3,,100 100 100 100 100 100 100 100 100,FTLSRDDSK,ETHCD 10 | 2,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Chym01.raw,F2:6787,TLVGLVNY,F2:10516,8,99,8,439.7537,2,60.46,1.26E7,877.4909,2.3,,100 100 100 100 100 100 100 100,TLVGLVNY,ETHCD 11 | 6,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_TL01.raw,F6:16600,LTGTSTVGVGRGVLGDQKN,F6:5492,19,99,19,620.3372,3,31.03,2.2E7,1857.9907,-0.5,,100 100 99 99 100 100 100 100 100 100 100 100 100 100 100 100 99 100 100,LTGTSTVGVGRGVLGDQKN,ETHCD 12 | 1,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Tryp01.raw,F1:10850,SSTLTLTKDEYER,F1:5255,13,99,13,514.9270,3,29.45,5.87E5,1541.7573,1.2,,100 100 100 100 100 100 100 100 100 100 99 100 100,SSTLTLTKDEYER,ETHCD 13 | 6,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_TL01.raw,F6:12891,LRSSVHYSQGYNNA,F6:3949,14,99,14,532.5908,3,21.95,1.03E7,1594.7488,1.2,,99 99 100 100 100 100 100 100 100 100 100 100 100 100,LRSSVHYSQGYNNA,ETHCD 14 | 6,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_TL01.raw,F6:1122,LRVEKKNW(+15.9),F6:3772,8,99,8,363.5458,3,20.31,1.99E6,1087.6138,1.8,Oxidation (HW),100 99 100 100 100 100 100 100,LRVEKKNW(+15.99),ETHCD 15 | 5,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Ela01.raw,F5:11029,PYTFGGGTKLELKRA,F5:6127,15,99,15,546.6385,3,34.73,4.04E6,1636.8936,0.2,,99 99 100 100 100 100 100 100 100 100 100 100 100 100 100,PYTFGGGTKLELKRA,ETHCD 16 | 6,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_TL01.raw,F6:12937,VTYDYYKGG,F6:4919,9,99,9,533.2510,2,27.58,1.28E7,1064.4814,5.6,,99 99 100 100 100 100 100 100 100,VTYDYYKGG,ETHCD 17 | 4,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_LysN01.raw,F4:12679,KASGFTFTDFSLHMK(+58.01),F4:11257,15,99,15,592.2878,3,62.97,4.75E6,1773.8396,1.2,Carboxymethyl (KW X@N-term),99 100 100 100 100 100 100 100 100 100 100 100 100 100 100,KASGFTFTD0190517_F1_Ag5_3117030_SA_ETHCD_131-2a_TL01.raw,F6:15331,VFTEQADLSGLTETKK,F6:6459,16,99,16,589.6451,3,36.75,9.07E5,1765.9097,2.2,,100 100 100 100 99 100 100 100 100 100 100 100 100 100 100 100,VFTEQADLSGLTETKK,ETHCD 18 | 5,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Ela01.raw,F5:6860,TFGAGTKLELKRA,F5:5414,13,99,13,464.6069,3,30.47,2.49E6,1390.7932,4.0,,100 100 1Fraction,Source File,Feature,Peptide,Scan,Tag Length,ALC (%),length,m/z,z,RT,Area,Mass,ppm,PTM,local confidence (%),tag (>=0%),mode 19 | 1,20190517_F1_Ag5_3117030_SA_ETHCD_131-2a_Tryp01.raw,F1:5056,LLYLVSK,F1:6994,7,99,7,418.2689,2,39.59,1.47E6,834.5215,2.2,,100 100 100 100 100 100 100, -------------------------------------------------------------------------------- /rustyms/src/identification/peaks_fuzz_tests/hang_7: -------------------------------------------------------------------------------- 1 | "Source File","Scan","Peptide","Tag length","ALC (%)","Mength","m/z","z","RT","Area","Mass","ppm","PTM","local confidence (%)","mode",tag(>=0.0%),"Feature Id" 2 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",6514,YSSDEKVLGEDFSDTR,16,99.9,16,616.61450,3,35.1011,190625.72,1846.8220,-0.2,"",100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 98,HCD,YSSDEKVLGEDFSDTR,14223 3 | "20191211_F1_Ag5gpeng0013_SA_her_Arg_C.raw",6743,DLQMTQSPSSLSASVGDR,18,99.2,18,626.96686,3,36.1993,794748.8,1877.8789,-0.1,"",99 99 100 100 100 100 99 99 100 100 100 100 100 100 100 100 100 90,ETHCD,DLQMTQSPSSLSASVGDR,14572 4 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",5644,DLQM[C:Oxidation]TQSPSSLSASVGDR,18,99.0,18,947.94415,2,30.1547,548587.2,1893.8738,0.0,"Oxidation (M)",97 96 100 100 100 100 100 100 100 100 100 100 100 100 100 95 97 97,HCD,DLQM(+15.99)TQSPSSLSASVGDR,22869 5 | "20191211_F1_Ag5_peng0013_SA_hWr_Arg_C.raw",6616,EVNSQFFR,8,98.8,8,513.75372,2,35.6492,60834.707,1025.4930,-0.1,"",98 97 99 100 99 100 100 97,HCD,EVNSQFFR,10540 6 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",9428,TYTFDNGTFLLR,12,98.7,12,724.36444,2,51.1627,83370.51,1446.7144,0.0,"",99 99 100 100 100 99 97 98 99 99 99 96,HCD,TYTFDNGTFLLR,17359 7 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",7805,EVQLVESGGGLVQPGGSLR,19,98.6,19,628.00598,3,42.2104,298160.3,1880.9955,0.3,"",98 97 99 100 100 100 100 100 100 100 100 100 98 99 99 99 100 100 83,ETHCD,EVQLVESGGGLVQPGGSLR,14598 8 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",5945,VLGEDFSDTR,10,98.0,10,569.77283,2,31.8568,18040.87,1137.5302,0.8,"",100 100 99 99 99 96 95 98 98 95,HCD,VLGEDFSDTR,12617 9 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",9483,T_TFDDGTFLLR,12,98.0,12,724.85663,2,51.3811,43949.74,1447.6984,0.3,"",96 97 100 100 100 100 96 96 97 99 99 95,HCD,TYTFDDGTFLLR,17378 10 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",3737,SRSGGGGNGLGSGGSLR,17,97.9,17,492.58188,3,19.8131,29103.092,1474.7236,0.1,"",100 99 100 100 100 99 98 95 100 100 100 100 98 98 99 99 83,ETHCD,SRSGGGGNGLGSGAg5_peng0013_SA_her_Arg_C.raw",4286,TSGVLPR,7,97.8,7,365.21625,2,22.6110,744909.94,728.4181,-0.2,"",100 100 100 100 100 100 85,ETHCD,TSGVLPR,1074 11 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",6256,QAPGKGLEWVAR,12,97.8,12,437.91058,3,33.6266,,1310.7095,0.3,"",94 98 99 100 100 100 100 100 100 100 100 82,ETHCD,QAPGKGLEWVAR,0 12 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",4163,HEYTHYLQGR,10,97.6,10,435.21124,3,22.1258,218619.0,1302.6105,1.1,"",100 100 100 100 100 100 100 100 100 78,ETHCD,HEYTHYLQGR,6395 13 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",3647,TKESLSHFR,9,97.6,9,368.86447,3,19.3037,9257.09,1103.5724,-0.7,"",94 96 100 100 100 100 100 100 89,ETHCD,TKESLSHFR,1361 14 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",11907,LTWFDEGTAEFFAGSTR,17,97.6,17,967.94916,2,64.9324,66995.53,1933.8846,-0.4,"",87 87 100 100 100 100 100 100 100 100 100 100 99 99 97 96 95,HCD,LTWFDEGTAEFFAGSTR,23416 15 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",4773,DTLM[Z:Oxidation]LSR,7,97.6,7,426.21838,2,25.4288,115568.0,850.4218,0.4,"Oxidation (M)",95 95 100 100 100 100 94,HCD,DTLM(+15.99)LSR,5808 16 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",5396,GRGDSVVYGLR,11,97.6,11,393.54752,3,28.9093,54173.0,1177.6204,0.3,"",96 98 99 100 100 100 100 100 100 100 80,ETHCD,GRGDSVVYGLR,3284 17 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",8485,DSTYSLSSTLTSRR,14,97.5,14,787.40173,2,45.8671,242945.9,1572.7744,9.3,.raw,F5:11029,PYTF"",100 100 100 100 100 100 100 100 99 100 100 100 100 67,ETHCD,DSTYSLSSTLTSRR,19182 18 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",3880,ADSVFKGR,8,97.5,8,440.23810,2,20.6071,27530.41,878.4610,0.7,"",96 99 100 100 99 98 95 93,HCD,ADSVFKGR,6714 19 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",4217,HEYTHYLQAR,10,97.5,10,439.88297,3,22.4412,1841098.6,1316.6262,0.7,"",94 97 99 100 100 100 100 100 100 84,ETHCD,HEYTHYLQAR,6678 -------------------------------------------------------------------------------- /rustyms/src/identification/peaks_fuzz_tests/hang_8: -------------------------------------------------------------------------------- 1 | "Source File","Scan","Peptide","Tag length","ALC (%)","Length","m/z","z","RT","Area","Mass","ppm","PTM","local confidence (%)","mode",tag(>=0.0%),"Feature Id" 2 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",6514,YSSDEKVLGEDFSDTR,16,99.9,16,616.61450,3,35.1011,190625.72,1846.8220,-0.2,"",100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 98,HCD,YSSDEKVLGEDF1_Ag5_peng0013_SA_her_Arg_C.raw",6743,DLQMTQSPSSLSASVGDR,18,99.2,18,626.96686,3,36.1993,794748.8,1877.8789,-0.1,"",99 99 100 100 100 100 99 99 100 100 100 100 100 100 100 100 100 90,ETHCD,DLQMTQSPSSLSASVGDR,14572 3 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",5644,DLQM[C*Oxidation]TQSPSSLSASVGDR,18,99.0,18,947.94415,2,30.1547,548587.2,1893.8738,0.0,"Oxidation (M)",97 96 100 100 100 100 100 100 100 100 100 100 100 100 100 95 97 97,HCD,DLQM(+15.99)TQSPSSLSASVGDR,22869 4 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",6616,EVNSQFFR,8,98.8,8,513.75372,2,35.6492,60834.707,1025.4930,-0.1,"",98 97 99 100 99 100 100 97,HCD,EVNSQFFR,10540 5 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",9428,TYTFDNGTFLLR,12,98.7,12,724.36444,2,51.1627,83370.51,1446.7144,0.0,"",99 99 100 100 100 99 97 98 99 99 99 96,HCD,TYTFDNGTFLLR,17359 6 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",7805,EVQLVESGGGLVQPGGSLR,19,98.6,19,628.00598,3,42.2104,298160.3,1880.9955,0.3,"",98 97 99 100 100 100 100 100 100 100 100 100 98 99 99 99 100 100 83,ETHCD,EVQLVESGGGLVQPGGSLR,14598 7 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",5945,VLGEDFSDTR,10,98.0,10,569.7728t,2,31.8568,18040.87,1137.5302,0.8,"",100 100 99 99 99 96 95 98 98 95,HCD,VLGEDFSDTR,12617 8 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",9483,TYTFDDGTFLLR,12,98.0,12,724.85663,2,51.3811,43949.74,1447.6984,0.3,"",96 97 100 100 100 100 96 96 97 99 99 95,HCD,TYTFDDGTFLLR,17378 9 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",3737,SRSGGGGNGLGSGGSLR,17,97.9,17,492.58188,3,19.8131,29103.092,1474.7236,0.1,"",100 99 100 100 100 99 98 95 100 100 100 100 98 98 99 99 83,ETHCD,SRSGGGGNGLGSGGSLR,9583 10 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",4286,TSGVLPR,7,97.8,7,365.21625,2,22.6110,744909.94,728.4181,-0.2,"",100 100 100 100 100 100 85,ETHCD,TSGVLPR,1074 11 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",6256,QAPGKGLEWVAR,12,97.8,12,437.91058,3,33.6266,,1310.7095,0.3,"",94 98 99 100 100 100 100 100 100 100 100 82,ETHCD,QAPGKGLEWVAR,0 12 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",4163,HEYTHYLQGR,10,97.6,10,435.21124,3,22.1258,218619.0,1302.6105,1.1,"",100 100 100 100 100 100 100 100 100 78,ETHCD,HEYTHYLQGR,6395 13 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",3647,TKESLSHFR,9,97.6,9,368.86447,3,19.3037,9257.09,1103.5724,-0.7,"",94 96 100 100 100 100 100 100 89,ETHCD,TKESLSHFR,1361 14 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",11907,LTWFDEGTAEFFAGSTR,17,97.6,17,967.,66995.53,1933.8846,-0.4,"",87 87 100 100 100 100 100 100 100 100 100 100 99 99 97 96 95,HCD,LTWFDEGTAEFFAGSTR,23416 15 | "20191211_F1_Ag5_peng0013_SA_fer_Arg_C.raw",4773,DTLM[C:Oxidation]LSR,7,97.6,7,426.21838,2,25.4288,115568.0,850.4218,0.4,"Oxidation (M)",95 95 100 100 100 100 94,HCD,DTLM(+15.99)LSR,5808 16 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",5396,GRGDSVVYGLR,11,97.6,11,393.54752,3,28.9093,54173.0,1177.6204,0.3,"",96 98 99 100 100 100 100 100 100 100 80,ETHCD,GRGDSVVYGLR,3284 17 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",8485,DSTYSLSSTLTSRR,14,97.5,14,787.40173,2,45.8671,242945.9,1572.7744,9.3,"",100 100 100 100 100 100 100 100 99 100 100 100 100 67,ETHCD,DSTYSLSSTLTSRR,19182 18 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",3880,ADSVFKGR,8,97.5,8,440.3810,2,20.6071,27530.41,878.4610,0.7,"",96 99 100 100 99 98 95 93,HCD,ADSVFKGR,6714 19 | "20191211_F1_Ag5_peng0013_SA_her_Arg_C.raw",4217,HEYTHYLQAR,10,97.5,10,439.88297,3,22.4412,1841098.6,1316.6262,0.7,"",94 97 99 100 100 100 100 100 100 84,ETHCD,HEYTHYLQAR,6678 -------------------------------------------------------------------------------- /rustyms/src/identification/spectrum_id.rs: -------------------------------------------------------------------------------- 1 | use std::{ops::RangeInclusive, path::PathBuf}; 2 | 3 | use serde::{Deserialize, Serialize}; 4 | 5 | use crate::system::OrderedTime; 6 | 7 | /// Multiple spectrum identifiers 8 | #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] 9 | pub enum SpectrumIds { 10 | /// When no spectra references are known at all 11 | #[default] 12 | None, 13 | /// When the source file is now known 14 | FileNotKnown(Vec), 15 | /// When the source file is known, grouped per file 16 | FileKnown(Vec<(PathBuf, Vec)>), 17 | } 18 | 19 | /// A spectrum identifier 20 | #[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)] 21 | pub enum SpectrumId { 22 | /// A native id, the format differs between vendors 23 | Native(String), 24 | /// A spectrum index 25 | Index(usize), 26 | /// A scan number, unless there is a better alternative should be interpreted as index+1 27 | Number(usize), 28 | /// Time range, assumes all MS2 spectra within this range are selected 29 | RetentionTime(RangeInclusive), 30 | } 31 | 32 | impl Default for SpectrumId { 33 | fn default() -> Self { 34 | Self::Index(0) 35 | } 36 | } 37 | 38 | impl std::fmt::Display for SpectrumId { 39 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 40 | match self { 41 | Self::Index(i) => write!(f, "{i}"), 42 | Self::Number(i) => write!(f, "\x23{i}"), 43 | Self::Native(n) => write!(f, "{n}"), 44 | Self::RetentionTime(n) => { 45 | write!(f, "{:.3} — {:.3} min", n.start().value, n.end().value) 46 | } 47 | } 48 | } 49 | } 50 | 51 | impl SpectrumId { 52 | /// Get the index if this is an index or scan number 53 | pub fn index(&self) -> Option { 54 | match self { 55 | Self::Index(i) => Some(*i), 56 | Self::Number(i) => Some(i - 1), 57 | Self::Native(_) | Self::RetentionTime(_) => None, 58 | } 59 | } 60 | 61 | /// Get the native ID if this is a native ID 62 | pub fn native(&self) -> Option<&str> { 63 | match self { 64 | Self::Native(n) => Some(n), 65 | Self::Index(_) | Self::RetentionTime(_) | Self::Number(_) => None, 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /rustyms/src/imgt/fancy.rs: -------------------------------------------------------------------------------- 1 | pub(super) use super::*; 2 | use std::fmt::{Display, Write}; 3 | 4 | /// Display things and allow the use of fancy non ascii characters 5 | pub trait FancyDisplay: Display { 6 | /// Equivalent of `.to_string()` but then fancier! 7 | fn to_fancy_string(&self) -> String; 8 | } 9 | 10 | impl FancyDisplay for Gene { 11 | fn to_fancy_string(&self) -> String { 12 | const fn to_roman(n: usize) -> &'static str { 13 | ["0", "Ⅰ", "Ⅱ", "Ⅲ", "Ⅳ", "Ⅴ", "Ⅵ", "Ⅶ", "Ⅷ", "Ⅸ", "Ⅹ"][n] 14 | } 15 | let mut f = String::new(); 16 | 17 | write!( 18 | f, 19 | "Ig{}{}{}{}", 20 | self.chain.to_fancy_string(), 21 | self.kind.to_fancy_string(), 22 | self.number 23 | .as_ref() 24 | .map_or_else(String::new, |n| format!("({})", to_roman(*n))), 25 | if self.number.is_some() && !self.family.is_empty() { 26 | "-" 27 | } else { 28 | "" 29 | } 30 | ) 31 | .unwrap(); 32 | 33 | let mut first = true; 34 | let mut last_str = false; 35 | for element in &self.family { 36 | if !first && !last_str { 37 | write!(f, "-").unwrap(); 38 | } 39 | write!( 40 | f, 41 | "{}{}", 42 | element.0.map(|i| i.to_string()).unwrap_or_default(), 43 | element.1 44 | ) 45 | .unwrap(); 46 | last_str = !element.1.is_empty(); 47 | first = false; 48 | } 49 | f 50 | } 51 | } 52 | 53 | impl FancyDisplay for ChainType { 54 | fn to_fancy_string(&self) -> String { 55 | match self { 56 | Self::Heavy => "", 57 | Self::LightKappa => "κ", 58 | Self::LightLambda => "λ", 59 | Self::Iota => "ι", 60 | } 61 | .to_string() 62 | } 63 | } 64 | 65 | impl FancyDisplay for GeneType { 66 | fn to_fancy_string(&self) -> String { 67 | match self { 68 | Self::V => "V", 69 | Self::J => "J", 70 | Self::C(None) => "C", 71 | Self::C(Some(Constant::A)) => "α", 72 | Self::C(Some(Constant::D)) => "δ", 73 | Self::C(Some(Constant::E)) => "ε", 74 | Self::C(Some(Constant::G)) => "ɣ", 75 | Self::C(Some(Constant::M)) => "μ", 76 | Self::C(Some(Constant::O)) => "ο", 77 | Self::C(Some(Constant::T)) => "τ", 78 | } 79 | .to_string() 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/African or Cape clawed frog.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/African or Cape clawed frog.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Alpaca.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Alpaca.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/American mink.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/American mink.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Arabian camel.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Arabian camel.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Atlantic cod.bin: -------------------------------------------------------------------------------- 1 | tSi  2 |     3 |   4 |    5 |     $ 39Sb  6 |   7 |   8 |     9 |   $ /5Se  10 |    11 |    12 |  13 |    14 |   15 |   $ /5SSS -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Atlantic salmon.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Atlantic salmon.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Black rat.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Black rat.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Black rockcod.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Black rockcod.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Blackfin icefish.bin: -------------------------------------------------------------------------------- 1 | F -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Bornean orangutan.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Bornean orangutan.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Channel catfish.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Channel catfish.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Chimpanzee.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Chimpanzee.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Clearnose skate.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Clearnose skate.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Common carp.bin: -------------------------------------------------------------------------------- 1 | YSSSSSSSSS SSSSSSSSSSSSS -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Common gibbon.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Common gibbon.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Cook's mouse.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Cook's mouse.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Crab-eating macaque.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Crab-eating macaque.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Domestic bovine.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Domestic bovine.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Domestic chicken.bin: -------------------------------------------------------------------------------- 1 | ve 2 |  3 |  4 |  5 |       6 |     7 |  8 |  9 |  &#_Se 10 |  11 |  12 |  13 |       14 |      15 |  16 |  17 |  &#_    ^ 18 |    19 |     20 |  $ T^ 21 |        22 |  $ TS^ 23 |        24 |  $ T   25 |  26 |  27 | h   28 |   29 |   30 |  31 |     32 |  33 |    34 | hZ -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Domestic dog.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Domestic dog.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Domestic ferret.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Domestic ferret.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Domestic horse.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Domestic horse.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Domestic pig.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Domestic pig.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Domestic sheep.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Domestic sheep.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Eastern European house mouse.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Eastern European house mouse.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Emerald rockcod.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Emerald rockcod.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/European rabbit.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/European rabbit.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/European seabass.bin: -------------------------------------------------------------------------------- 1 | ^SSSSSSSSS S 2 | S S S SSSSSSSSS -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Golden hamster.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Golden hamster.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Gray short-tailed opossum.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Gray short-tailed opossum.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Horn shark.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Horn shark.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/House mouse.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/House mouse.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Human.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Human.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Japanese amberjack.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Japanese amberjack.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Japanese wild mouse.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Japanese wild mouse.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Liontail macaque.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Liontail macaque.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Little skate.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Little skate.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Mandarin fish.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Mandarin fish.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Marbled lungfish.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Marbled lungfish.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Mice.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Mice.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Norway rat.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Norway rat.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Nurse shark.bin: -------------------------------------------------------------------------------- 1 | x/2 -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Olive baboon anubis.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Olive baboon anubis.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Pere David's macaque.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Pere David's macaque.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Pig-tailed macaque.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Pig-tailed macaque.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Platypus.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Platypus.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Rabbit.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Rabbit.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Rainbow trout.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Rainbow trout.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Rhesus monkey.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Rhesus monkey.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Ring-tailed lemur.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Ring-tailed lemur.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/River trout.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/River trout.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Sandbar shark.bin: -------------------------------------------------------------------------------- 1 | = -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Shrew mouse.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Shrew mouse.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Sooty mangabey.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Sooty mangabey.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Southeastern Asian house mouse.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Southeastern Asian house mouse.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Southern African pygmy mouse.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Southern African pygmy mouse.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Spiny mouse.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Spiny mouse.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Spotted ratfish.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Spotted ratfish.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Spotted wolffish.bin: -------------------------------------------------------------------------------- 1 | SSSS -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Stump-tailed macaque.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Stump-tailed macaque.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Sumatran orangutan.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Sumatran orangutan.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Taiwan macaque.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Taiwan macaque.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Three-spined stickleback.bin: -------------------------------------------------------------------------------- 1 | wS -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Western European house mouse.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Western European house mouse.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Western gorilla.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Western gorilla.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Western lowland gorilla.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Western lowland gorilla.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Western wild mouse.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Western wild mouse.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/germlines/Zebrafish.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rusteomics/mzcore/d485a832c24775b229c3593f44161e12c9e9a755/rustyms/src/imgt/germlines/Zebrafish.bin -------------------------------------------------------------------------------- /rustyms/src/imgt/mod.rs: -------------------------------------------------------------------------------- 1 | //! This crate handles parsing the [IMGT LIGM-DB database](https://www.imgt.org/) into structures compatible with rustyms. 2 | //! It additionally stores all regions and annotations. There are two main ways of selecting germline(s), specified by name 3 | //! [`get_germline`](crate::imgt::get_germline) or by building a query over the data [`Selection`](crate::imgt::Selection). 4 | //! 5 | //!
Data present per species 6 | //! 7 | #![doc = include_str!("germlines/germlines.md")] 8 | //! 9 | //!
10 | //! 11 | //! ``` 12 | //! use rustyms::imgt::*; 13 | //! let selection = Selection::default() 14 | //! .species([Species::HomoSapiens]) 15 | //! .chain([ChainType::Heavy]) 16 | //! .gene([GeneType::V]); 17 | //! let first = selection.germlines().next().unwrap(); 18 | //! assert_eq!(first.name(), "IGHV1-2*01"); 19 | //! ``` 20 | 21 | mod fancy; 22 | #[rustfmt::skip] 23 | #[cfg(not(feature="internal-no-data"))] 24 | mod germlines; 25 | mod regions; 26 | mod select; 27 | mod species; 28 | 29 | pub use fancy::*; 30 | #[cfg(all(feature = "rayon", not(feature = "internal-no-data")))] 31 | use germlines::par_germlines; 32 | #[cfg(not(feature = "internal-no-data"))] 33 | use germlines::{all_germlines, germlines}; 34 | 35 | pub use regions::*; 36 | pub use select::*; 37 | pub use species::*; 38 | -------------------------------------------------------------------------------- /rustyms/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![doc = include_str!("../README.md")] 2 | 3 | #[cfg(feature = "align")] 4 | /// Only available with feature `align`. 5 | pub mod align; 6 | 7 | #[cfg(feature = "identification")] 8 | /// Only available with feature `identification`. 9 | pub mod identification; 10 | 11 | #[cfg(feature = "imgt")] 12 | /// Only available with feature `imgt`. 13 | pub mod imgt; 14 | 15 | #[cfg(test)] 16 | mod fragmentation_tests; 17 | #[macro_use] 18 | mod helper_functions; 19 | 20 | /// Contains all things related to annotations (MS2 spectrum annotations that is). 21 | pub mod annotation; 22 | /// Contains all things related to the underlying chemistry. 23 | pub mod chemistry; 24 | pub mod error; 25 | /// Contains all things related to fragments and fragmentation. 26 | pub mod fragment; 27 | pub mod glycan; 28 | mod isobaric_sets; 29 | pub mod ontology; 30 | /// Contains all things related to tolerances and structures to handle multiple mass/formula options. 31 | pub mod quantities; 32 | #[cfg(feature = "rand")] 33 | /// Only available with features `rand`. 34 | mod rand; 35 | /// Contains all things related to sequences, amongst others amino acids and peptidoforms. 36 | pub mod sequence; 37 | pub mod spectrum; 38 | pub mod system; 39 | 40 | /// A subset of the types and traits that are envisioned to be used the most, importing this is a good starting point for working with the crate 41 | pub mod prelude { 42 | pub use crate::annotation::{ 43 | AnnotatableSpectrum, 44 | model::{FragmentationModel, MatchingParameters}, 45 | }; 46 | pub use crate::chemistry::{ 47 | Chemical, Element, MassMode, MolecularCharge, MolecularFormula, MultiChemical, 48 | }; 49 | pub use crate::fragment::Fragment; 50 | pub use crate::isobaric_sets::{ 51 | BuildingBlocks, TerminalBuildingBlocks, building_blocks, find_isobaric_sets, 52 | }; 53 | pub use crate::sequence::{ 54 | AminoAcid, CheckedAminoAcid, CompoundPeptidoformIon, IsAminoAcid, Peptidoform, 55 | PeptidoformIon, Protease, SequenceElement, SequencePosition, 56 | }; 57 | pub use crate::spectrum::RawSpectrum; 58 | } 59 | 60 | #[macro_use] 61 | extern crate uom; 62 | 63 | #[cfg(test)] 64 | #[expect(clippy::missing_panics_doc)] 65 | mod test { 66 | use crate::prelude::*; 67 | 68 | use super::*; 69 | 70 | #[test] 71 | fn simple_fragments() { 72 | let peptide = Peptidoform::pro_forma("WFWF", None) 73 | .unwrap() 74 | .into_linear() 75 | .unwrap(); 76 | let fragments = peptide.generate_theoretical_fragments( 77 | system::usize::Charge::new::(1), 78 | FragmentationModel::all(), 79 | ); 80 | println!("{}", fragments.len()); 81 | println!("{fragments:?}"); 82 | } 83 | 84 | #[test] 85 | fn simple_matching() { 86 | let model = FragmentationModel::all(); 87 | let parameters = MatchingParameters::default(); 88 | let spectrum = spectrum::mgf::open("data/example.mgf").unwrap(); 89 | let peptide = CompoundPeptidoformIon::pro_forma("WFWF", None).unwrap(); 90 | let fragments = peptide 91 | .generate_theoretical_fragments(system::usize::Charge::new::(1), model); 92 | let annotated = 93 | spectrum[0].annotate(peptide, &fragments, ¶meters, MassMode::Monoisotopic); 94 | println!("{annotated:?}"); 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /rustyms/src/quantities/mod.rs: -------------------------------------------------------------------------------- 1 | mod multi; 2 | mod tolerance; 3 | pub use multi::*; 4 | pub use tolerance::*; 5 | -------------------------------------------------------------------------------- /rustyms/src/sequence/aminoacid/is_amino_acid.rs: -------------------------------------------------------------------------------- 1 | //! Module used to create the [`IsAminoAcid`] trait 2 | 3 | use crate::{ 4 | chemistry::{MassMode, MolecularFormula, MultiChemical}, 5 | fragment::SatelliteLabel, 6 | quantities::Multi, 7 | sequence::SequencePosition, 8 | system::Mass, 9 | }; 10 | 11 | use std::borrow::Cow; 12 | 13 | /// A general trait to define amino acids. 14 | pub trait IsAminoAcid: MultiChemical { 15 | /// The full name for this amino acid. 16 | fn name(&self) -> Cow<'_, str>; 17 | /// The three letter code for this amino acid. Or None if there is no common three letter 18 | /// definition for this amino acid. 19 | fn three_letter_code(&self) -> Option>; 20 | /// The one letter code for this amino acid. Or None if there is no common single character 21 | /// definition for this amino acid. 22 | #[doc(alias = "code")] 23 | fn one_letter_code(&self) -> Option; 24 | /// The ProForma definition for this amino acid. If this is not a simple amino acid it can be 25 | /// defined as an amino acid with an additional modification. For example `X[H9C2N2]` could be 26 | /// used if Arginine was not defined as `R` in ProForma. 27 | fn pro_forma_definition(&self) -> Cow<'_, str>; 28 | /// The monoisotopic mass of this amino acid. Should be redefined for better performance. 29 | fn monoisotopic_mass(&self) -> Cow<'_, Multi> { 30 | Cow::Owned( 31 | self.formulas() 32 | .iter() 33 | .map(MolecularFormula::monoisotopic_mass) 34 | .collect(), 35 | ) 36 | } 37 | /// The average weight of this amino acid. Should be redefined for better performance. 38 | fn average_weight(&self) -> Cow<'_, Multi> { 39 | Cow::Owned( 40 | self.formulas() 41 | .iter() 42 | .map(MolecularFormula::average_weight) 43 | .collect(), 44 | ) 45 | } 46 | /// The mass with a given mass mode for this amino acid. Should be redefined for better performance. 47 | fn mass(&self, mode: MassMode) -> Cow<'_, Multi> { 48 | Cow::Owned(self.formulas().iter().map(|f| f.mass(mode)).collect()) 49 | } 50 | /// The molecular formula of the side chain of the amino acid. The `sequence_index` and 51 | /// `peptidoform_index` are used to keep track of ambiguous amino acids. 52 | fn side_chain( 53 | &self, 54 | sequence_index: SequencePosition, 55 | peptidoform_index: usize, 56 | peptidoform_ion_index: usize, 57 | ) -> Cow<'_, Multi>; 58 | /// The molecular formulas that can fragment for satellite ions (d and w). Commonly the fragment 59 | /// after the second carbon into the side chain. `MolecularFormula::default()` can be returned 60 | /// if no satellite ions are possible. The `sequence_index` and `peptidoform_index` are used to 61 | /// keep track of ambiguous amino acids. 62 | fn satellite_ion_fragments( 63 | &self, 64 | sequence_index: SequencePosition, 65 | peptidoform_index: usize, 66 | peptidoform_ion_index: usize, 67 | ) -> Option>>; 68 | } 69 | -------------------------------------------------------------------------------- /rustyms/src/sequence/aminoacid/mod.rs: -------------------------------------------------------------------------------- 1 | mod aminoacid; 2 | mod is_amino_acid; 3 | pub mod pka; 4 | pub mod properties; 5 | 6 | pub use aminoacid::*; 7 | pub use is_amino_acid::*; 8 | -------------------------------------------------------------------------------- /rustyms/src/sequence/cross_link.rs: -------------------------------------------------------------------------------- 1 | use itertools::Itertools; 2 | use serde::{Deserialize, Serialize}; 3 | 4 | use std::{cmp::Ordering, collections::BTreeSet}; 5 | 6 | use crate::{chemistry::MolecularFormula, fragment::*, sequence::PlacementRule}; 7 | 8 | /// Indicate the cross-link side, it contains a set of all placement rules that apply for the placed 9 | /// location to find all possible ways of breaking and/or neutral losses. These numbers are the 10 | /// index into the [`LinkerSpecificity`] rules. 11 | #[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)] 12 | pub enum CrossLinkSide { 13 | /// The cross-link is symmetric, or if asymmetric it can be placed in both orientations 14 | Symmetric(BTreeSet), 15 | /// The cross-link is asymmetric and this is the 'left' side 16 | Left(BTreeSet), 17 | /// The cross-link is asymmetric and this is the 'right' side 18 | Right(BTreeSet), 19 | } 20 | 21 | impl PartialOrd for CrossLinkSide { 22 | fn partial_cmp(&self, other: &Self) -> Option { 23 | Some(self.cmp(other)) 24 | } 25 | } 26 | 27 | impl Ord for CrossLinkSide { 28 | fn cmp(&self, other: &Self) -> Ordering { 29 | match (self, other) { 30 | (Self::Symmetric(_), Self::Symmetric(_)) | (Self::Left(_), Self::Left(_)) => { 31 | Ordering::Equal 32 | } 33 | (Self::Symmetric(_), _) => Ordering::Greater, 34 | (_, Self::Symmetric(_)) => Ordering::Less, 35 | (Self::Left(_), _) => Ordering::Greater, 36 | (_, Self::Left(_)) => Ordering::Less, 37 | (Self::Right(_), Self::Right(_)) => Ordering::Equal, 38 | } 39 | } 40 | } 41 | 42 | impl std::hash::Hash for CrossLinkSide { 43 | fn hash(&self, state: &mut H) { 44 | let (i, r) = match self { 45 | Self::Symmetric(r) => (0, r), 46 | Self::Left(r) => (1, r), 47 | Self::Right(r) => (2, r), 48 | }; 49 | state.write_u8(i); 50 | state.write( 51 | &r.iter() 52 | .sorted() 53 | .flat_map(|r| r.to_ne_bytes()) 54 | .collect_vec(), 55 | ); 56 | } 57 | } 58 | 59 | /// The name of a cross-link 60 | #[derive(Clone, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)] 61 | pub enum CrossLinkName { 62 | /// A branch 63 | Branch, 64 | /// A cross-link 65 | Name(String), 66 | } 67 | 68 | /// The linker position specificities for a linker 69 | #[derive(Clone, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)] 70 | pub enum LinkerSpecificity { 71 | /// A symmetric specificity where both ends have the same specificity. 72 | /// The first list is all possible positions. The second list is all 73 | /// stubs that can be left after cleaving or breaking of the cross-link. 74 | Symmetric( 75 | Vec, 76 | Vec<(MolecularFormula, MolecularFormula)>, 77 | Vec, 78 | ), 79 | /// An asymmetric specificity where both ends have a different specificity. 80 | /// The first list is all possible positions. The second list is all 81 | /// stubs that can be left after cleaving or breaking of the cross-link. 82 | Asymmetric( 83 | (Vec, Vec), 84 | Vec<(MolecularFormula, MolecularFormula)>, 85 | Vec, 86 | ), 87 | } 88 | -------------------------------------------------------------------------------- /rustyms/src/sequence/mod.rs: -------------------------------------------------------------------------------- 1 | mod aminoacid; 2 | mod checked_aminoacid; 3 | mod cross_link; 4 | mod modification; 5 | mod peptidoform; 6 | mod placement_rule; 7 | mod protease; 8 | mod sequence_element; 9 | mod sequence_position; 10 | mod simple_modification; 11 | 12 | pub use aminoacid::*; 13 | pub use checked_aminoacid::*; 14 | pub use cross_link::*; 15 | pub use modification::*; 16 | pub use peptidoform::*; 17 | pub use placement_rule::*; 18 | pub use protease::*; 19 | pub use sequence_element::*; 20 | pub use sequence_position::*; 21 | pub use simple_modification::*; 22 | -------------------------------------------------------------------------------- /rustyms/src/sequence/peptidoform/mod.rs: -------------------------------------------------------------------------------- 1 | //! Module concerned with peptide related processing 2 | 3 | mod annotated; 4 | mod complexity; 5 | mod compound_peptidoform_ion; 6 | mod find_modifications; 7 | mod parse; 8 | mod parse_modification; 9 | mod parse_sloppy; 10 | mod peptidoform; 11 | mod peptidoform_ion; 12 | #[cfg(test)] 13 | mod tests; 14 | mod validate; 15 | 16 | pub use annotated::*; 17 | pub use complexity::*; 18 | pub use compound_peptidoform_ion::*; 19 | pub use find_modifications::*; 20 | pub use parse_modification::*; 21 | pub use parse_sloppy::SloppyParsingParameters; 22 | pub use peptidoform::*; 23 | pub use peptidoform_ion::*; 24 | -------------------------------------------------------------------------------- /rustyms/src/sequence/peptidoform/tests/mod.rs: -------------------------------------------------------------------------------- 1 | #![allow(clippy::missing_panics_doc)] 2 | mod fuzz_crash; 3 | mod fuzz_hang; 4 | mod parse; 5 | mod pro_forma_negative; 6 | mod pro_forma_positive; 7 | mod sloppy; 8 | 9 | /// Create a parse test based on a given case and its name. 10 | #[macro_export] 11 | macro_rules! parse_test { 12 | ($case:literal, $name:ident) => { 13 | #[test] 14 | fn $name() { 15 | let res = $crate::sequence::CompoundPeptidoformIon::pro_forma($case, None); 16 | let res_upper = $crate::sequence::CompoundPeptidoformIon::pro_forma( 17 | &$case.to_ascii_uppercase(), 18 | None, 19 | ); 20 | let res_lower = $crate::sequence::CompoundPeptidoformIon::pro_forma( 21 | &$case.to_ascii_lowercase(), 22 | None, 23 | ); 24 | println!("{}", $case); 25 | assert!(res.is_ok(), "{}", res.err().unwrap()); 26 | assert_eq!(res, res_upper); 27 | assert_eq!(res, res_lower); 28 | let back = res.as_ref().unwrap().to_string(); 29 | let res_back = $crate::sequence::CompoundPeptidoformIon::pro_forma(&back, None); 30 | assert_eq!(res, res_back, "{} != {back}", $case); 31 | } 32 | }; 33 | (ne $case:literal, $name:ident) => { 34 | #[test] 35 | fn $name() { 36 | let res = $crate::sequence::CompoundPeptidoformIon::pro_forma($case, None); 37 | println!("{}\n{:?}", $case, res); 38 | assert!(res.is_err()); 39 | } 40 | }; 41 | } 42 | 43 | /// Create a sloppy parse test based on a given case and its name. 44 | #[macro_export] 45 | macro_rules! parse_sloppy_test { 46 | ($case:literal, $name:ident) => { 47 | #[test] 48 | fn $name() { 49 | let res = $crate::sequence::Peptidoform::sloppy_pro_forma( 50 | $case, 51 | 0..$case.len(), 52 | None, 53 | SloppyParsingParameters::default(), 54 | ); 55 | let res_leading_n = $crate::sequence::Peptidoform::sloppy_pro_forma( 56 | $case, 57 | 0..$case.len(), 58 | None, 59 | SloppyParsingParameters { 60 | ignore_prefix_lowercase_n: true, 61 | }, 62 | ); 63 | let res_upper = $crate::sequence::Peptidoform::sloppy_pro_forma( 64 | &$case.to_ascii_uppercase(), 65 | 0..$case.len(), 66 | None, 67 | SloppyParsingParameters::default(), 68 | ); 69 | let res_lower = $crate::sequence::Peptidoform::sloppy_pro_forma( 70 | &$case.to_ascii_lowercase(), 71 | 0..$case.len(), 72 | None, 73 | SloppyParsingParameters::default(), 74 | ); 75 | println!("{}", $case); 76 | dbg!(&res); 77 | assert!(res.is_ok()); 78 | assert_eq!(res, res_leading_n); 79 | assert_eq!(res, res_upper); 80 | assert_eq!(res, res_lower); 81 | } 82 | }; 83 | (ne $case:literal, $name:ident) => { 84 | #[test] 85 | fn $name() { 86 | let res = $crate::sequence::Peptidoform::sloppy_pro_forma( 87 | $case, 88 | 0..$case.len(), 89 | None, 90 | &SloppyParsingParameters::default(), 91 | ); 92 | println!("{}\n{:?}", $case, res); 93 | assert!(res.is_err()); 94 | } 95 | }; 96 | } 97 | -------------------------------------------------------------------------------- /rustyms/src/sequence/peptidoform/tests/pro_forma_negative.rs: -------------------------------------------------------------------------------- 1 | use crate::parse_test; 2 | 3 | parse_test!(ne "A[UNIMODIFY:+2]+A", negative_example_1); 4 | parse_test!(ne "A[+1]-", negative_example_2); 5 | parse_test!(ne "[Acetyl]-[Phospho]^2?EM[Oxidation]EVTSESPEK", negative_example_3); 6 | parse_test!(ne "PRT(EC[Carbamidomethyl]FRMS)[+19.0523]^2ISK", negative_example_4); 7 | parse_test!(ne "P(RT(ESFRMS)[+19.0523]IS)[+19.0523]K", negative_example_5); 8 | parse_test!(ne "MPGLVDSNPAPPESQEKKPLK(PCCACPETKKARDACIIEKGEEHCGHLIEAHKECMRALGFKI)[Oxidation]^2[half cystine][half cystine]", negative_example_6); 9 | parse_test!(ne "ELVIS[Phospho|INFO:newly]discovered]K", negative_example_7); 10 | parse_test!(ne "<[TMT6plex]>AA", negative_example_8); 11 | parse_test!(ne "<[TMT6plex#g1]@A>AA", negative_example_9); 12 | parse_test!(ne "<[TMT6plex#XL1]@A>AA", negative_example_10); 13 | parse_test!(ne "<[TMT6plex#BRANCH]@A>AA", negative_example_11); 14 | parse_test!(ne "{TMT6plex#g1}AA", negative_example_12); 15 | parse_test!(ne "{TMT6plex#XL1}AA", negative_example_13); 16 | parse_test!(ne "{TMT6plex#BRANCH}AA", negative_example_14); 17 | parse_test!(ne "AA//AA", negative_example_15); 18 | parse_test!(ne "AA(?A(A)[+1])AA", negative_example_16); 19 | parse_test!(ne "AA(A(?A))[+1]AA", negative_example_17); 20 | parse_test!(ne "[dehydro]^3?Q[gln->pyro-glu]S", negative_example_18); 21 | parse_test!(ne "(Q[gln->pyro-glu]S)[Dehydro]", negative_example_19); 22 | parse_test!(ne "()[Dehydro]S", negative_example_20); 23 | parse_test!(ne "S()[Dehydro]", negative_example_21); 24 | parse_test!(ne "AA[+1#xl1]/2//AA[#XL1]", negative_example_22); 25 | -------------------------------------------------------------------------------- /rustyms/src/sequence/peptidoform/tests/sloppy.rs: -------------------------------------------------------------------------------- 1 | use std::sync::Arc; 2 | 3 | use crate::{ 4 | molecular_formula, 5 | ontology::Ontology, 6 | parse_sloppy_test, 7 | sequence::{ 8 | Modification, Peptidoform, SemiAmbiguous, SimpleModificationInner, SloppyParsingParameters, 9 | }, 10 | }; 11 | 12 | #[test] 13 | fn sloppy_names() { 14 | assert_eq!( 15 | Modification::sloppy_modification("Deamidation (NQ)", 0..16, None, None), 16 | Ok(Ontology::Unimod.find_name("deamidated", None).unwrap()) 17 | ); 18 | assert_eq!( 19 | Modification::sloppy_modification("Pyro-glu from Q", 0..15, None, None), 20 | Ok(Ontology::Unimod.find_name("gln->pyro-glu", None).unwrap()) 21 | ); 22 | } 23 | 24 | #[test] 25 | fn sloppy_names_custom() { 26 | let db = Some(vec![( 27 | Some(0), 28 | "test".to_string(), 29 | Arc::new(SimpleModificationInner::Formula(molecular_formula!(O 1))), 30 | )]); 31 | assert_eq!( 32 | Modification::sloppy_modification("test", 0..4, None, db.as_ref()), 33 | Ok(Arc::new(SimpleModificationInner::Formula( 34 | molecular_formula!(O 1) 35 | ))) 36 | ); 37 | assert_eq!( 38 | Modification::sloppy_modification("Test", 0..4, None, db.as_ref()), 39 | Ok(Arc::new(SimpleModificationInner::Formula( 40 | molecular_formula!(O 1) 41 | ))) 42 | ); 43 | assert_eq!( 44 | Modification::sloppy_modification("C:Test", 0..6, None, db.as_ref()), 45 | Ok(Arc::new(SimpleModificationInner::Formula( 46 | molecular_formula!(O 1) 47 | ))) 48 | ); 49 | } 50 | 51 | #[test] 52 | fn sloppy_msfragger() { 53 | assert_eq!( 54 | Peptidoform::::sloppy_pro_forma( 55 | "n[211]GC[779]RQSSEEK", 56 | 0..20, 57 | None, 58 | &SloppyParsingParameters { 59 | ignore_prefix_lowercase_n: true, 60 | ..Default::default() 61 | } 62 | ) 63 | .unwrap(), 64 | Peptidoform::pro_forma("[211]-GC[779]RQSSEEK", None) 65 | .unwrap() 66 | .into_semi_ambiguous() 67 | .unwrap() 68 | ); 69 | } 70 | 71 | parse_sloppy_test!(ne "_", fuzz_01); 72 | parse_sloppy_test!(ne "ffffffff[gln->|yro-glu]SC2N:iTRAQ4pleeeeeB]", hang_01); 73 | parse_sloppy_test!(ne "SEQUEN[Formula:[13B2YC2][12Cu2]HKKKyro-g|||||||||||||@@||||||||||||||lmmmmmm|||| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||o-glu]n[13YEQUEeedISEQU9SEmmmm]SBSE-@CSE->pyro-glm]n`n->pyrogl>pyro-gl", hang_02); 74 | -------------------------------------------------------------------------------- /rustyms/src/sequence/sequence_position.rs: -------------------------------------------------------------------------------- 1 | /// A position on a sequence 2 | #[derive( 3 | Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, serde::Serialize, serde::Deserialize, 4 | )] 5 | pub enum SequencePosition { 6 | /// N-terminal 7 | NTerm, 8 | /// An amino acid at the given index 9 | Index(usize), 10 | /// C-terminal 11 | CTerm, 12 | } 13 | 14 | /// Add to the index, the onus of making sure the index is still valid for the peptide is on the caller. 15 | impl std::ops::Add for SequencePosition { 16 | type Output = Self; 17 | fn add(self, rhs: u8) -> Self::Output { 18 | match self { 19 | Self::Index(i) => Self::Index(i.saturating_add(rhs as usize)), 20 | n => n, 21 | } 22 | } 23 | } 24 | 25 | /// Subtract from the index, the onus of making sure the index is still valid for the peptide is on the caller. 26 | impl std::ops::Sub for SequencePosition { 27 | type Output = Self; 28 | fn sub(self, rhs: u8) -> Self::Output { 29 | match self { 30 | Self::Index(i) => Self::Index(i.saturating_sub(rhs as usize)), 31 | n => n, 32 | } 33 | } 34 | } 35 | 36 | impl Default for SequencePosition { 37 | fn default() -> Self { 38 | Self::Index(0) 39 | } 40 | } 41 | 42 | impl std::fmt::Display for SequencePosition { 43 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 44 | match self { 45 | Self::NTerm => write!(f, "N-terminal"), 46 | Self::Index(index) => write!(f, "{index}"), 47 | Self::CTerm => write!(f, "C-terminal"), 48 | } 49 | } 50 | } 51 | 52 | impl SequencePosition { 53 | /// Reverse this position, if the peptide would be reversed what would this location be in that reversed peptide. 54 | #[must_use] 55 | pub const fn reverse(self, peptide_length: usize) -> Self { 56 | match self { 57 | Self::NTerm => Self::CTerm, 58 | Self::Index(i) => Self::Index(peptide_length - i), 59 | Self::CTerm => Self::NTerm, 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /rustyms/src/spectrum/mod.rs: -------------------------------------------------------------------------------- 1 | //! Spectrum related code 2 | 3 | pub mod mgf; 4 | mod peaks; 5 | mod raw; 6 | 7 | pub use mgf::*; 8 | pub use peaks::*; 9 | pub use raw::*; 10 | -------------------------------------------------------------------------------- /rustyms/src/spectrum/peaks.rs: -------------------------------------------------------------------------------- 1 | //! General trait for a spectrum 2 | 3 | use std::iter::FusedIterator; 4 | 5 | use crate::system::f64::MassOverCharge; 6 | 7 | /// The trait for all spectra that contain peaks. 8 | pub trait PeakSpectrum: 9 | Extend 10 | + IntoIterator 11 | + std::ops::Index 12 | { 13 | /// The type of peaks this spectrum contains 14 | type PeakType; 15 | /// The type of spectrum iterator this spectrum generates 16 | type Iter<'a>: DoubleEndedIterator + ExactSizeIterator + FusedIterator 17 | where 18 | Self: 'a; 19 | /// Return the slice of peaks that is within the given tolerance bounds. 20 | fn binary_search(&self, low: MassOverCharge, high: MassOverCharge) -> &[Self::PeakType]; 21 | /// Get the full spectrum 22 | fn spectrum(&self) -> Self::Iter<'_>; 23 | /// Add a single peak 24 | fn add_peak(&mut self, item: Self::PeakType); 25 | } 26 | --------------------------------------------------------------------------------