fuma.FuMa:

Usage Arguments Examples

View source: R/fuma.FuMa.R

Usage

1
fuma.FuMa(object, gene_list_bed_file)

Arguments

object
gene_list_bed_file

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (object, gene_list_bed_file) 
{
    print("Exporting datasets")
    for (dataset_id in 1:length(object$datasets)) {
        object <- export_dataset(object, dataset_id)
    }
    print("Running FuMa")
    output <- tempfile()
    cmd <- object$binary
    cmd <- paste(cmd, " -f 'list'", sep = "")
    cmd <- paste(cmd, "-m", object$matching, sep = " ")
    if (object$strand_specific_matching == TRUE) {
        cmd <- paste(cmd, " --strand-specific-matching", sep = "")
    }
    else {
        cmd <- paste(cmd, " --no-strand-specific-matching", sep = "")
    }
    if (object$acceptor_donor_order_specific_matching == TRUE) {
        cmd <- paste(cmd, " --acceptor-donor-order-specific-matching", 
            sep = "")
    }
    else {
        cmd <- paste(cmd, " --no-acceptor-donor-order-specific-matching", 
            sep = "")
    }
    cmd <- paste(cmd, " -a 'genes:", gene_list_bed_file, "'", 
        sep = "")
    cmd <- paste(cmd, " -s", sep = "")
    for (dataset_id in 1:length(object$datasets)) {
        dataset_name <- object$dataset_names[[dataset_id]]
        dataset_file <- object$dataset_exported_files[[dataset_id]]
        cmd <- paste(cmd, " ", shQuote(paste(dataset_name, ":chimera:", 
            dataset_file, sep = "")), "", sep = "")
    }
    cmd <- paste(cmd, " -l", sep = "")
    for (dataset_id in 1:length(object$datasets)) {
        dataset_name <- object$dataset_names[[dataset_id]]
        cmd <- paste(cmd, " ", shQuote(paste(dataset_name, ":genes", 
            sep = "")), sep = "")
    }
    cmd <- paste(cmd, " -o '", output, "'", sep = "")
    print(paste("Running command: ", cmd, sep = ""))
    system(cmd)
    print("Parsing output")
    output <- read.delim(output, header = T, stringsAsFactors = F, 
        row.names = NULL, check.names = FALSE, na.strings = c(""))
    return(output)
  }

yhoogstrate/FuMaR documentation built on May 4, 2019, 2:33 p.m.