Newbie question: how do I address a subset obtained by split()?
0
0
Entering edit mode
@yuliachupalova-17234
Last seen 6.3 years ago

Hi,
Extreme newbie question: I need to calculate stats for a subset of a flowSet generated by split(). The subset is reported as follows: 

$`area 2`
A flowSet with 1 experiments.
An object of class 'AnnotatedDataFrame' ...

I cannot figure out how to use this subset - what is the syntax to address it? I've tried:

> $`area 2`
Error: unexpected '$' in "$"
> `area 2`
Error: object 'area 2' not found
> singlets$`area 2`
NULL

Below is how I arrived at the split, if that matters. 
Thanks!

---------------------------------------

> fset <- read.flowSet("x.fcs")
> tf <- transformList(from=colnames(fset)[5:30], tfun=asinh)
> fset_t <- tf %on% fset
> beadgate <- norm2Filter("SSC-A", "FSC-A")
> singletgate <- norm2Filter("FSC-A", "FSC-H")
> beads <- Subset(fset_t, beadgate)
> singlets <- Subset(beads, singletgate)
> c2f <- curv2Filter(x=list("FL1-A", "FL3-A"), bwFac=0.4)
> peaks <- filter(singlets, c2f)
> summary(peaks)
filter summary for frame 'x.fcs'
 rest: 115 of 1656 events (6.94%)
 area 1: 97 of 1656 events (5.86%)
 area 2: 179 of 1656 events (10.81%)
 area 3: 196 of 1656 events (11.84%)
 area 4: 218 of 1656 events (13.16%)
 area 5: 221 of 1656 events (13.35%)
 area 6: 177 of 1656 events (10.69%)
 area 7: 227 of 1656 events (13.71%)
 area 8: 199 of 1656 events (12.02%)
 area 9: 27 of 1656 events (1.63%)

> split(singlets, peaks)
$`rest`
A flowSet with 1 experiments.

An object of class 'AnnotatedDataFrame'
  rowNames: x.fcs
  varLabels: name population
  varMetadata: labelDescription

  column names:
  FSC-H FSC-A SSC-H SSC-A FL1-H FL1-A FL2-H FL2-A FL3-H FL3-A FL4-H FL4-A FL5-H FL5-A FL6-H FL6-A FL7-H FL7-A FL8-H FL8-A FL9-H FL9-A FL10-H FL10-A FL11-H FL11-A FL12-H FL12-A FL13-H FL13-A FSC-Width Time

$`area 1`
A flowSet with 1 experiments.

An object of class 'AnnotatedDataFrame'
  rowNames: x.fcs
  varLabels: name population
  varMetadata: labelDescription

  column names:
  FSC-H FSC-A SSC-H SSC-A FL1-H FL1-A FL2-H FL2-A FL3-H FL3-A FL4-H FL4-A FL5-H FL5-A FL6-H FL6-A FL7-H FL7-A FL8-H FL8-A FL9-H FL9-A FL10-H FL10-A FL11-H FL11-A FL12-H FL12-A FL13-H FL13-A FSC-Width Time

$`area 2`
A flowSet with 1 experiments.

An object of class 'AnnotatedDataFrame'
  rowNames: x.fcs
  varLabels: name population
  varMetadata: labelDescription

  column names:
  FSC-H FSC-A SSC-H SSC-A FL1-H FL1-A FL2-H FL2-A FL3-H FL3-A FL4-H FL4-A FL5-H FL5-A FL6-H FL6-A FL7-H FL7-A FL8-H FL8-A FL9-H FL9-A FL10-H FL10-A FL11-H FL11-A FL12-H FL12-A FL13-H FL13-A FSC-Width Time

$`area 3` ...

flowStats newbie split subset flowCore • 1.2k views
ADD COMMENT
1
Entering edit mode

You have to store the result in a variable, then you can access it.

res.split <- split(singlets, peaks)
res.split$`area 2`
ADD REPLY
0
Entering edit mode

THANKS so much!!!

ADD REPLY

Login before adding your answer.

Traffic: 937 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