Skip to content

Instantly share code, notes, and snippets.

@chasemc
Last active March 22, 2022 21:52
Show Gist options
  • Save chasemc/572c40e8812ae13a979d59a4add174e3 to your computer and use it in GitHub Desktop.
Save chasemc/572c40e8812ae13a979d59a4add174e3 to your computer and use it in GitHub Desktop.
Example for the current prioritization function in the IDBac "prioritizer" branch
library(remotes)
remotes::install_github("chasemc/IDBacApp@prioritizer")
library(IDBacApp)
library(here)
# connect_to_idbac_database
pool <- IDBacApp::idbac_connect('VNBacterialLibrary_db-2_0_0', # name of sqlite database
here::here('data')) # directory containing sqlite database
# get_protein_peaks
peak_data <- IDBacApp::idbac_get_peaks(pool = pool,
sampleIDs = NULL,
minNumber = 2,
lowerMassCutoff = 3000L,
upperMassCutoff = 15000L,
minSNR = 6,
tolerance = 0.002,
type = 'protein',
mergeReplicates = TRUE)
# use_maldiqaunt_binning
peak_dist <- IDBacApp::mquant_bin(massStart = 3000,
massEnd = 15000,
massList = lapply(peak_data, function(x) x@mass),
intensityList = lapply(peak_data, function(x) x@intensity),
method = 'strict',
tolerance = 0.002)
# create_dendrogram
peak_dend <- idbac_dendrogram_creator(bootstraps = 0L,
distanceMethod = 'euclidean',
clusteringMethod = 'ward.D',
proteinMatrix = peak_dist)
# run_idbac_prioritizer
z <- IDBacApp::prioritizer(pool = pool,
dendrogram = peak_dend$dendrogram,
h = 340,
k = NULL,
fractionMetabolitePeaksToRetain = 0.75,
minFrequency = 0,
minNumber = 2,
smallMolLowerMassCutoff = 200,
smallMolUpperMassCutoff = 2000,
smallMolSnr = 6,
tolerance = 2,
method = "strict")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment