R/misc.R

Defines functions check_cmd

Documented in check_cmd

utils::globalVariables(c(
    ".",
    "avg.exp.scaled",
    "avg_log2FC",
    "bam_file",
    "CB",
    "cell_barcode",
    "cell_group",
    "cid",
    "cluster",
    "Cluster",
    "col.fill",
    "control_celltypes",
    "database",
    "exp_type",
    "feature",
    "features.plot",
    "freq",
    "Freq",
    "from",
    "gene",
    "group_count",
    "id",
    "junk",
    "label",
    "label14",
    "label30",
    "ligand_target_matrix",
    "ligands",
    "ligands_bona_fide",
    "lr_network",
    "lr_network_strict",
    "lt_14",
    "lt_30",
    "max_val",
    "median_val",
    "method",
    "min_val",
    "n_bams",
    "num_clusters",
    "p_val_adj",
    "pearson",
    "pct.exp",
    "Phase",
    "Proportion",
    "rainbow",
    "receptors",
    "receptors_bona_fide",
    "res_vals",
    "sample_1",
    "sample_2",
    "Sample_ID",
    "Sample_Project",
    "score",
    "sd_val",
    "sil_vals",
    "sil_width",
    "snp_dist",
    "suffix",
    "sobj",
    "tar_folder",
    "test_ligand",
    "to",
    "tree_group",
    "tx_id",
    "tx_name",
    "value",
    "Var1",
    "weight",
    "weighted_networks",
    "weighted_networks_lr",
    "x",
    "y"
    ))

#' Check that a command is available on the system
#'
#' @param cmd The command to check for
#' @return 0 if the command is available, otherwise an error is thrown
check_cmd <- function(cmd) {
    if (Sys.which(cmd) == "") {
        stop(paste(cmd,
                   "command not found, do you need to load a module or add",
                   " this to your PATH?"))
    }
    return(0)
}
kidcancerlab/rrrSingleCellUtils documentation built on April 17, 2025, 5:10 p.m.