readComp.Rd
Parses sample comparisons specified in <CMP>
line(s) of targets file
or in targetsheader
slot of SYSargs
object. All possible comparisons
can be specified with 'CMPset: ALL'.
readComp(file, format = "vector", delim = "-")
Path to targets file. Alternatively, a SYSargs
or SYSargs2
object can be assigned.
Object type to return: vector
or matrix
.
Delimiter to use when sample comparisons are returned as vector
.
list
where each component is named according to the name(s) used in the <CMP>
line(s) of the targets file. The list will contain as many sample comparisons sets (list components) as there are sample comparisons lines in the corresponding targets file.
## Return comparisons from targets file
targetspath <- system.file("extdata", "targets.txt", package="systemPipeR")
read.delim(targetspath, comment.char = "#")
#> FileName SampleName Factor SampleLong Experiment
#> 1 ./data/SRR446027_1.fastq.gz M1A M1 Mock.1h.A 1
#> 2 ./data/SRR446028_1.fastq.gz M1B M1 Mock.1h.B 1
#> 3 ./data/SRR446029_1.fastq.gz A1A A1 Avr.1h.A 1
#> 4 ./data/SRR446030_1.fastq.gz A1B A1 Avr.1h.B 1
#> 5 ./data/SRR446031_1.fastq.gz V1A V1 Vir.1h.A 1
#> 6 ./data/SRR446032_1.fastq.gz V1B V1 Vir.1h.B 1
#> 7 ./data/SRR446033_1.fastq.gz M6A M6 Mock.6h.A 1
#> 8 ./data/SRR446034_1.fastq.gz M6B M6 Mock.6h.B 1
#> 9 ./data/SRR446035_1.fastq.gz A6A A6 Avr.6h.A 1
#> 10 ./data/SRR446036_1.fastq.gz A6B A6 Avr.6h.B 1
#> 11 ./data/SRR446037_1.fastq.gz V6A V6 Vir.6h.A 1
#> 12 ./data/SRR446038_1.fastq.gz V6B V6 Vir.6h.B 1
#> 13 ./data/SRR446039_1.fastq.gz M12A M12 Mock.12h.A 1
#> 14 ./data/SRR446040_1.fastq.gz M12B M12 Mock.12h.B 1
#> 15 ./data/SRR446041_1.fastq.gz A12A A12 Avr.12h.A 1
#> 16 ./data/SRR446042_1.fastq.gz A12B A12 Avr.12h.B 1
#> 17 ./data/SRR446043_1.fastq.gz V12A V12 Vir.12h.A 1
#> 18 ./data/SRR446044_1.fastq.gz V12B V12 Vir.12h.B 1
#> Date
#> 1 23-Mar-2012
#> 2 23-Mar-2012
#> 3 23-Mar-2012
#> 4 23-Mar-2012
#> 5 23-Mar-2012
#> 6 23-Mar-2012
#> 7 23-Mar-2012
#> 8 23-Mar-2012
#> 9 23-Mar-2012
#> 10 23-Mar-2012
#> 11 23-Mar-2012
#> 12 23-Mar-2012
#> 13 23-Mar-2012
#> 14 23-Mar-2012
#> 15 23-Mar-2012
#> 16 23-Mar-2012
#> 17 23-Mar-2012
#> 18 23-Mar-2012
readComp(file=targetspath, format="vector", delim="-")
#> $CMPset1
#> [1] "M1-A1" "M1-V1" "A1-V1" "M6-A6" "M6-V6" "A6-V6" "M12-A12"
#> [8] "M12-V12" "A12-V12"
#>
#> $CMPset2
#> [1] "M1-A1" "M1-V1" "M1-M6" "M1-A6" "M1-V6" "M1-M12" "M1-A12"
#> [8] "M1-V12" "A1-V1" "A1-M6" "A1-A6" "A1-V6" "A1-M12" "A1-A12"
#> [15] "A1-V12" "V1-M6" "V1-A6" "V1-V6" "V1-M12" "V1-A12" "V1-V12"
#> [22] "M6-A6" "M6-V6" "M6-M12" "M6-A12" "M6-V12" "A6-V6" "A6-M12"
#> [29] "A6-A12" "A6-V12" "V6-M12" "V6-A12" "V6-V12" "M12-A12" "M12-V12"
#> [36] "A12-V12"
#>
## Return comparisons from SYSargs2 object
targets <- system.file("extdata", "targets.txt", package="systemPipeR")
dir_path <- system.file("extdata/cwl", package="systemPipeR")
args <- loadWorkflow(targets=targets, wf_file="hisat2/hisat2-mapping-se.cwl",
input_file="hisat2/hisat2-mapping-se.yml", dir_path=dir_path)
args <- renderWF(args, inputvars=c(FileName="_FASTQ_PATH1_", SampleName="_SampleName_"))
args
#> Instance of 'SYSargs2':
#> Slot names/accessors:
#> targets: 18 (M1A...V12B), targetsheader: 4 (lines)
#> modules: 1
#> wf: 0, clt: 1, yamlinput: 7 (inputs)
#> input: 18, output: 18
#> cmdlist: 18
#> Sub Steps:
#> 1. hisat2-mapping-se (rendered: TRUE)
#>
#>
readComp(args, format = "vector", delim = "-")
#> $CMPset1
#> [1] "M1-A1" "M1-V1" "A1-V1" "M6-A6" "M6-V6" "A6-V6" "M12-A12"
#> [8] "M12-V12" "A12-V12"
#>
#> $CMPset2
#> [1] "M1-A1" "M1-V1" "M1-M6" "M1-A6" "M1-V6" "M1-M12" "M1-A12"
#> [8] "M1-V12" "A1-V1" "A1-M6" "A1-A6" "A1-V6" "A1-M12" "A1-A12"
#> [15] "A1-V12" "V1-M6" "V1-A6" "V1-V6" "V1-M12" "V1-A12" "V1-V12"
#> [22] "M6-A6" "M6-V6" "M6-M12" "M6-A12" "M6-V12" "A6-V6" "A6-M12"
#> [29] "A6-A12" "A6-V12" "V6-M12" "V6-A12" "V6-V12" "M12-A12" "M12-V12"
#> [36] "A12-V12"
#>