Skip to main content
24 votes
Accepted

Convert a BAM file from one reference to another?

You're the second person I have ever seen using NCBI "chromosome names" (they're more like supercontig IDs). Normally I would point you to a resource providing mappings between chromosome names, but ...
Devon Ryan's user avatar
  • 19.8k
17 votes
Accepted

How to obtain .bed file with coordinates of all genes

Via Gencode and BEDOPS convert2bed: ...
Alex Reynolds's user avatar
15 votes

How to convert FASTA to BED

You can do this easily with bioawk, which is a version of awk with added features facilitating bioinformatics: ...
bli's user avatar
  • 3,195
13 votes

How to convert FASTA to BED

It's good practice to have your FASTA indexed, so you can leverage the .fai you are likely to already have. If not, you can just ...
Sam Nicholls's user avatar
9 votes
Accepted

5'UTR and 3'UTR annotation in yeast

I am unaware of any "official" or gold-standard UTR annotations in S. cerevisiae. One option is to use the annotations from the TIF-Seq publication (Pelechano et al. 2013). The ...
story's user avatar
  • 1,613
8 votes

How to convert BED to GFF3

To answer the question as asked, for people googling. For BED6, in python: ...
Ian Sudbery's user avatar
  • 3,341
8 votes
Accepted

How to convert BED to GFF3

Galaxy has API and API-consuming libraries (such as BioBlend) that will allow you to interactively script against it without opening the graphical interface at all. However you can also take almost ...
Severian's user avatar
  • 196
7 votes
Accepted

How to convert FASTA to BED

We have many excellent answers! This will be an excellent reference for future users. I found what exactly what I was asking in my question: https://www.biostars.org/p/191052/ ...
SmallChess's user avatar
  • 2,746
7 votes
Accepted

How to release an R package with several bed files?

You can store it in data/ subfolder. If one of your functions need this bed file, you can include importing it in your function. Here are some examples how to get ...
benn's user avatar
  • 3,601
7 votes

5'UTR and 3'UTR annotation in yeast

I found the following two files in https://downloads.yeastgenome.org/sequence/S288C_reference/: SGD_all_ORFs_3prime_UTRs.fsa SGD_all_ORFs_5prime_UTRs.fsa According to the README files in the same ...
terdon's user avatar
  • 10.6k
6 votes

How to convert FASTA to BED

You could adapt this awk one-liner. Note that it assumes that sequence IDs are not longer than 100 characters and that there is no description following the sequence ID on the header line. ...
neilfws's user avatar
  • 666
6 votes
Accepted

How to filter out cross alignments from a BED file?

According to the SAM specification, the 3rd field of a SAM line (RNAME) is: RNAME: Reference sequence NAME of the alignment. If @SQ header lines are present, ...
terdon's user avatar
  • 10.6k
6 votes
Accepted

Merging bed records based on name

Although you don't mention it, I'm guessing you're using bedtools v2.26.0. Version 2.26.0 of groupBy has a bug in it, which you've encountered (it was fixed shortly after release, so you'll either ...
OrdiNeu's user avatar
  • 140
6 votes

How to release an R package with several bed files?

As benn said you can store them in data/ subfolder of your package. There is no size limit (AFAIK) but if you plan to publish your package in some repositories they ...
llrs's user avatar
  • 4,721
6 votes
Accepted

How can I convert a BED file to GTF/GFF with gene_ids?

Here I provide an ordered list of options (note that I am the author of bed2gtf and bed2gff): bed2gtf A high-performance BED-to-...
Alejandro Gonzales-Irribarren's user avatar
5 votes

Range overlap python error with genomic regions

You're reinventing bedtools intersect (or bedops), for which there's already a convenient python module: ...
Devon Ryan's user avatar
  • 19.8k
5 votes
Accepted

After artificially creating events in a FASTA file, how do I keep track of the old coordinates?

I've written a handful of programs from scratch to simulate mutations and variations in real or simulated sequences. The trick has always been to sort the variants by genomic coordinate, apply the ...
Daniel Standage's user avatar
5 votes

How to convert BED to GFF3

To convert BAM to GTF, which is the best way to get a file to compare with cuffcompare: ...
Ian Sudbery's user avatar
  • 3,341
5 votes

Parse out exon coordinates from bed file for each gene

There are multiple ways to go about it. On the command line you can make a 1 line BED file: chr1 11868 12227 And then ...
Devon Ryan's user avatar
  • 19.8k
5 votes
Accepted

bed file merge book-end features only if same name in column 4

...
Devon Ryan's user avatar
  • 19.8k
5 votes
Accepted

bed file with N regions of GRCh38 reference?

...
user172818's user avatar
  • 6,605
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 ...
Alex Reynolds's user avatar
5 votes

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

In one line, using bedtools ...
Ian Sudbery's user avatar
  • 3,341
5 votes
Accepted

How to create a .bed file from .fasta?

Here is a fun little python script I cooked up for the occasion. It will take a standard fasta file as a command-line argument and turn it into the proper bed format. Using your example fasta: ...
d_kennetz's user avatar
  • 631
5 votes
Accepted

Extract only exon regions from GFF/GTF file with input bed regions

You could use BEDOPS: ...
Alex Reynolds's user avatar
4 votes

How to convert BED to GFF3

Bioconductor makes this so easy. It does the coordinate conversion on import. ...
story's user avatar
  • 1,613
4 votes

How to obtain .bed file with coordinates of all genes

You can indeed get this information from the UCSC Table Browser. Select knownGene as your primary table, make a filter, add knownCanonical to as a linked table to filter on, then in the free-form ...
Christopher Lee's user avatar
4 votes

Merging bed records based on name

You could do this with the CGAT toolkit: cgat bed2bed --method=merge --merge-by-name -I bed_with_gene_ids.bed Installing such ...
Ian Sudbery's user avatar
  • 3,341
4 votes

Convert a BAM file from one reference to another?

The "right" solution would be realignment, but that's expensive and most of us would not go that route. My preferred solution would be to convert the bed file, as opposed to the bam. Here's why: 1) ...
chrisamiller's user avatar
4 votes

How to convert FASTA to BED

Here is an approach with BioPython. The with statement ensures both the input and output file handles are closed and a lazy ...
Chris_Rands's user avatar
  • 3,968

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