correctFiles: This function run correctPP, correctFasta, correctDomains,...

Description Usage Arguments Value Examples

View source: R/correctFiles.R

Description

This function run correctPP, correctFasta, correctDomains, correctPriority and correctReport in a loop to correct all phyloprofile, extended fasta, domains, prioritylist and report file in a folder

Usage

1
correctFiles(directory, genome, scoreMode)

Arguments

directory

the path to the directory, that contains the files

genome

name of the genome, that should be removed

Value

none

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
## Create some pseudo data
genomeID <- c("HUMAN@9606@3", "AMPQU@400682@2")
priority_list <- c("HUMAN@9606@3", "AMPQU@400682@2")
table1 <- data.frame(genomeID, priority_list)

genomeID <- c("HUMAN@9606@3", "AMPQU@400682")
similar <- c(330, 313)
dissimilar <- c(3, 0)
missing <- c(4, 11)
duplicated <- c(1, 0)
ignored <- c(8, 22)

table2 <- data.frame(
    genomeID, similar, dissimilar, missing, duplicated,
    ignored
)

## Write them in files in a subfolder in the current working directory
wd <- getwd()
testFolder <- paste(wd, "/fCAT_functiontest", sep = "")
dir.create(testFolder, recursive = TRUE)
filePath1 <- paste(testFolder, "/table1.prioritylist", sep = "")
filePath2 <- paste(testFolder, "/table2.report", sep = "")
write.table(table1, filePath1, sep = "\t", row.names = FALSE, quote = FALSE)
write.table(table2, filePath2, sep = "\t", row.names = FALSE, quote = FALSE)

## Correcting
correctFiles(testFolder, "HUMAN@9606@3")

## Check if the file in the test folder are corrected
table1 <- read.table(filePath1, sep = "\t", header = TRUE)
print.data.frame(table1)
table2 <- read.table(filePath2, sep = "\t", header = TRUE)
print.data.frame(table2)

## Delete the folder
unlink(testFolder, recursive = TRUE)

giangnguyen0709/fCAT documentation built on Feb. 10, 2021, 4:31 a.m.