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

change s4 object from s3 object for flowset #246

Open
star9926 opened this issue Feb 16, 2023 · 1 comment
Open

change s4 object from s3 object for flowset #246

star9926 opened this issue Feb 16, 2023 · 1 comment

Comments

@star9926
Copy link

Describe the bug
Hello,

Thanks a lot for the package, that is so helpful and awesome.

I am wondering if I could change the flowset as a list of all samples with S3 object. I tried

  • flowSet_to_list, changed the flowset as a list but S4 object for each samples,
  • also tried fsApply (flowset, exprs, simplify = F), changed the flowset as a list but double for each sample.

I could like to have the flowset into list of all samples, each sample exist as a tibble, is that possible, thanks a lot!

Best regards,
Na

@star9926 star9926 changed the title change s4 object from s3 objection for flowset change s4 object from s3 object for flowset Feb 16, 2023
@djhammill
Copy link

@liunanaliu, the following code should do the trick:

library(flowWorkspace)
library(tibble)

# fs is your flowSet - tbl_list is a list of tibbles
tbl_list <- structure(
  lapply(
    seq_along(fs),
    function(x) {
      as_tibble(exprs(fs[[x]]))
    }
  ),
  names = sampleNames(fs)
)

# access individual tibbles by name or index
tbl_list[[1]]

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

2 participants