choishingwan / PRSice

A software package for calculating, applying, evaluating and plotting the results of polygenic risk scores
http://prsice.info
GNU General Public License v3.0
180 stars 85 forks source link

Error: Invalid .bed file size for yyy_Chr2.QC.bed. #363

Open acca1562 opened 1 month ago

acca1562 commented 1 month ago

Thank you for your help the other day. I was able to create the covariate file using the pre-imputation files. Now, when I use this covariate file with the command: Rscript PRSice.R --prsice PRSice_linux --base xxx.gz --target yyy_Chr#.QC --binary-target T --pheno zzz.txt --pheno-col www --cov www.covariate --base-maf MAF:0.01 --base-info imputationInfo:0.8 --stat BETA --beta --snp SNPID --A1 Allele2 --A2 Allele1 --pvalue p.value --out yyy I encounter the error: Error: Invalid .bed file size for yyy_Chr2.QC.bed. When I changed the --target yyy_Chr#.QC part to --target yyy_Chr2.QC to process only chromosome 2, the analysis completed successfully. I also confirmed that there is no corruption in yyy_Chr2.QC.bed using the md5sum command. I am at a loss for what to do next and would greatly appreciate your guidance on how to resolve this issue. Thank you very much.

choishingwan commented 1 month ago

Check with plink. That error suggests given the sample size and variant number, we expected a different file size.

Sam

On Thu, Aug 8, 2024 at 4:47 AM acca1562 @.***> wrote:

Thank you for your help the other day. I was able to create the covariate file using the pre-imputation files. Now, when I use this covariate file with the command: Rscript PRSice.R --prsice PRSice_linux --base xxx.gz --target yyy_Chr#.QC --binary-target T --pheno zzz.txt --pheno-col www --cov www.covariate --base-maf MAF:0.01 --base-info imputationInfo:0.8 --stat BETA --beta --snp SNPID --A1 Allele2 --A2 Allele1 --pvalue p.value --out yyy I encounter the error: Error: Invalid .bed file size for yyy_Chr2.QC.bed. When I changed the --target yyy_Chr#.QC part to --target yyy_Chr2.QC to process only chromosome 2, the analysis completed successfully. I also confirmed that there is no corruption in yyy_Chr2.QC.bed using the md5sum command. I am at a loss for what to do next and would greatly appreciate your guidance on how to resolve this issue. Thank you very much.

— Reply to this email directly, view it on GitHub https://github.com/choishingwan/PRSice/issues/363, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJTRYR4SGZ4TNQDKERXWCDZQMWCDAVCNFSM6AAAAABMGAA6DOVHI2DSMVQWIX3LMV43ASLTON2WKOZSGQ2TKMRTGEZTQOA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

acca1562 commented 1 month ago

Actually, the output was: ~ Loading Genotype info from target

1900 people (1000 male(s), 900 female(s)) observed 1900 founder(s) included Error: Invalid .bed file size for yyy_Chr2.QC.bed

Based on your response, does this error mean that the file size is incorrect relative to the sample size (rather than the variant number)? I have followed the PRSice2 tutorial for the analysis, but I'm not sure how to check the file with PLINK. Could you provide some references or commands that might help? Thank you.

choishingwan commented 1 month ago

Both, the check is done by calculating the expected file size based on number of samples and variant. You will see that your file is rejected by plink too

Sam

On Thu, Aug 8, 2024 at 11:48 PM acca1562 @.***> wrote:

Actually, the output was: ~ Loading Genotype info from target

1900 people (1000 male(s), 900 female(s)) observed 1900 founder(s) included Error: Invalid .bed file size for yyy_Chr2.QC.bed

Based on your response, does this error mean that the file size is incorrect relative to the sample size (rather than the variant number)? I have followed the PRSice2 tutorial for the analysis, but I'm not sure how to check the file with PLINK. Could you provide some references or commands that might help? Thank you.

— Reply to this email directly, view it on GitHub https://github.com/choishingwan/PRSice/issues/363#issuecomment-2277086235, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJTRYTLXSLPW6VYIUXFLETZQQ3XNAVCNFSM6AAAAABMGAA6DOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZXGA4DMMRTGU . You are receiving this because you commented.Message ID: @.***>