# HG changeset patch # User immport-devteam # Date 1488217991 18000 # Node ID 1d926a8daa9279ea36a8694e02e79c64517f5e38 Uploaded diff -r 000000000000 -r 1d926a8daa92 fcs_summary/FCSstats.R --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fcs_summary/FCSstats.R Mon Feb 27 12:53:11 2017 -0500 @@ -0,0 +1,57 @@ +# FCS Summary Statistic Module for Galaxy +# FlowCore +###################################################################### +# Copyright (c) 2016 Northrop Grumman. +# All rights reserved. +###################################################################### +# +# Version 1 +# Cristel Thomas +# +# + +library(flowCore) + +getMarkerNames <- function(input, output) { + fcs <- read.FCS(input, transformation=F) + + ## marker names + channels <- colnames(fcs) + markers <- as.vector(pData(parameters(fcs))$desc) + df <- data.frame(channels, markers) + fcs_summary <- capture.output(summary(fcs)) + fcs_dim <- capture.output(dim(fcs)) + fcs_markers <- capture.output(df) + + + sink(output) + cat(fcs_dim, sep="\n") + cat("\n\n=========================\n") + cat("== FCS SUMMARY ==\n") + cat("=========================\n") + cat(fcs_summary, sep="\n") + cat("\n\n=========================\n") + cat("== MARKERS IN FCS ==\n") + cat("=========================\n") + cat(fcs_markers, sep="\n") + sink() +} + +checkFCS <- function(input_file, output_file) { + isValid <- F + # Check file beginning matches FCS standard + tryCatch({ + isValid = isFCSfile(input_file) + }, error = function(ex) { + print (paste(" ! Error in isFCSfile", ex)) + }) + + if (isValid) { + getMarkerNames(input_file, output_file) + } else { + print (paste(input_file, "does not meet FCS standard")) + } +} + +args <- commandArgs(trailingOnly = TRUE) +checkFCS(args[2], args[3]) diff -r 000000000000 -r 1d926a8daa92 fcs_summary/FCSstats.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fcs_summary/FCSstats.xml Mon Feb 27 12:53:11 2017 -0500 @@ -0,0 +1,73 @@ + + of FCS files. + + r + bioconductor-flowcore + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r 1d926a8daa92 fcs_summary/test-data/summary.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fcs_summary/test-data/summary.txt Mon Feb 27 12:53:11 2017 -0500 @@ -0,0 +1,40 @@ + events parameters + 10 13 + + +========================= +== FCS SUMMARY == +========================= + FSC-A FSC-H SSC-A SSC-H APC-A APC-H7-A FITC-A PerCP-Cy5-5-A +Min. 9081 8811 10500 10120 -76.00 168.0 55.51 19.11 +1st Qu. 22040 17990 35210 33090 -50.92 432.4 219.50 69.84 +Median 55080 50380 60520 56110 123.90 1412.0 312.60 190.20 +Mean 69950 58340 67560 57540 553.30 3196.0 758.60 1227.00 +3rd Qu. 100700 90200 100500 71740 232.20 3797.0 1198.00 678.40 +Max. 170500 136000 138000 114000 2955.00 12540.0 2421.00 9038.00 + V450-A V500-A PE-A PE-Cy7-A Time +Min. -7.68 7.68 -12.74 -11.76 0.000 +1st Qu. 147.80 315.80 6.86 46.55 0.025 +Median 638.90 5000.00 168.10 196.50 0.150 +Mean 1956.00 7151.00 180.30 434.20 0.130 +3rd Qu. 1275.00 11500.00 252.10 766.90 0.200 +Max. 12950.00 24690.00 620.30 1694.00 0.300 + + +========================= +== MARKERS IN FCS == +========================= + Channels Markers +1 FSC-A +2 FSC-H +3 SSC-A +4 SSC-H +5 APC-A CD127 +6 APC-H7-A CD45RO +7 FITC-A LIVE +8 PerCP-Cy5-5-A CD4 +9 V450-A CD3 +10 V500-A HLA-DR +11 PE-A CD25 +12 PE-Cy7-A CCR4 +13 Time diff -r 000000000000 -r 1d926a8daa92 fcs_summary/test-data/testfcs1.fcs Binary file fcs_summary/test-data/testfcs1.fcs has changed