flowCore - read.FCSHeader
1
0
Entering edit mode
Jiang, Mike ★ 1.3k
@jiang-mike-4886
Last seen 2.5 years ago
(Private Address)

On 02/17/2015 11:25 PM, Samuel GRANJEAUD IR/INSERM wrote:

Hi Mike,

Is it also easy to convert them as a flowSet object in order to use description, spill and all others functions that apply to complete FCS stuff?

Best regards,
Samuel

On 17-02-2015 22:55, Mike wrote:
it is currently returning a list of named character vectors, it is
trivial to convert them to lists simply by,

lapply(files, function(file)as.list(read.FCSheader(file)[[1]]))

We can certainly consider to implement it within the API if you would

post a feature request on https://github.com/RGLab/flowCore [1].

Thanks,

Mike

On 02/12/2015 12:53 AM, Samuel Granjeaud wrote:

Hi,

read.FCSheader does not return an object that may be passed to
fsApply or keyword. IMHO this should be interesting, because it
would avoid rewriting functions to access to header data. Of course,
I am currently using a workaround, but it makes less sense:
read.flowSet(fileList$file, transformation = NULL, which.lines =
1L)

Best reagrds,
Samuel




Links:
------
[1] https://github.com/RGLab/flowCore

 

flowcore • 1.2k views
ADD COMMENT
0
Entering edit mode
Jiang, Mike ★ 1.3k
@jiang-mike-4886
Last seen 2.5 years ago
(Private Address)

No, headers can't be converted to flowSet.
That line of code gives you pretty much what `description` function returns. To get spillover matrix, you would just need to do:

        kw <- as.list(read.FCSheader(file)[[1]]))
        sp <- kw[['SPILL']] # or 'spillover'
        splt <- strsplit(sp, ",")[[1]]
        nrCols <- as.numeric(splt[1])
        cnames <- splt[2:(nrCols+1)]
        vals <- as.numeric(splt[(nrCols+2):length(splt)])
        spmat <- matrix(vals, ncol=nrCols, byrow=TRUE)
        colnames(spmat) <- cnames
        spmat

Best,
Mike

ADD COMMENT

Login before adding your answer.

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