Question: Plink bed files not recognized by samtools or bedtools
gravatar for gui.casas
5.9 years ago by
gui.casas10 wrote:


I am trying to convert a .bam file to a .pileup using samtools and filtering the sites via a .bed file I obtained from plink. However, when I type the command

samtools mpileup -f ../../HG19/hg19.fasta -l ../../reference_population/Total_Reference/Total_Reference.bed 26305300.rmdup.bam

I get the error message

[bed_read] Parse error reading ../../reference_population/Total_Reference/Total_Reference.bed at line 1
samtools: Could not read file "../../reference_population/Total_Reference/Total_Reference.bed": Success

It works well if you remove the -l flag, so I tried bedtools intersect to filter the .bam file and then use samtools, but I got the error

Error: Unable to determine type for file ../../reference_population/Total_Reference/Total_Reference.bed

I have tried using both plink 1.07 and plink 1.9 and the result was the same. Can anyone shed a light on this please?

next-gen software error • 2.3k views
ADD COMMENTlink modified 5.9 years ago by Caddymob980 • written 5.9 years ago by gui.casas10
gravatar for Caddymob
5.9 years ago by
United States
Caddymob980 wrote:

A plink bed file is a binary PED, not a text BED - totally different... See the UCSC page for the format:

ADD COMMENTlink written 5.9 years ago by Caddymob980

That explains a lot... Thanks! I think I would have spent another week or so searching what was going wrong xD

ADD REPLYlink written 5.9 years ago by gui.casas10
Please log in to add an answer.


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