Convert .gprobs files to PLINK format
1
1
Entering edit mode
5.8 years ago
lauretomas ▴ 10

Hello all, I have some imputed .gprobs files (one per chromosome), imputed by Impute2 downloaded from dbGaP, and I need to convert this file into .bed format of PLINK in order to do some analysis.

My .gprobs files look like:

--- rs371609562:61395:CTT:C 61395 CTT C 0 0.023 0.977 0 0.039 0.961 0 0.015 0.985 0 0.026 0.974 0 0 1 0 0 1 0 0 1

Could someone help me find out how convert this kind of file into PLINK format? Or guide me about which files I need to perform the convertion?

gprobs snp PLINK genome dbGaP • 2.9k views
ADD COMMENT
0
Entering edit mode

Hi @lauretomas,

Do you reckon any tools/scripts described in the previous post would help? Converting Between Impute2 And Ped/Map After Imputation - 1St Column Dashes Problem

ADD REPLY
0
Entering edit mode

Thanks. I have seen that post, and tried some tools from there, but I lost some information in the process so I posted my own question to see if anyone know a direct conversion for my data, that is not the same that the one in that post.

ADD REPLY
3
Entering edit mode
5.8 years ago

If you want to just round dosages to the nearest integer (and erase the dosages which are too far from an integer), you can use plink 1.9's --gen flag to import this type of file. (You'll also need to use --oxford-single-chr to address the '---' chromosome codes.)

If you want to actually save the dosages and use them in association analysis, etc., use plink 2.0, and --make-pgen instead of --make-bed.

ADD COMMENT
0
Entering edit mode

I've tried the following code:

plink --gen file_chr10.gprobs.gz --sample file.sample --oxford-single-chr 10 --make-bed --out output

It started converting variants, but then it gave an error:

Error: File read failure.

And I donĀ“t know why it gives this error.

I think it could be because I didn't extract the sample.gz file, because it gives me an error, instead I did less file.sample.gz > file.sample

Any lead about how to extract properly the file.sample.gz? I've tried gunzip and other tools

ADD REPLY
0
Entering edit mode

I know this thread is ~3 years old, but just adding this in case someone comes here looking for this answer...

That code should work, but plink can't read zipped (.gz) files. So, you first need to unzip (using gunzip).

gunzip file_chr10.gprobs.gz

And then run:

plink --gen file_chr10.gprobs --sample file.sample --oxford-single-chr 10 --make-bed --out output
ADD REPLY
0
Entering edit mode

Incidentally, all plink 2.0 text-file-reading commands (including --gen) accept gzipped input. You're correct that this isn't true for plink 1.9, though.

ADD REPLY

Login before adding your answer.

Traffic: 3131 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6