Bedtools intersect -u or -wa causing issues
1
0
Entering edit mode
6.5 years ago
alex.v.nesta ▴ 50

I'm trying to intersect two tracks and only keep the transcripts from input a that overlap with input b. In this case intersect -u or -wa would work well for me.

Shown in pink are the two tracks I want to intersect. -a is on top and -b is on bottom. Both in pink.

https://imgur.com/hrStWrw

Now, shown in blue is the result from the intersection. Note how some of the transcripts at the very top look like they lose their exon and intron identification they are just one solid dark blue bar. what is going on? why does this happen?

https://imgur.com/ViPjSbE

I have a second issue. The input -b track only lists exons and not introns, however, IGV magically draws introns between them. How do I stop IGV displaying these introns?

code in case you want to see it.

from pybedtools import BedTool
mcf7 = BedTool('MCF7hg19.gtf')
transposons = BedTool('UniqueTransposonsMCF7vsGENCODE.gtf')

TranscriptsTransposons = mcf7.intersect(transposons, wa=True) 

TranscriptsTransposons.saveas('pyTranscriptsWithTransposonsinMCF.gtf')

Thanks, Alex

bedtools python IGV pybedtools • 2.1k views
ADD COMMENT
0
Entering edit mode
6.5 years ago
ATpoint 85k

Introns are not annotated in GTF/GFF files directly. They are assumed to be inter-exonic regions of one gene, which is displayed by IGV in case you supply GTF/GFF. One possibility would be to convert your intersection result to the BED format, e.g. with gff2bed from BEDOPS. Then, I think, only the exons should be displayed.

ADD COMMENT
0
Entering edit mode

So, I just tried your suggestion. The result I got was not good. Please see below. Do you know why I am getting all of these solid lines that are neither exonic nor interexonic?

https://imgur.com/MiNSYOq

gtf2bed <pyTranscriptsWithTransposonsinMCF.gtf> pyTranscriptsWithTransposonsinMCF.bed
ADD REPLY
0
Entering edit mode

Sorry, I wasn't thinking correctly. Your suggestion of converting bed to gif does work. I was accidentally converting the incorrect file leading to the garbage output.

https://imgur.com/a/SaBO8du

ADD REPLY
0
Entering edit mode

Moved ATpoint's comment to an Answer.

If this was helpful you should upvote it; if it resolves your question you should mark it as accepted. Upvote|Bookmark|Accept

ADD REPLY

Login before adding your answer.

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