Giter Site home page Giter Site logo

cytogate's Introduction

#CytoGate Plugin Gating Functions for openCyto

Installation

CytoGate can be installed from Github

GitHub

library(devtools)
install_github("DillonHammill/CytoGate")

Plugin Example

To demonstrate the use of CytoGate the following example uses the gate_draw plugin for openCyto to draw polygonGates manually using the mouse.

Register openCyto Plugin

library(openCyto)
library(CytoGate)

registerPlugins(fun = gate_draw, methodName = "DrawGate")
listgtMethods()

Construct GatingSet

data(Activation, package = "CytoGate")
gs <- GatingSet(Activation)

Construct GatingTemplate Entry

library(flowDensity)

template <- add_pop(
gs, alias = "Lymphocytes", pop = "+", parent = "root", dims = "FSC-A,SSC-A", 
gating_method = "DrawGate", gating_args = "subSample=20000", collapseDataForGating = TRUE,
groupBy = 2
)
## Select at least 3 points to construct a polygon gate around the population.

Plot Gating Result

library(ggcyto)
ggcyto(gs, subset = "root", aes(x = "FSC-A", y = "SSC-A")) + geom_hex(bins = 100) + geom_gate("Lymphocytes") + geom_stats()

Dillon Hammill, BMedSci (Hons)
Ph.D. Scholar
The Parish Group – Cancer & Vascular Biology
ACRF Department of Cancer Biology and Therapeutics
The John Curtin School of Medical Research
ANU College of Medicine, Biology and the Environment
The Australian National University
Acton ACT 2601
[email protected]

cytogate's People

Contributors

dillonhammill avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cytogate's Issues

Possible quadrant gate bug

I'm attempting to create a facet_grid wherein one cell type has one quadrant and the other cell type has a different quadrant (think Annexin-V/PI). I'm using groupBy = "cellType". As expected, I get two plots that pop up allowing me to draw the quadrant for each cell type. However, when I construct the plot with ggcyto, the placement of the quadrant for first cell type appears on all plots. The second quadrant isn't shown at all so the statistics and quadrant placement are all out of wack for the second cell type.

Some code:

fs <- read.flowSet(path=".", channel_alias = map, alter.names = FALSE, pattern = ".fcs")

cellType <- c("BT474" , "BT474", "BT474", "MCF7", "MCF7", "MCF7")

pData(fs)$cellType = cellType

pData(fs)$order = c(2, 1, 3, 2, 1, 3)

gs <- GatingSet(fs)

 template <- add_pop(
  gs, alias = "A,B,C,D", pop = "*", parent = "root", dims = "Annexin-V,PI",
   gating_method = "DrawGate", gating_args = "gate_type='quadrant'", collapseDataForGating = TRUE,
   groupBy = "cellType"
 )

p1 <- ggcyto(gx, subset= "root", aes(x="Annexin-V", y="PI")) + 
  geom_hex(bins = 180) + 
  geom_gate(c("A","B","C","D") +
  geom_stats(alpha=0.5) + 
  facet_grid(cellType~ order)

p1

If I use similar code for drawing something like a polygon gate, there are no issues.

template <- add_pop( gs, alias = "AnnexinPI", pop = "+", parent = "root", dims = "Annexin-V,PI", gating_method = "DrawGate", collapseDataForGating = TRUE, groupBy = "cellType" )

Both gates appear where they are supposed to appear. Maybe I'm just not understanding something here with the quadrant gate. Any help would be greatly appreciated.

Chris

dont find the dataset OTI

Hi,
My name is Martin, a bioinformatician developper.
I'm working with openCyto package and see yours issues.
But i'm looking your package and i can't find the dataset OTI; I realize your instructions from readme:
data(OTI, package = "CytoGate")
Warning message:
In data(OTI, package = "CytoGate") : dataset ‘OTI’ not found
Did you change the name or something ?
Best regards!
Martin

Installation Error from flowDensity

There seems an issue with flowwDensity when installing on Windows with R 3.6.0:

> install_github("DillonHammill/CytoGate")
Downloading GitHub repo DillonHammill/CytoGate@master
Skipping 2 packages not available: flowDensity, openCyto
√  checking for file 'C:\Users\rbaer\AppData\Local\Temp\RtmpmGWALt\remotes196c3498176f\DillonHammill-CytoGate-76a7eea/DESCRIPTION' (2.6s)
-  preparing 'CytoGate': (4.6s)
√  checking DESCRIPTION meta-information ... 
-  checking for LF line-endings in source and make files and shell scripts
-  checking for empty or unneeded directories
-  looking to see if a 'data/datalist' file should be added
-  building 'CytoGate_1.1.1.tar.gz' (1.4s)
   
* installing *source* package 'CytoGate' ...
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** byte-compile and prepare package for lazy loading
Error: package or namespace load failed for 'flowDensity':
 (converted from warning) replacing previous import 'flowCore::plot' by 'graphics::plot' when loading 'flowDensity'
Error: package 'flowDensity' could not be loaded
Execution halted
ERROR: lazy loading failed for package 'CytoGate'
* removing 'E:/Program Files/R/R-3.6.0/library/CytoGate'
Error in i.p(...) : 
  (converted from warning) installation of package ‘C:/Users/rbaer/AppData/Local/Temp/RtmpmGWALt/file196c57691d94/CytoGate_1.1.1.tar.gz’ had non-zero exit status
> sessionInfo()
R version 3.6.0 (2019-04-26)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17134)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] usethis_1.5.0  devtools_2.0.2

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.1        ps_1.3.0          prettyunits_1.0.2 rprojroot_1.3-2  
 [5] withr_2.1.2       digest_0.6.19     crayon_1.3.4      assertthat_0.2.1 
 [9] R6_2.4.0          backports_1.1.4   magrittr_1.5      rlang_0.3.4      
[13] cli_1.1.0         curl_3.3          fs_1.3.1          remotes_2.0.4    
[17] rstudioapi_0.10   callr_3.2.0       desc_1.2.0        tools_3.6.0      
[21] glue_1.3.1        pkgload_1.0.2     compiler_3.6.0    processx_3.3.1   
[25] pkgbuild_1.0.3    sessioninfo_1.1.1 memoise_1.1.0    
> 

Cannot install

Hello! Thank you for creating this package. I'm trying to install it, but when I run: devtools::install_github("DillonHammill/CytoGate"), I get the error:

Downloading GitHub repo DillonHammill/CytoGate@HEAD
Error in utils::download.file(url, path, method = method, quiet = quiet,  : 
  cannot open URL 'https://api.github.com/repos/DillonHammill/CytoGate/tarball/HEAD'

Am I doing something wrong?
Best wishes
Hefin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.