Bioconductor / BiocParallel

Bioconductor facilities for parallel evaluation
https://bioconductor.org/packages/BiocParallel
65 stars 29 forks source link

BiocParallel errors #248

Closed psjyot closed 1 year ago

psjyot commented 1 year ago

bpis <- chromatogram(raw_data, aggregationFun = "max") Error: BiocParallel errors 2 remote errors, element index: 3, 5 0 unevaluated and other errors first remote error: Error in socketConnection(port = port, server = TRUE, blocking = TRUE, : cannot open the connection

mtmorgan commented 1 year ago

Can you make your example reproducible? This is what I get

> bpis <- chromatogram(raw_data, aggregationFun = "max")
Error in chromatogram(raw_data, aggregationFun = "max") :
  could not find function "chromatogram"
psjyot commented 1 year ago

Chromatogram should be from the raw files. Here are the raw files and the script I tried.

Define the full path to the LC-MS files here; use '/', not '\'

msdataDir <- "U:/xcms_R_RSC/xcms_R_RSC/newnormal/"

SCANNING SUBDIRECTORIES FOR MS FILES

msdataFiles <- list.files(msdataDir, pattern = "*.mzML", full.names = TRUE, recursive = TRUE)

you can subset the files, e.g. to exclude blanks

msdataFiles <- msdataFiles[-c(16:20)]

print(msdataFiles)

#########################################################################

ANNOTATE RAW FILES WITH GROUP INFORMATION

#########################################################################

pd <- data.frame(sample_name = sub(basename(msdataFiles), pattern = ".mzML", replacement = "", fixed = TRUE), sample_group = c(rep("b", 5), rep("d", 5)), stringsAsFactors = FALSE) print(pd)

#########################################################################

DEFINE COLORS FOR DATA GROUPS

#########################################################################

You can see the palettes with

display.brewer.all(n=NULL, type="all", select=NULL, exact.n=TRUE, colorblindFriendly=TRUE)

group_colors <- paste0(brewer.pal(3, "Dark2")[1:2]) names(group_colors) <- c("b", "d")

#########################################################################

READ AND EVALUATE THE RAW DATA

#########################################################################

read the raw data

raw_data <- readMSData(files = msdataFiles, pdata = new("NAnnotatedDataFrame", pd), mode = "onDisk")

Get the base peak chromatograms. This reads data from the files.

bpis <- chromatogram(raw_data, aggregationFun = "max")

Thanks, From: Martin Morgan @.> Sent: Wednesday, April 12, 2023 1:03 PM To: Bioconductor/BiocParallel @.> Cc: Jyoti, Poonam @.>; Author @.> Subject: Re: [Bioconductor/BiocParallel] BiocParallel errors (Issue #248)

Can you make your example reproducible? This is what I get

bpis <- chromatogram(raw_data, aggregationFun = "max")

Error in chromatogram(raw_data, aggregationFun = "max") :

could not find function "chromatogram"

— Reply to this email directly, view it on GitHubhttps://github.com/Bioconductor/BiocParallel/issues/248#issuecomment-1505707498, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A7EK5PVAT5TQQJA3N2NBPIDXA3U3NANCNFSM6AAAAAAW37EMXU. You are receiving this because you authored the thread.Message ID: @.***>

mtmorgan commented 1 year ago

Thank you, but I don't know which package chromatogram() is from, and I cannot access the data on your disk ...msdataDir <- "U:/xcms_R_RSC/xcms_R_RSC/newnormal/"...? Maybe the package includes an example dataset, e.g., used in an example or vignette, that also produces the error? Have you asked for help, e.g., on the bioconductor support site, specifically 'tagging' the package that contains the chromatogram() function?

The problem could be that your data is somehow unusual and the chromatogram function fails; does it offer a way to control parallel evaluation, e.g., by using SerialParam() so that the evaluation is NOT run in parallel, and hence the error more easy to understand?

mtmorgan commented 1 year ago

I'll close this because I cannot help further without a reproducible example.