PLINK: merge .bed files
3
3
Entering edit mode
9.4 years ago
bsmith030465 ▴ 240

Hi,

I had a set of .bed,.bim, .fam files (myfile1.bed, myfile2.bed, ...) that I wanted to merge to get one file in .bed , bim, fam format.

I am trying:

plink --file myfile1 --merge-list all_my_files.txt --make-bed --out mymerged

where all_my_files.txt is a file containing the filepaths for the files I want merged (myfile2, myfile3, ....)

However, I get the following error:

ERROR: No file [ myfile1.ped ] exists.

How can I specify that I want my bed (and not ped) files merged into a new bed file?

Many thanks!

plink • 52k views
ADD COMMENT
1
Entering edit mode

Aren't you merging binary files? You should use --bfile:

plink --bfile myfile1 --merge-list all_my_files.txt --make-bed --out mymerged
ADD REPLY
0
Entering edit mode

Hi alesssia,

Thanks for that. My command is now:

plink --bfile myfile1 --merge-list all_my_files.txt --make-bed --out mymerged

and my all_my_files.txt now contains:

myfile10.bed
myfile10.bim
myfile10.fam
myfile11.bed
myfile11.bim
myfile11.fam
.
.
.

Does this look like the right command, and does my file list contain the correct nomenclature/order of the files?

thanks!!

ADD REPLY
0
Entering edit mode

Hi Alesssia,

thanks!

ADD REPLY
0
Entering edit mode
9.3 years ago

The --merge-list (without a preceding b) flag is also used to merge multiple binary filesets; see alesssia's link.

Note that you cannot split a fileset across multiple lines of the --merge-list file; i.e. bsmith030465's sample all_my_files.txt is not in the correct input format. Either fully spell out all three filenames on the same line in .bed-.bim-.fam order, or include just the common prefix (this latter mode is only supported by PLINK 1.9).

ADD COMMENT
0
Entering edit mode
9.3 years ago
deepue ▴ 160
plink --bfile myfile1 --bmerge-list all_my_files.txt --make-bed --out mymerged

should work.

ADD COMMENT
0
Entering edit mode
4.0 years ago
shiy05 ▴ 30

I use plink v1.07, and merged bed files using command:

plink --merge-list allfiles.txt --make-bed --out mynewdata
#error: plink --noweb --bfile fA --merge-list allfiles.txt --make-bed --out mynewdata
#please do not use bfile, or file, or else it will combine the first file without pruned, damn it!!

the allfiles.txt shows like:

fA.ped fA.map
fB.ped fB.map
fC.ped fC.map
fD.ped fD.map
fE.bed fE.bim fE.fam
fF.bed fF.bim fF.fam
fG.bed fG.bim fG.fam
fH.bed fH.bim fH.fam

Important:

Each fileset must be on a line by itself: lines with two files are interpreted as PED/MAP filesets; lines with three files are interpreted as binary BED/BIM/FAM filesets. The files on a line must always be in this order (PED then MAP; BED then BIM then FAM)

ADD COMMENT

Login before adding your answer.

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