Hi , I am trying to use cfDNA pro package . I have four directories namely Blood , Urine, Blood_control and Urine_contro where my four cohorts are stored. I generated a data path object using following code
data=list.files(path = ".", pattern = "txt", all.files = FALSE,
full.names = FALSE, recursive = TRUE)
Data path file looks like following
[1] "blood_control/Control-2.txt"
[2] "blood_control/Control-3.txt"
[3] "blood_control/Control-4.txt"
[4] "blood_control/Control-5.txt"
[5] "blood/APK-01-0027.txt"
[6] "blood/APK-01-0029.txt"
Then Created a group list
grp_list<-list("cohort_1"="blood",
"cohort_2"="urine",
"cohort_3"="blood_control",
"cohort_4"="urine_control")
Then I used following code to generate plot as list.
result<-sapply(grp_list, function(x){
result <-callSize(path = data) %>%
dplyr::filter(group==as.character(x)) %>%
plotSingleGroup()
}, simplify = FALSE)
I am getting the following error. It seems that package is looking for an object called "group"
setting default outfmt to df.
setting default input_type to picard.
Error in dplyr::filter()
:
! Problem while computing ..1 = group ==
as.character(x)
.
Caused by error:
! object 'group' not found
Backtrace:
- base::sapply(...)
- dplyr:::filter.data.frame(., group == as.character(x))
- dplyr:::filter_rows(.data, ..., caller_env = caller_env())
- dplyr:::filter_eval(dots, mask = mask, error_call = error_call)
- mask$eval_all_filter(dots, env_filter) Error in dplyr::filter(., group == as.character(x)) : Caused by error: ! object 'group' not found ‘/tmp/Rtmp0ToHu5/downloaded_packages’