Question: How to reassembly using .bed file
gravatar for p_puppo
2.6 years ago by
p_puppo0 wrote:

Hi, I would like to request your help with re-assembling a transcriptome using a .bed file. I have a bad assembly that has parts with no coverage so I used bedtools to remove those sites and merged the remaining:

bedtools genomecov -bga -ibam ./PrairieSmoke/Assemblies/WG_assembly.sorted.bam -g ./PrairieSmoke/Assemblies/WG_assembly.fasta |
awk '$4==0' |
bedtools merge -i - \
> ./PrairieSmoke/WG_assembly.bed

My question is how can I use this .bed file to reassembly? The ideia is to repeat the assembly after having removed those sites with no coverage with the hope of improving said assembly. Thanks in advance, Pam

rna-seq assembly bedtools • 526 views
ADD COMMENTlink written 2.6 years ago by p_puppo0

Also, if you do not want 0 coverage regions do not use -bga flag, just use -bg. The -bga means bed graph all, as in output all positions, even those with 0 coverage. If you just use the -bg flag, you will only output regions with coverage. There is no reason to use -bga if you do not want regions with 0 coverage. This will totally eliminate the need for the awk step above. Understand your tools before you use them!

ADD REPLYlink modified 2.6 years ago • written 2.6 years ago by drkennetz510
gravatar for drkennetz
2.6 years ago by
drkennetz510 wrote:

The line:

awk '$4==0'

is doing the opposite of what you think. That is selecting for regions with 0 coverage and merging them. Replace that with:

awk '$4!=0'

which will output all regions that do not have 0 coverage (aka covered regions). Currently your code would merge all 0 coverage regions with this WG_assembly.bed file.

ADD COMMENTlink written 2.6 years ago by drkennetz510
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: 2139 users visited in the last hour