Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LDpred2: Character in chromosome column causes error #138

Closed
deepchocolate opened this issue Feb 22, 2023 · 3 comments · Fixed by #131
Closed

LDpred2: Character in chromosome column causes error #138

deepchocolate opened this issue Feb 22, 2023 · 3 comments · Fixed by #131

Comments

@deepchocolate
Copy link
Contributor

Describe the bug
If using sumstats that contain contain character in the chromosome column this will cause an error as below. In this case due to the presence of "X".
image

Expected behavior
This is unclear.

Additional context
As of now, happens when users join up chromosome and position from HRC data to sumstat files generated by meta-analyses.

@espenhgn
Copy link
Contributor

I would've assumed bigreadr assumes that the sumstats chr column should only be numeric, but couldn't find a clear statement that values in each column all must have the same type. Can bigreadr::fread2 read the file as on this page?

Anyway, perhaps this issue is better opened at https://github.com/privefl/bigsnpr/issues instead? There may be a sort of similar case with snp_match() reporte here: privefl/bigsnpr#120

@deepchocolate
Copy link
Contributor Author

I would've assumed bigreadr assumes that the sumstats chr column should only be numeric, but couldn't find a clear statement that values in each column all must have the same type. Can bigreadr::fread2 read the file as on this page?

Anyway, perhaps this issue is better opened at https://github.com/privefl/bigsnpr/issues instead? There may be a sort of similar case with snp_match() reporte here: privefl/bigsnpr#120

Yeah, I think if the intended use is to only do numeric matching on chromosome the snp_match function should list these rows as excluded. But for our purposes It's probably faster just to filter these rows out

@espenhgn
Copy link
Contributor

The vctrs::vec_in function may accept NA for missing values (https://vctrs.r-lib.org/reference/vec_match.html), so replacing 'X' by NA could also by an option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants