I am relatively sure you need to use the -bg (or -bga to include zero intervals) argument to genomecov to trigger bedGraph output. Otherwise it's a histogram-like output. Try that. What is the output of head SRR212304.bedGraph?
Just adding for completeness, you could use bamCoverage from deeptools. Relatively slow, but one single command to do that all. Lots of options to choose from for customization. Could save trouble.
To Normalize BigWig file based on bamCoverage I use this commands
bamCoverage -b SRR21230488_marked_duplicates.bam -o output.bw --normalizeUsing RPKM
It would be aapreciated if you let me know your comments.
Best
By default, bedtools genomecov will compute a histogram of coverage for the genome file provided. The default output format is as follows:
chromosome (or entire genome)
depth of coverage from features in input file
number of bases on chromosome (or genome) with depth equal to column 2.
size of chromosome (or entire genome) in base pairs
fraction of bases on chromosome (or entire genome) with depth equal to column 2.
so you don't get a format CHROM/START/END BUT CHROM/DEPTH/COUNT...
you want the option -bg
the -bg option instead produces genome-wide coverage output in BEDGRAPH format. This is a much more concise representation since consecutive positions with the same coverage are reported as a single output line describing the start and end coordinate of the interval having the coverage level, followed by the coverage level itself.
I am relatively sure you need to use the
-bg
(or-bga
to include zero intervals) argument to genomecov to trigger bedGraph output. Otherwise it's a histogram-like output. Try that. What is the output ofhead SRR212304.bedGraph
?Thank you so much for your response I used -bg and generated novel bedgraph file and then i have sorted
but i got this error when i wanted to generate BigWig file
It would be appritiate if you could help me.
I wrote this command
LC_ALL=C sort -t $'\t' -k1,1 -k2,2n SRR21230488_bg.bedGraph
but again i got this error :try with
LC_COLLATE=C sort -t $'\t' -k1,1 -k2,2n SRR21230488_bg.bedGraph
but I don't think it will change anything....otherwise, show us the context of line 25062706....
Yes, Sure
if there any output for
?
missing parenthesis, fixed
I run:
awk -F '\t' '(int($2) > int($3))' SRR21230488_bg.bedGraph | head
there is not out put for that Again, I run.and i got this error :
let's try another thing.
what is the output of
furthermore, are you using the very last version of bedGraphToBigWig ?
Thanks alot Finally It work and the .bw file was generated!
so what was the error ? And at least, validate my answer below please.
I removed bedGraphToBigWig and again install it.
Just adding for completeness, you could use
bamCoverage
from deeptools. Relatively slow, but one single command to do that all. Lots of options to choose from for customization. Could save trouble.To Normalize BigWig file based on bamCoverage I use this commands bamCoverage -b SRR21230488_marked_duplicates.bam -o output.bw --normalizeUsing RPKM It would be aapreciated if you let me know your comments. Best