Question: Getting different results from bedtools and samtools
gravatar for wstla27
7 months ago by
wstla270 wrote:

Hi, I am trying to extract expression counts from some bam files. When I used bedtools to do so, I got all 0 for every specified region (in bed file). But when I used samtools, the counts were there.

For bedtools, the code is following: bedtools multicov -bams in.bam -bed annotation.bed | head -3

0   1   17578815    17609595    LAP3    0

1   1   201980827   202041410   CFLAR   0

2   1   45429998    45590913    LARS2   0

For samtools, I used samtools view -c in.bam chr1:17578815-17609595 and the result I got is 24, and for the other two regions, I got 11 and 5147 respectively.

So I am wondering that what I was doing wrong? Or which result should I trust?

ADD COMMENTlink modified 7 months ago by Pierre Lindenbaum126k • written 7 months ago by wstla270

Check that your chromosome names in the bed file have the same name like in your bam file, e.g. chr1 is different to 1.

ADD REPLYlink written 7 months ago by finswimmer13k

I tried adding chr to the chromosome number in the bed file, but I think bedtools can not recognize such form. It is giving me the error: Unexpected file format. Please use tab-delimited BED, GFF, or VCF. Perhaps you have non-integer starts or ends at line 1?

ADD REPLYlink written 7 months ago by wstla270

Please show us some lines of your bed file. Also make sure that the columns are tab delimited.

ADD REPLYlink written 7 months ago by finswimmer13k
gravatar for Pierre Lindenbaum
7 months ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum126k wrote:

because multicov has some default filters:

bool keepDuplicates    = false;
bool keepFailedQC = false;

see also option -F and -f of samtools view

ADD COMMENTlink written 7 months ago by Pierre Lindenbaum126k
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: 808 users visited in the last hour