bedtools genomecov -scale problem
0
0
Entering edit mode
5.4 years ago
linjc.xmu ▴ 30

Deal all, I am using bedtools to produce a bedgraph from bed file. a.bed is:

Chr1 5846 5847 1
Chr1 5851 5852 1
Chr1 5861 5862 2

Then I use:

bedtools genomecov -bg -strand + -i a.bed -scale unscaled -g chrom.size > a.bedgraph

This will change the column 3 into 0. If I use:

bedtools genomecov -bg -strand + -i a.bed -scale 10 -g chrom.size > a.bedgraph

This will change the column 3 into all 10.

bedtools version is 2.27.0

I think there is some problem in it. Can anyone help me? Thanks a lot

software error • 1.5k views
ADD COMMENT
1
Entering edit mode

I cannot reproduce this. First, you input file has no strand information, so bedtools should throw an error when using -strand +. Also, -scale only acts on column 4. Can you double-check that your input files are ok. Please show head a.bed, head a.bedgraph for both outputs and head chrom.sizes.

ADD REPLY
0
Entering edit mode

Thanks. head a.bed

Chr1    5846    5847    1   PAreal  +
Chr1    5847    5848    1   PAreal  +
Chr1    5851    5852    1   PAreal  +
Chr1    5861    5862    1   PAreal  +
Chr1    5893    5894    1   PAreal  +
Chr1    5894    5895    1   PAreal  +
Chr1    5896    5997    400 PAreal  +
Chr1    6790    6791    10  PAreal  -
Chr1    6792    6793    1   PAreal  -
Chr1    6812    6813    8   PAreal  -
Chr1    6814    6815    8   PAreal  -
Chr1    6815    6816    4   PAreal  -
Chr1    6851    6852    1   PAreal  -
Chr1    6853    6854    1   PAreal  -
Chr1    6855    6856    15  PAreal  -
Chr1    6856    6857    1   PAreal  -
Chr1    6858    6859    7   PAreal  -
Chr1    6863    6864    1   PAreal  -
Chr1    6881    6882    2   PAreal  -
Chr1    6897    6898    3   PAreal  -
Chr1    6900    6901    3   PAreal  -

head a.bedgraph

Chr1    5846    5848    0.6
Chr1    5851    5852    0.6
Chr1    5861    5862    0.6
Chr1    5893    5895    0.6
Chr1    5896    5997    0.6

head chrom.sizes

Chr1    30427671
Chr2    19698289
Chr3    23459830
Chr4    18585056
Chr5    26975502
ADD REPLY
1
Entering edit mode

Hello linjc.xmu ,

these files looks fine to me (and they have nothing to do with your example in the initial post). So what's your problem with them?

fin swimmer

ADD REPLY

Login before adding your answer.

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