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: LD estimation with physical position instead of genetic distance #257

Open
deepchocolate opened this issue Apr 25, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request no-issue-activity

Comments

@deepchocolate
Copy link
Contributor

deepchocolate commented Apr 25, 2024

Is your feature request related to a problem? Please describe.
snp_cor used in the calculateLD.R script can calculate correlation between SNPs using physical position or genetic distance. Right now this script has been built around using genetic distance in centimorgans, requiring the use of genetic maps.

GD <- snp_asGeneticPos(CHR, POS, dir=dirGeneticMaps, type=argGeneticMapsType, ncores=NCORES)
if (is.null(GD)) stop('Genetic distance is not available')

corr0 <- snp_cor(G, ind.col=indices.G, ind.row=individualSample, size=argWindowSize/1000,
infos.pos=GD[indices.G], ncores=NCORES, thr_r2=argThresholdR2)

An unrelated issue is that I've seen warnings when running this script. This can be due to missing files as these lines:

if (nDataPoints == 0) {
warning('\nSkipping chromosome ', chr,'. Reason: 0 SNPs available\n')
next
}

Could be fixed by appending warnings() to the end of the script, but it would be better that they were outputted immediately. Guess there is some option one can set at the start of the script for that to happen.

Describe the solution you'd like
Make it possible to calculate LD using physical position instead. It's probably best to replace the --arg-window-size with --mode-distance-physical and --mode-distance-genetic that both take an optional argument (distance in no basepairs or centimorgans). Should be a requirement to specify one of these.

The size argument to snp_cor is interpreted as basepairs without the info argument, but kilobasepairs with it. Probably better to specify the same unit in both modes, but convert them prior o passing values to snp_cor.

@deepchocolate deepchocolate added the enhancement New feature or request label Apr 25, 2024
@deepchocolate deepchocolate self-assigned this Apr 25, 2024
Copy link

This issue appears to be stale due to non-activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request no-issue-activity
Projects
None yet
Development

No branches or pull requests

1 participant