Question: Merging bed bim fam files from chromosome 1 to 22 at one time
0
gravatar for khn
22 months ago by
khn110
khn110 wrote:

Hello,

I am trying to merge multiple bed bim fam files (each chromosome has separate file) into one file.

plink --allow-no-sex --bfile XX.chr1 --merge-list mylist.txt --make-bed --out XX.ch1-22

This does not work.

mylist.txt contains:

XX.chr2.bed XX.chr2.bim XX.chr2.fam
XX.chr3.bed XX.chr3.bim XX.chr3.fam
XX.chr4.bed XX.chr4.bim XX.chr4.fam
...
XX.chr22.bed XX.chr22.bim XX.chr22.fam

Thank you in advance!

snp genome • 2.7k views
ADD COMMENTlink modified 9 weeks ago by T.F0 • written 22 months ago by khn110

Is plink giving you an error? Otherwise, please define "does not work".

ADD REPLYlink written 22 months ago by Devon Ryan93k

Yes, it says that "cannot open the file XX.chr2.fam". What would you think is wrong?

ADD REPLYlink written 22 months ago by khn110

Does that file exist?

ADD REPLYlink written 22 months ago by Devon Ryan93k

Yes. I changed the txt file to csv file, but it still says "Error: Failed to open XX.chr2.fam."

ADD REPLYlink modified 22 months ago • written 22 months ago by khn110

Message is as below... What would you think is wrong??

* MB RAM detected; reserving MB for main workspace. .ped scan complete (for binary autoconversion). Performing single-pass .bed write ( variants, * people). --file: XX.ch1-22-temporary.bed + XX.ch1-22-temporary.bim + xx.ch1-22-temporary.fam written. Error: Failed to open XX.ch2.fam.

ADD REPLYlink written 22 months ago by khn110

@khn How did you solve this problem? I am also new to plink. I am facing the same problem. How can we merge multiple binary files of different chromosomes using plink?

ADD REPLYlink written 12 months ago by bk1140
1

Hi, it seems I just solved my problem on this issue. It may worth to check the file path in your merge-list text file, which means you need to make sure each path is really directed to the corresponding bed/bim/fam file, not just the file name, but the completed path to it. Hope it helps. Xiao

ADD REPLYlink written 12 weeks ago by mike31317710

I have a similar trouble, but it seems to be different.

After conduct of command described in this page, XX.ch1-22-merge.fam XX.ch1-22-merge.missnp XX.ch1-22.log were generated, and no XX.ch1-22-merge.bed XX.ch1-22-merge.bim.

Is there any solutions?

ADD REPLYlink written 9 weeks ago by T.F0

Please use ADD COMMENT and not the answer field. This is reserved for answers and helps to keep the thread organized. Thanks.

ADD REPLYlink written 9 weeks ago by ATpoint28k

See https://www.cog-genomics.org/plink/1.9/data#merge3 .

ADD REPLYlink written 9 weeks ago by chrchang5236.4k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1659 users visited in the last hour