read.flowSet() raises " Argument 'phenoData' must be of type 'AnnotatedDataFrame'" error
1
0
Entering edit mode
Rainer • 0
@rainer-24107
Last seen 3.1 years ago
Switzerland

Hi

I have some code which was working about a year ago. Now I have to re-use it and I get an error when running the following code:

fsa <- flowCore::read.flowSet(
    path = fcs_path,
    transformation = FALSE,
    phenoData = list(
      filename = "#SAMPLE",
      sample = "$SMNO",
      date = "$DATE",
      volume = "$VOL",
      proj = "$PROJ"
    )
  )
Error in parse_pd_for_read_fs(files, path, pattern, phenoData, sep, as.is,  : 
  Argument 'phenoData' must be of type 'AnnotatedDataFrame' or a filename
of a text file containing the phenotypic information

As I do not know much about flowcytometer and the file formats, I am completely at a loss what this error means. I understand it from the R side, but have no idea how I can solve it.

Also, I have no idea if this information is enough, or if more details are needed. If yes, please let ma know which ones and I can provide the info.

The data is from a BD Accuri C6 Plus. The Software is BD CSampler Plus Software Version 1.0.34.1.

Thanks a lot,

Rainer

Edit 1:

The following works:

fsa <- flowCore::read.flowSet(
    path = fcs_path,
    transformation = FALSE
)
flowCore • 1.6k views
ADD COMMENT
0
Entering edit mode
fsa <- flowCore::read.flowSet(
    path = fcs_path,
    transformation = FALSE
)

works by the way.

ADD REPLY
1
Entering edit mode
Jiang, Mike ★ 1.3k
@jiang-mike-4886
Last seen 3.2 years ago
(Private Address)

We reworked on read.flowSet so that it focus on its main task (i.e. parse fcs files into flowSet) instead of doing too many things in one call, which complicates the code maintenance. So it no longer support a 'list' for phenoData argument.(I will update the doc to reflect this change). You can achieve the same goal by extracting the keywords from flowset and assign it to pData through the separate dedicated methods, e.g.

#read fcs
fcs.loc <- system.file("extdata",package="flowCore")
file.location <- paste(fcs.loc, dir(fcs.loc), sep="/")
fs <- read.flowSet(file.location[1:3])

#extract keyword list
kw <- keyword(fs, list("GUID", "SAMPLE ID"))

#assign it to pdata of fs
pData(fs) <- as.data.frame(kw)
pData(fs)
ADD COMMENT
0
Entering edit mode

That decision makes perfect sense.

But I am struggling, as it still does not work. I changed the code as followed:

# read fcs
  fsa <- flowCore::read.flowSet(
    path = fcs_path
  )

  #extract keyword list
  kw <- flowCore::keyword(
    fsa,
    keyword = list(
      filename = "#SAMPLE",
      sample = "$SMNO",
      date = "$DATE",
      volume = "$VOL",
      proj = "$PROJ"
    )
  )

  #assign it to pdata of fs
  pData(fsa) <- as.data.frame(kw)

but I am getting the following error:

Error in (function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE,  : 
  arguments imply differing number of rows: 3, 4

As I said, I inherited the code and am just "making it work" and have no background in this kind of data.

The aim would be, that the output of this new code than the one from the old code, so that the following analysis can stay the same.

ADD REPLY
0
Entering edit mode

I missed, that the error comes from the as.data.frame as the individual list elements do not all have an element named "$SMNO" and none actually "#SAMPLE". Is this a problem?

ADD REPLY
0
Entering edit mode

OK - I got it working.

Thanks a lot!

ADD REPLY
0
Entering edit mode

The result of the keyword function is not a data.frame, and is not magically coerced into a data.frame.

Glad you find a solution. Could you post it as it might be useful for others? Best

ADD REPLY

Login before adding your answer.

Traffic: 929 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6