How to reassembly using .bed file
1
0
Entering edit mode
6.5 years ago
p_puppo • 0

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 bedtools Assembly • 1.1k views
ADD COMMENT
0
Entering edit mode

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 REPLY
1
Entering edit mode
6.5 years ago
drkennetz ▴ 560

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 COMMENT

Login before adding your answer.

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