converting bgen to bed file - Segmentation fault / Out[132]: 35584

240 views
Skip to first unread message

Emile Dimas

unread,
Apr 1, 2020, 10:58:49 AM4/1/20
to plink2-users
Hello Everyone,

I am relatively new to plink. I am using the script (python) of a collaborator to convert bgen files to bed files using plink, well at least that's what I think it is. The script is the following :

plink_dir + ' --bfile {bgen_file } --maf {maf} --hwe {hwe} --mind {mind} --geno {geno} --make-bed --out {output_file} '

when I run this script, it takes a lot of time (which I think is already a bad sign) and then it stops with the following flag:

Segmentation fault

Out[132]: 35584


- Can anyone please tell me what is going on? why is it taking so much time? is it normal? what can I do to make it work and make it faster? 


Also, my collaborator used 2 arguments :

--max-alleles
which works only on the old version of plink, is there an alternative on plink2?
--keep
which I know is explained in the documentation, but to be honest, I did not understand what it means, may someone explain it to me?

Sorry to ask so many dumb questions, and thank you in advance
Regards,
Emile


Christopher Chang

unread,
Apr 1, 2020, 11:17:40 AM4/1/20
to plink2-users
As posted, this script doesn't make sense: .bgen files are not loaded with --bfile, and any plink version would error out immediately.

Can you add --debug to the main command line, and then post the .log file that is generated by the segfaulting run?

Emile Dimas

unread,
Apr 1, 2020, 12:28:12 PM4/1/20
to plink2-users
Will do, I will come back with the result when it stops, Thank you Mr. Chang
Message has been deleted
Message has been deleted

Christopher Chang

unread,
Apr 1, 2020, 3:08:48 PM4/1/20
to plink2-users
.bgen files should be converted to plink 2.0's .pgen format.  You probably want to rework most of the script to use plink2 and --pfile/--make-pgen instead of --bfile/--make-bed, unless you want to throw away all the dosage information in the .bgen file and introduce missing calls.

In the meantime, even if you provide the wrong input to plink, it should not segfault.  Can you post a .log file from a segfaulting run?

On Wednesday, April 1, 2020 at 12:00:43 PM UTC-7, Emile Dimas wrote:
Pr. Chang, you are right, the input should be a bed file instead of a bgen file. However, I have been files, how can I convert them to bed files?

Emile Dimas

unread,
Apr 1, 2020, 3:15:59 PM4/1/20
to plink2-users
Yes, It is running, once it stops, I will post the log file. Thank you so much Pr. Chang

Emile Dimas

unread,
Apr 2, 2020, 10:04:51 AM4/2/20
to plink2-users
Here is the log file :

Screen Shot 2020-04-02 at 10.00.43 AM.png

Then the script stops with the following message:

Segmentation fault

Out[143]: 35584 


Note that I am running the command from python. My input files are .bed .bim and .fam files all having the same root name.


Thanks again.

Christopher Chang

unread,
Apr 2, 2020, 11:10:50 AM4/2/20
to plink2-users
Why are you still using plink 1.07? Please rerun with 1.9 or 2.0.

Emile Dimas

unread,
Apr 2, 2020, 12:19:08 PM4/2/20
to plink2-users
Thank you it works!!
Reply all
Reply to author
Forward
0 new messages