hhabra / metabcombiner Goto Github PK
View Code? Open in Web Editor NEWmetabCombiner R Package: Paired Untargeted Metabolomics Feature Matching & Data Concatenation
metabCombiner R Package: Paired Untargeted Metabolomics Feature Matching & Data Concatenation
Update method should be exported for the purposes of metabCombiner re-analyses
Strings are treated as different when the beginning or end of the string has spaces
Hi,
I've been doing quite a bit of modeling with metabCombiner and noticed that with my recent biocmanager:: update, my old code stopped working.
Before, labelRows(method = "mzrt") worked on my combinedTable() dataframe
Now, i get Error in labelRows(ct_tp, method = "mzrt", delta = c(de1, de2, de3, de4), :
must call calcScores before using this function
The former behavior seems more intuitive to me since I am not using method="scores".
I'm not sure if I should treat my old modeling results as bad or try to replicate them with certain calcScores() parameter values though I don't know what these would be.
Do you have any insight or direction for me on this question?
New outlier argument should be set to either "none", "remove", "highlight"
Get rid of those, need to use accessor method
Option to edit and insert anchors table in updateTables function
Hi,
I found your package recently and think it looks interesting for our research, while when I tried to run you script, I met a couple of issues. Firstly , while is the file "path_to_data_file.txt"? Unfortunately I did not find it even I installed you packages. Secondly, do you have a full scripts than can fully work for your example data, I found there are many symbols such as "..." in your script that not recognized by R and I could not run these codes for the example data. I would like to see what is the output of your package and whether we can apply to our data and how should we prepare our data format.
Thank you very much in advance.
Best
Tingting
When performing a re-analysis of combined data, group numbers from 1 to nGroups will cause an error due to missing groups. Solution: use unique().
Current method for table collapsing in write2file function too slow
lines = apply(cTable, 1, function(row) base::paste(row, collapse = sep))
Faster methods necessary. One possibility:
strsplit(readr::format_delim(cTable, delim = sep), split = "\n")[[1]])
Also, addition of an index column may be useful and necessary.
dplyr::all_of called in metabData(), but this functionality is only available in later versions of dplyr (starting from version 1.0). Update DESCRIPTION to set minimum dplyr to 1.0.
A method should be added
Features filtered out by metabData need to be accessible to the user. New slot for "filtered" features should be added and method "filtered" for retrieving the features.
Program may not recognize literal bracket characters ("(", "[", "{") in column names during fields detection. Solution is to substitute a period character for any of the above characters.
In the file form.R
, the function formCombinedTable()
is causing an error for us because it uses grep()
to get the indices of matching IDs. The grep is failing because the string for regex pattern gets too big since we have thousands of IDs.
A fix would be to use match() instead, which also avoid another potential source of error -see below. Here are my suggested changes, which seem to work, in the file form.R
:
formCombinedTable <- function(object, xset, yset, xreps, yreps){
xComb <- dplyr::slice(xset, rep(seq(1,n()), times = xreps))
yComb <- yset[yreps,]
samps_extras <- unlist(lapply(datasets(object), function(d)
c(getSamples(object, d), getExtra(object,d))))
# samps_extras <- rmbrackets(paste(samps_extras, collapse = "|")) # removed
# x_sa_ext <- setdiff(grep(samps_extras, rmbrackets(names(xComb))),seq(1,5)) # removed
x_sa_ext <- na.omit(match(samps_extras, names(xComb))) # added
x_sa_ext <- x_sa_ext[x_sa_ext > 5] # added
# y_sa_ext <- setdiff(grep(samps_extras, rmbrackets(names(yComb))),seq(1,5)) # removed
y_sa_ext <- na.omit(match(samps_extras, names(yComb))) # added
y_sa_ext <- y_sa_ext[y_sa_ext > 5] # added
cTable <- data.frame(idx = xComb[["id"]], idy = yComb[["id"]],
mzx = round(xComb[["mz"]],5), mzy = round(yComb[["mz"]],5),
rtx = round(xComb[["rt"]],4), rty = round(yComb[["rt"]],4),
rtProj = numeric(nrow(xComb)),
Qx = round(xComb[["Q"]],4), Qy = round(yComb[["Q"]],4),
group = xComb[["group"]],
score = rep(1, nrow(xComb)),
rankX = as.integer(1), rankY = as.integer(1),
adductx = xComb[["adduct"]], adducty = yComb[["adduct"]],
xComb[,sort(x_sa_ext)], yComb[,sort(y_sa_ext)],
stringsAsFactors = FALSE, check.names = FALSE)
consec <- lapply(rle(cTable[["group"]])[["lengths"]], function(l) seq(1,l))
consec <- unlist(consec)
rowID <- sprintf("%s.%s", cTable[["group"]], consec)
cTable <- cbind.data.frame(rowID = rowID, cTable)
return(cTable)
}
The grep() approach will produce unintended matches in cases of varying length IDs where some IDs are substrings of others, for example, if the search pattern has the ID 123
then it will match 1230
1123
and 1231
etc.
Caesar
dplyr::filter mixes up the row indices
Currently outputs an unhelpful error when object check is made
In detectFields, there is a -Q for the Q column deletion rather -QCol.
A group in the Jen dataset has a first isomer labeled, but the second is labeled "remove"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.