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

Reasoning behind matching of IDs #1 #529

Open
scienception opened this issue Dec 18, 2024 · 1 comment
Open

Reasoning behind matching of IDs #1 #529

scienception opened this issue Dec 18, 2024 · 1 comment

Comments

@scienception
Copy link

scienception commented Dec 18, 2024

Referring to file: code/example-with-provided-LD.R
in which case ind.chr3 and ind.chr2 are not the same?

## indices in 'df_beta'
ind.chr <- which(df_beta$chr == chr)
## indices in 'map_ldref'
ind.chr2 <- df_beta$`_NUM_ID_`[ind.chr]
## indices in 'corr_chr'
ind.chr3 <- match(ind.chr2, which(map_ldref$chr == chr))

'df_beta' was derived from this matching:
(info_snp <- tibble::as_tibble(snp_match(sumstats, map_ldref, return_flip_and_rev = T))), so it already contains the variants that are both in the summary statistics and map_ldref, as well as the right chromosome (which(df_beta$chr == chr)). So not sure what ind.chr3 <- match(ind.chr2, which(map_ldref$chr == chr)) is doing here.

@privefl privefl transferred this issue from privefl/paper-infer Dec 18, 2024
@privefl
Copy link
Owner

privefl commented Dec 18, 2024

What would you use instead?

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

No branches or pull requests

2 participants