Hi!
I'm trying to run the test data to better understand the software but I have the following problem. It seems that "hesin.csv.gz" file didn't have the correct colnames, in fact it only have 4 columns and it is suposed to have more. I also found an error with "GPC.csv.gz" file because of an incorrect colname, but I have change it manually. Can you please help me with this issue?
./02_data_preparation.R
--save_location $phewas_folder/data/
--min_data $phewas_folder/data/min_tab_test.gz
--hesin_diag $package_folder/extdata/worked_example/HES_Diag.csv.gz
--HESIN $package_folder/extdata/worked_example/hesin.csv.gz
--death_cause $package_folder/extdata/worked_example/death.csv.gz
--death $package_folder/extdata/worked_example/death_date.csv.gz
--king_coef $package_folder/extdata/worked_example/KING_coef.csv.gz
--GPC $package_folder/extdata/worked_example/GPC_new.csv.gz
Joining with by = join_by(eid)
Joining with by = join_by(eid)
Error in dplyr::na_if()
:
! Can't convert y
to match type of x
<data.table>.
Backtrace:
▆
- ├─DeepPheWAS::data_preparation_R(...)
- │ └─... %>% tidyr::drop_na()
- ├─tidyr::drop_na(.)
- ├─dplyr::select(., .data$eid, .data$ins_index, .data$dates)
- ├─dplyr::mutate(., dates = lubridate::dmy(.data$dated))
- ├─dplyr::mutate(...)
- ├─dplyr::na_if(., "")
- │ └─vctrs::vec_cast(x = y, to = x, x_arg = "y", to_arg = "x")
- └─vctrs (local)
<fn>
()
- └─vctrs::vec_default_cast(...)
-
├─base::withRestarts(...)
-
│ └─base (local) withOneRestart(expr, restarts[[1L]])
-
│ └─base (local) doWithOneRestart(return(expr), restart)
-
└─vctrs::stop_incompatible_cast(...)
-
└─vctrs::stop_incompatible_type(...)
-
└─vctrs:::stop_incompatible(...)
-
└─vctrs:::stop_vctrs(...)
-
└─rlang::abort(message, class = c(class, "vctrs_error"), ..., call = call)
Warning messages:
1: There was 1 warning in dplyr::mutate()
.
ℹ In argument: date_of_dx = lubridate::ymd(...)
.
Caused by warning:
! 295 failed to parse.
2: In data_preparation_R(min_data = arguments$min_data, GPC = arguments$GPC, :
'HESIN' does not have the correct colnames and may not produce the correct output, expected colnames are:
'eid,ins_index,dsource,source,epistart,epiend,epidur,bedyear,epistat,epitype,epiorder,spell_index,spell_seq,spelbgin,spelend,speldur,pctcode,gpprpct,category,elecdate,elecdur,admidate,admimeth_uni,admimeth,admisorc_uni,admisorc,firstreg,classpat_uni,classpat,intmanag_uni,intmanag,mainspef_uni,mainspef,tretspef_uni,tretspef,operstat,disdate,dismeth_uni,dismeth,disdest_uni,disdest,carersi'
not:
eid,ins_index,epistart,admidate
differences between inputed file and expected are:
dsource,source,epiend,epidur,bedyear,epistat,epitype,epiorder,spell_index,spell_seq,spelbgin,spelend,speldur,pctcode,gpprpct,category,elecdate,elecdur,admimeth_uni,admimeth,admisorc_uni,admisorc,firstreg,classpat_uni,classpat,intmanag_uni,intmanag,ma [... truncated]
Best regards,
Judit