8 votes
Accepted

Find intervals that genes fall within their range

The GenomicRanges package is a great place to start, something like this: ...
user avatar
7 votes
Accepted

How to do `bedtools intersection` using pandas alone?

Your setup: ...
user avatar
5 votes

Fast filtering of intervals not falling within a certain distance from known genes

In one line, using bedtools ...
user avatar
  • 3,211
5 votes

Fast filtering of intervals not falling within a certain distance from known genes

Here's a way to use BEDOPS, which was designed to work fast by using sorted input. Other tools now use sorting to accomplish similar performance benefits. Convert GTF annotations to a sorted BED file ...
user avatar
4 votes

How to do `bedtools intersection` using pandas alone?

I don't think Pandas has this implemented functionality out-of-the-box. Even if it did, solutions not designed specifically for bioinformatics probably rarely handle intervals on different chromosomes ...
user avatar
4 votes

Identify non-coding regions from a genome annotation

Getting the non coding regions of a protein coding transcript, sounds like you are looking for UTR. UTR has its own feature in the gtf file. So you can do this: <...
user avatar
  • 1,332
4 votes

Any fast options to query large VCF bed intervals?

Generically, with BEDOPS: $ vcf2bed < <(gunzip -c snps.vcf) | bedops -e 1 - myRegions.bed > answer.bed Or: ...
user avatar
4 votes

Any fast options to query large VCF bed intervals?

this: bedtools intersect -a <myvcf>.vcf.gz -b <myinterval>.bed -wa | \ java -Xmx10g -jar snpSift.jar filter --set <myrsid>.txt "ID in SET[0]" ...
user avatar
  • 1,473
3 votes

Fast filtering of intervals not falling within a certain distance from known genes

First I prepared a bed file in which the gene intervals are augmented by 1KB before and after the gene start and end coordinates. Then I intersected this bed file with my original one with the option <...
user avatar
  • 1,723
3 votes

Any fast options to query large VCF bed intervals?

I was tinkering with the command and was able to complete the execution inverting the order of rsid and bed intervals filtering. The command is as follows: ...
user avatar
3 votes

Identify non-coding regions from a genome annotation

This isn't a problem that's easily solved with awk. It's not like you're extracting a feature that's annotated in the GTF file. Instead, you want the empty space between annotated features. A few ...
user avatar
3 votes

How to output only the overlapping region of two files?

bedtools is my go-to program for operations on genomic intervals. In particular, the bedtools intersect operation is what you're looking for here. ...
user avatar
2 votes

How to do `bedtools intersection` using pandas alone?

As mentioned by OP, another option is to use pybedtools, which in my opinion is pretty convenient for people already familiar with BedTools. Let's even say df1's format is slightly different than df2: ...
user avatar
2 votes

How to do `bedtools intersection` using pandas alone?

I implemented pandas "Intervals" and ... it should be a few lines, clearly there are limitations. For non-overlapping data it is very cool however. It will work for overlapping data, BUT if the data ...
user avatar
  • 7,339
2 votes

Identify non-coding regions from a genome annotation

If you want all transcripts from that gtf file whose type isn't "protein_coding", you can use almost the same command, just change the == ("is") to ...
user avatar
  • 8,121
2 votes

Transcript Coordinate Ranges to Genomic Coordinates

This task has the same "flavor" as many I've done before, but each case is so subtly different that it's impossible to write a generalized tool that will work correctly for all circumstances. R isn't ...
user avatar
1 vote

Transcript Coordinate Ranges to Genomic Coordinates

The linked gist contains a class I wrote for doing this on GTF files: https://gist.github.com/IanSudery/d8349c22823a475ceb489c3e8aeb448e It uses the GTF class from cgat, which can be found here: ...
user avatar
  • 3,211
1 vote

Any fast options to query large VCF bed intervals?

Here is another way to do it in 2019: $ bcftools view -T regions.bed -i 'ID=@<myrsid>.txt' input.vcf > output.vcf Things can be sped up if we compress ...
user avatar
  • 1,332

Only top scored, non community-wiki answers of a minimum length are eligible