comparison metacyto_checkpanel.R @ 0:67d79ba0f7aa draft default tip

"planemo upload for repository https://github.com/ImmPortDB/immport-galaxy-tools/tree/master/flowtools/check_headers commit 14b2e4d834a9856236affb7b77debecca360c542"
author azomics
date Tue, 27 Jul 2021 21:47:56 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:67d79ba0f7aa
1 #!/usr/bin/env Rscript
2 ######################################################################
3 # Copyright (c) 2018 Northrop Grumman.
4 # All rights reserved.
5 ######################################################################
6 #
7 # Version 1 - January 2018
8 # Author: Cristel Thomas
9 #
10 #
11
12 library(MetaCyto)
13
14 check_panel <- function(df, outfile = "") {
15 report <- panelSummary(df, ".", cluster = F, width = 30, height = 20)
16 markers <- data.frame("Markers" = row.names(report))
17 s <- cbind(markers, report)
18 write.table(s, file = outfile, quote = F, row.names = F, col.names = T, sep = "\t")
19 }
20
21 check_input_format <- function(infile = "", outfile = "") {
22 df <- read.table(infile, sep = "\t", header = T, colClasses = "character")
23 nm <- colnames(df)
24 check_ab <- if ("antibodies" %in% nm) TRUE else FALSE
25 check_sdy <- if ("study_id" %in% nm) TRUE else FALSE
26
27 if (check_sdy && check_ab) {
28 check_panel(df, outfile)
29 } else {
30 quit(save = "no", status = 10, runLast = FALSE)
31 }
32 }
33
34 ################################################################################
35 args <- commandArgs(trailingOnly = TRUE)
36
37 check_input_format(args[1], args[2])