keep_data_subset: Select a subset of count and target data based on metadata...

Description Usage Arguments Value See Also Examples

Description

This function, given count data and target metadata, will return a subset of both count and target data including only data with values corresponding to selection parameters. For example, you can select count and target data for only timepoint "day1". Multiple valid keep selections can also be used.

Usage

1
2
keep_data_subset(counts, targets, target_count_id_map, target_keep_col,
  target_keep_val)

Arguments

counts

Count data as prepared with prep_counts().

targets

Target data as prepared with prep_targets().

target_count_id_map

Column in targets file whose values corresponds with count data column ids.

target_keep_col

Column in target data to select values by. For instance, to select "day1" data from the "timepoint" column, this argument should be "timepoint".

target_keep_val

Value from target_keep_col to keep in the subset data. For instance, to select "day1" data from the "timepoint" column, this argument should be "day1". Multiple values can be selected by providing a concatenated set of values. I.E. To keep day1 and day2 data, this argument should be, c("day1","day2").

Value

This function returns count and target data based on the target_keep_col and target_keep_val parameters. Counts will be returned as the [[1]] index and target data will be returned as the [[2]] index.

See Also

prep_counts, prep_targets, exclude_data_subset

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
## Not run: 

myCounts <- prep_counts(count_input="master_count_data.txt", delim="t")
myTargets <- prep_targets(target_input="master_count_data.txt", delim="t")

#Get data for only "timepoint" at "day1".
data_subset <- keep_data_subset(counts=myCounts, targets=myTargets,
                                  target_count_id_map="sample_id",
                                  target_keep_col="timepoint",
                                  target_keep_val="day1")

#Count data is stored in the first index returned by the function.
subset_counts <- data_subset[[1]]

#Target data is stored in the second index returned by the function.
subset_targets <- data_subset[[2]]


#Get data for only "timepoint" at "day1" and "day2".
data_subset <- keep_data_subset(counts=myCounts, targets=myTargets,
                                  target_count_id_map="sample_id",
                                  target_keep_col="timepoint",
                                  target_keep_val=c("day1","day2"))

#Count data is stored in the first index returned by the function.
subset_counts <- data_subset[[1]]

#Target data is stored in the second index returned by the function.
subset_targets <- data_subset[[2]]


## End(Not run)

DEVis documentation built on May 2, 2019, 3:18 p.m.