[BioC] Possible to set alternative colnames on read.flowSet (flowCore)

Florian Hahne fhahne at fhcrc.org
Sat Mar 7 01:50:49 CET 2009

Hi Aric,
sorry, I thought you wanted to change the sample names based on a 
keyword. Wasn't reading carefully enough...
There is no switch to do this during data import, but you can always use 
the colnames<- replace method to alter the colnames of a flowSet (and 
also of all the flowFrames in the set).

One way of getting the keywords out is this (assuming that foo is your 
keyword(foo[[1]], function(x) keyword(x, grep("\\$P[0-9]*S", 
names(description(x)), value=TRUE)))

Or, even simpler
colnames(foo) <- pData(parameters(foo[[1]]))$desc

If you think that this is an important enough use case I can add an 
option to read.FCS that allows to chose a PnS to be used as colnames,  
however this might introduce more trouble than it is worth since only 
PnN is guaranteed to be unique for each channel, and is has to be in 
order to work as a colname.

Aric Gregson wrote:
> Florian,
> On Fri, 06 Mar 2009 13:40:23 -0800
> Florian Hahne <fhahne at fhcrc.org> wrote:
>> Yes there is.
>>  From the documentation of read.flowSet:
>> name.keyword: An optional character vector that specifies which FCS
>>           keyword to use as the sample names. If this is not set, the
>>           GUID of the FCS file is used for sampleNames, and if that is
>>           not present (or not unique), then the file names are used.
> Sorry, I'm not following you. In the examples, name.keyword is used for
> the file names and appears to take a keyword from the FCS file as its
> target, such as "SAMPLE ID". Maybe colname.keyword? Even then, I don't
> understand how I could tell read.flowSet to read the keyword just
> after the one it normally does to take the colnames. Maybe a grep
> operation? The FCS keyword changes with each channel, the channel
> number in the below example is augmented by one as you go along. 
> $`$P13N`
> [1] "AmCyan-A"
> $`$P13S`
> "AmCyan-CD3"
> .
> .
> .
> $`$P16N`   --------------> used by read.flowSet as colnames
>  [1] "Indo-1 (Violet)-A"
> $`$P16S`   --------------> would like to use instead
> [1] "BlueUV-Live"
> Thanks,
> Aric

Florian Hahne, PhD
Computational Biology Program
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M2-B876
PO Box 19024
Seattle, Washington 98109-1024
fhahne at fhcrc.org

More information about the Bioconductor mailing list