gszep / FlowAtlas.jl

an interactive explorer for flow cytometry data
MIT License
10 stars 0 forks source link

Open a set of FCS files without a .wsp file? #37

Open tlnagy opened 3 months ago

tlnagy commented 3 months ago

Cool project! I was wondering if it was possible to open a folder with .fcs files without a .wsp file?

Something like:

julia> readdir()
5-element Vector{String}:
 "Specimen_001_1 BFP_002.fcs"
 "Specimen_001_1 CTL_001.fcs"
 "Specimen_001_2 BFP_004.fcs"
 "Specimen_001_2 CTL_003.fcs"

julia> FlowAtlas.run(""; files = "*.fcs")
[ Info: Loading FCS files...
ERROR: AssertionError: no such file: 
Stacktrace:
 [1] load(path::String; files::String, cols::Symbol, kwargs::@Kwargs{})
   @ FlowWorkspace ~/.julia/packages/FlowWorkspace/8HLjp/src/Utils.jl:32
 [2] load
   @ ~/.julia/packages/FlowWorkspace/8HLjp/src/Utils.jl:30 [inlined]
 [3] run(path::String; files::String, port::Int64, url::String, cols::Symbol, drop::Vector{…}, nlevels::Int64, nbins::Int64, heatmapQuantileEdge::Float64, violinQuantileEdge::Float64, channelScheme::ColorSchemes.ColorScheme{…}, labelScheme::ColorSchemes.ColorScheme{…}, hold::Bool)
   @ FlowAtlas ~/.julia/packages/FlowAtlas/yxybS/src/FlowAtlas.jl:65
 [4] top-level scope
   @ REPL[22]:1
Some type information was truncated. Use `show(err)` to see complete types.

My package environment on Julia 1.10:

(jl_TZ3iwY) pkg> st
Status `/tmp/jl_TZ3iwY/Project.toml`
  [ef7debb3] FlowAtlas v0.1.13

I would love to use this tool to visualize my populations and draw gates, but I understand if that's out of the scope of this project.

gszep commented 3 months ago

thank you for your interest @tlnagy :) I'd happily try to extend the functionality to accomodate your needs. Currently a separate package FlowWorkspace.jl deals with loading and parsing data. FlowAtlas.jl is responsible for the dimensionality reduction, visualisation and interactive elements.

If you did not have a .wsp file, I would assume that you do not have a gating strategy in place? The gating strategy is stored in the .wsp file parsed as a graph called gating and is used to generate labels for each cell. In addition the wsp file stores any groups created using FlowJo and is parsed into groups

data, labels, groups, gating = FlowWorkspace.load( path; files=files, cols=cols)

Without the wsp file you would only have data available to you. This is loaded using the loadFCS function. This is something you could use as a workaround if you simply wanted to load the data into Julia.

I can extend FlowWorkspace.load to return only data when no .wsp file is provided, with reduced functionality avalialbe in FlowAtlas.jl because no gating info was found. You would still be able to navidate the dimensionality reduction and identify phenotype clusters from fluorescence profiles.

tlnagy commented 3 months ago

If you did not have a .wsp file, I would assume that you do not have a gating strategy in place?

That's correct. I was hoping to use this tool to draw gates on my raw .fcs files. Is that out of scope of the project?