Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streamline assay joining with joinAssays() #211

Open
cvanderaa opened this issue Apr 24, 2024 · 0 comments
Open

Streamline assay joining with joinAssays() #211

cvanderaa opened this issue Apr 24, 2024 · 0 comments

Comments

@cvanderaa
Copy link
Collaborator

Curently, joinAssays() combines multiple sets into a new set by matching rownames. However, in some cases, the rownames may not be meaningful for joining and I would prefer to join based on a rowData variable. For instance, DIANN data provides a Precuror.Id column that hold unique precursor identifier within each set. See here for example:

library(QFeatures)
x <- read.delim(MsDataHub::Report.Derks2022.plexDIA.tsv())
x[["File.Name"]] <- x[["Run"]]
qf <- readQFeaturesFromDIANN(x)
## Check if any Precursor.Id is duplicated
anyDups <- sapply(names(qf), function(i) {
    any(duplicated(rowData(qf)[[i]]$Precursor.Id))
})
table(anyDups) ## Precursor.Id is unique within each set

This means that the sets in qf could immediately be joined using joinAssays(). However, this is not possible because the rownames do not contain meaningfull information. So currently, the solution is to manually change the rownames:

for (i in names(qf)) {
    rownames(qf[[i]]) <- rowData(qf[[i]])$Precursor.Id
}

I though this could be streamlined within joinAssays() through the addition of a by argument. Eg:

qf <- joinAssays(qf, i = names(qf), name = "precursor", by = "Precursor.Id")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant