{"id":32199341,"url":"https://github.com/yonghuidong/msbox","last_synced_at":"2026-07-09T01:31:54.170Z","repository":{"id":56934036,"uuid":"328456359","full_name":"YonghuiDong/MSbox","owner":"YonghuiDong","description":"Tools for Metabolomics and mass Spectrometry users","archived":false,"fork":false,"pushed_at":"2022-12-08T14:29:35.000Z","size":8355,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-08T16:43:48.838Z","etag":null,"topics":["chemoinformatics","mass-spectrometry","metabolites","metabolomics"],"latest_commit_sha":null,"homepage":"https://github.com/YonghuiDong/MSbox","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/YonghuiDong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-10T18:55:16.000Z","updated_at":"2024-03-13T05:36:07.000Z","dependencies_parsed_at":"2023-01-25T14:00:57.926Z","dependency_job_id":null,"html_url":"https://github.com/YonghuiDong/MSbox","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/YonghuiDong/MSbox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YonghuiDong%2FMSbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YonghuiDong%2FMSbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YonghuiDong%2FMSbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YonghuiDong%2FMSbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YonghuiDong","download_url":"https://codeload.github.com/YonghuiDong/MSbox/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YonghuiDong%2FMSbox/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280371802,"owners_count":26319509,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-22T02:00:06.515Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chemoinformatics","mass-spectrometry","metabolites","metabolomics"],"created_at":"2025-10-22T03:13:44.039Z","updated_at":"2025-10-22T03:13:48.552Z","avatar_url":"https://github.com/YonghuiDong.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MSbox\n\n[![CRAN status](http://www.r-pkg.org/badges/version/MSbox)](https://cran.r-project.org/package=MSbox) \n[![CRAN downloads](http://cranlogs.r-pkg.org/badges/grand-total/MSbox)](https://cran.r-project.org/package=MSbox)\n\nCommon mass spectrometry and statistical tools.\n\n# Installation\n\n```r\ninstall.packages('MSbox')\n```\n\n# Usage\n\n## 1. Mass Spectrometry Widgets\n-----------------------\n\n### 1. Check element isotopes\n\nexamples:\n\n```r\nE_iso('C') # element symbol, case insensitive\nE_iso('Carbon') # element full name, case insensitive\nE_iso('carBon') # element full name, case insensitive\n```\n\n### 2. Get extra molecular information based on compound name\n\nIf the queried information is not found for a compounds, it will assign \"unknown\" to that compound information:\n```r\ndescribe('malic acid') # get formula by default\ndescribe(c('malic acid', 'citric acid', 'tartaric acid'), representation = \"smiles\") # get smiles\n```\n\n### 3. Calculate monoisitopic mass\n\nIt accepts two types of inputs: \n\n(1) **Standards elemental composition**, for instance, `C7H6O`, `C7H6Na`. Here each element is distinguished by Capital letters, i.e., sodium should be written as Na, not NA, na or nA here. Since there is only one sodium in the formula `C7H7Na`, you don't have to write 1 after `Na`. \n\n(2) **User friendly elemental composition**, for instance,`c7H6O1`, `C7H6NA1`. Here each element is distinguished by the number of the element, therefore, i.e, sodium can be written as `Na`, `NA` or `na`. But the number the sodium element should be clearlly stated in the formula even if there is only one sodium. \n\nexample for **Standards elemental composition**:\n\n```r\nmass(\"C7H6O\", caseSensitive = T)\nmass(c(\"C7H6O\", \"C7H6Na\"), caseSensitive = T) # vector input\n```\n\nexample for **User friendly elemental composition**:\n\n```r\nmass(\"c7h6O1\")\nmass(c(\"c7h6o1\", \"C7H6NA1\")) # vector input\n```\n\n### 4. Calculate theoretical m/z value\n\nIt accepts two types of inputs: \n\n(1) **Standards elemental composition**, for instance, `C7H6O`, `C7H6Na`. Here each element is distinguished by Capital letters, i.e., sodium should be written as Na, not NA, na or nA here. Since there is only one sodium in the formula `C7H7Na`, you don't have to write 1 after `Na`. \n\n(2) **User friendly elemental composition**, for instance,`c7H6O1`, `C7H6NA1`. Here each element is distinguished by the number of the element, therefore, i.e, sodium can be written as `Na`, `NA` or `na`. But the number the sodium element should be clearlly stated in the formula even if there is only one sodium. \n\nexample for **Standards elemental composition**\n\n```r\nmz(\"C7H7O\", 1, caseSensitive = T) # [M+H]+, positive ion mode, charge z = 1\nmz(\"C7H5O\", -1, caseSensitive = T) # [M-H]-, negative ion mode, charge z = 1\nmz(c(\"C7H6O\", \"C7H6Na\"), 1, caseSensitive = T) # vector input\n```\n\nexample for **User friendly elemental composition**:\n\n```r\nmz(\"c7h7O1\") # [M+H]+, positive ion mode, charge z = 1\nmz(\"c7H5o\", -1) # [M-H]-, negative ion mode, charge z = 1\nmz(c(\"c7h6o1\", \"C7H6NA1\"), 1) # vector input\n```\n\n### 5. Calculate the mass accuracy of measured m/z ppm\n\nexample:\n\n```r\nppm(155.03383, 155.03388) # standard way\nppm(155.03383, .03388) # lazy input when the integer parts of m and t are the same\nppm(155.03383, .03388, lazy = F) # lazy input disabled\nppm(155.03384, mz('C7H7O4', z = 1)) # with ion formula\n```\n\n\n### 6. Calculate isotope labelled molecular mass\n\nexample\n\n```r\nIso_mass(F = 'C7H6O4', iso = '[13]C2[2]H3') # Two 13C and three 2H are labled. Case insensitive.\n```\n\n### 7. Calculate isotope labelled m/z\n\nexample\n\n```r\nIso_mz(F = 'C7H6O4', iso = '[13]C2[2]H3', z = 1) # Two 13C and three 2H are labled. Case insensitive.\n```\n\n### 8. Check if an m/z value originates from possible contaminant\n\nexamples\n\n```r\ncontam(33.0335, ppm = 10, mode = '+')\ncontam(44.998, ppm = 10, mode = '-')\n```\n\n### 9. Calculate common adduct ions in pos or neg ion mode\n\nexamples\n\n```r\nadduct('C1H4', mode = '-') # case insensitive\nadduct('C1H4', mode = '+') # case insensitive\n```\n\n### 10. Search m/z in HMDB or KEGG database\n\n```r\nwhat(1034.556, mode = \"+\", ppm = 3) # single m/z value in HMDB database (default)\nwhat(1034.556, mode = \"+\", ppm = 3, useDB = \"KEGG\") # single m/z value in KEGG database\nwhat(c(133.014, 191.020), ppm = 10, mode = '-') # batch search\n```\n\n### 11. Search user's own database based on accurate m/z or both accurate mass and RT\n\n```r\nsearchDB(DF, DB, ppm = 5, RT = 0.2, useRT = T) # with RT searching\nsearchDB(DF, DB, ppm = 5, RT = 0.2, useRT = F) # without RT searching, default\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyonghuidong%2Fmsbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyonghuidong%2Fmsbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyonghuidong%2Fmsbox/lists"}