Closed fmadani closed 2 years ago
Why do you want to split by chromosome?
You can always use the --chr
parameter in PLINK or in snp_plinkQC()
(as in https://github.com/privefl/bigsnpr/blob/master/data-raw/public-data.R#L9).
Please post on my repo if you have other questions not related to these tutorials.
Thanks Florian!. Yes, this is a repo for the general PRS. For software specific questions, it is best referred back to their own repository
Why do you want to split by chromosome?
You can always use the
--chr
parameter in PLINK or insnp_plinkQC()
(as in https://github.com/privefl/bigsnpr/blob/master/data-raw/public-data.R#L9).Please post on my repo if you have other questions not related to these tutorials.
@privefl as I explained in details in my previously sent email to you, and as I mentioned in the title of the post, in LDPred-2, there is a step for 'LD matrix calculation' in which there are two options: 1) genome wide and 2) chromosome based. To practice the chromosome based code, there are no chromosome based bed files available, and ,obliviously, we get error when we run the chromosome based code. That is why I asked about how we can provide chromosome based bed files when we have a genome wide bed file.
If we test the code of LD Matrix calculation for chromosome based bed files, we get error because there are no chromosome based bed files. That is the main reason of my question
For future practitioners. Please use this code in PLINK to generate chromosome based bed files from EUR.QC.bed:
myPlink = 'EUR.QC' for chr in {1..23}; do \ plink --bfile myPlink --chr $chr --make-bed --out myPlink_${chr}; \ done
I took it from here: https://www.biostars.org/p/387132/ and customized for the case.
Kudos to biostars.org participants!
There is a parameter ind.col
that enables you to provide a subset of variants to use (e.g. for one chromosome) to be able to compute per-chromosome LD matrices without needing to split the data in any way.
This parameter is actually used in both tutorials (https://choishingwan.github.io/PRS-Tutorial/ldpred/ and https://privefl.github.io/bigsnpr/articles/LDpred2.html).
ind.col
That is right, but it is commented _# Assuming the file naming is EURchr#.bed meaning there are no chromosome bed files available. I tested the code and got error because of that.
Hi Florain @privefl,
I'd like to know how we can prepare chromosome based bed file by using bigsnpr. My understanding is that we can split the original bed file to 23 chromosome based bed files. The question is if there is any specific command in bigsnpr or bigstatr to prepare the chromosome based bed file? Unfortunately, I couldn't figure such a command out by reviewing the manuals. If there is no command, please advise me about other R libraries and even PLINK.
Regards