How to create a BED file for liftOver form Plink .bed .bim and .fam filed
0
0
Entering edit mode
6.4 years ago
OAJn8634 ▴ 60

Hi, I need to ensure that my current genetic data are aligned with build 37. For this I would like to use liftOver algorithm, which accepts BED file only. This file needs to contain three main columns: Chr, Chr Start and Chr End. However, I have not been able to find a way of creating such a file using my current Plink files (.fam, .bed. and .bim). I am sorry if this question is naïve or silly; I am very new to this type of analysis so I will be extremely grateful for any advice and suggestions. Many thanks. O

liftOver Plink BED • 5.4k views
ADD COMMENT
0
Entering edit mode

Hello,

You can use plink files directly for liftOver, have a look here

ADD REPLY
0
Entering edit mode

Thank you for your response. I have tried to employ information provided on this page but I find myself more confused than I already am. Following the instructions, I have run the following command:

python liftOverPlink.py --map my_data --out lifted --chain hg18ToHg19.over.chain.gz

However, I received the following message and error and I have no idea who to resolve it. Just to mention, that my data is indeed located in the directory where the liftOver and liftOverPlink are based

Converting MAP file to UCSC BED file... Traceback (most recent call last): File "liftOverPlink.py", line 160, in <module> makesure(map2bed(args.mapFile, oldBed), File "liftOverPlink.py", line 41, in map2bed for ln in myopen(fin): File "liftOverPlink.py", line 34, in myopen return open(fn)

IOError: [Errno 2] No such file or directory: 'my_data'
  

I will be grateful for your help. Thank you.

ADD REPLY
0
Entering edit mode

So, the error is really self-explanatory - there is no file called as "my_data" in the folder from where you are running the tool. Also, if you read the manual, it says the --map requires the file to be in plink MAP format and not the binary or bim format. So first, you will have to convert bim/bed/fam to map/ped format and then try running the command.

ADD REPLY
0
Entering edit mode

Thank you so much for this. I have now created the plink MAP and have managed to utilise the liftOver but the web-based tool (not the command-line). If you do not mind, would you be able to help me please to convert the BED file from the liftOver BED back to MAP and then map/ped back to bim/bed/fam. I know you may sound silly and obvious, but this is the first time that I am doing this and I feel lost. Thank you

ADD REPLY
0
Entering edit mode

Again....... if you read the manual of liftOverPlink - it is all given very clearly how to do this with all the commands.

ADD REPLY
0
Entering edit mode

Of course, I will be happy to. My gwas data is currently in the standard plink format: my_data.bed, my_data.bim and my_data.fam.

The BED file that I generated using the liftOver looks like this:

chr1    82153   82154   rs4477212 chr1  534246  534247  kgp15717912
chr1    565373  565374  rs9701779 chr1  569623  569624  kgp7727307
chr1    723917  723918  kgp15297216 chr1    752565  752566  rs3094315
chr1    752720  752721  rs3131972 chr1  754062  754063  kgp6703048
chr1    756651  756652  kgp22792200 chr1    757690  757691  kgp15557302

My MAP file looks like this:

1   rs4477212   59.9709 82154 1 kgp15717912 13.65   534247
1   rs9701779   61.7127 565374 1    kgp7727307  101.095 569624
1   kgp15297216 122.913 723918 1    rs3094315   99.0518 752566
1   rs3131972   87.6431 752721 1    kgp6703048  127.121 754063
1   kgp22792200 108.652 756652 1    kgp15557302 12.2958 757691

So now I do not know how to convert the liftOver BED file back to plink PED/MAP file and from there to bim/bed/fam. My understanding is that this conversion need to be made before I proceed with further analysis. Please do let me know if this is not sufficient and I will be happy o provide you with more details about my data. Thank you

ADD REPLY
0
Entering edit mode

So this does not look like a standard MAP file. Have a look at the file formats here and here

ADD REPLY
0
Entering edit mode

Hello, I have encountered the same problem now. I do not know how to convert the liftOver BED file back to plink PED/MAP file.I don't know if you solved it, I really need your help.Thank you!

ADD REPLY

Login before adding your answer.

Traffic: 2662 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