23 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.6k
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,100
13 votes
Accepted

How to convert fasta file to tab delimited file

If you have multi-line fasta files, as is very common, you can use these scripts1 to convert between fasta and tbl (sequence_name <TAB> sequence) format: ...
terdon's user avatar
  • 9,662
12 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
12 votes

How to convert fasta file to tab delimited file

There is a very simple BioPython solution, that is minimal, readable, and handles multi-line fasta: ...
Chris_Rands's user avatar
  • 3,928
12 votes

Convert bam file to highly compressible bam

You can just set the fields you don't need to *: ...
Devon Ryan's user avatar
  • 19.6k
11 votes
Accepted

BAM to BigWig without intermediary BedGraph

This can be done in R very easily from an indexed .bam file. Given single-end file for sample1. ...
story's user avatar
  • 1,573
9 votes

How to convert fasta file to tab delimited file

assuming there is only one sequence line per record, use paste with two 'stdin' cat your.fasta | paste - -
Pierre's user avatar
  • 1,501
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
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,301
8 votes
Accepted

How to convert a binary matrix of gene presence or absence into a fasta sequence

It's not a fasta file, but: ...
Devon Ryan's user avatar
  • 19.6k
8 votes

How to convert fasta file to tab delimited file

You can use these commands: perl -pe 's/>(.*)/>\1\t/g; s/\n//g; s/>/\n>/g' sequences.fa | grep -v '^$' Explanation: Append a tab to every header ...
Karel Břinda's user avatar
8 votes
Accepted

How to transform a DNAStringSet from the Bioconductor package Biostrings to a data frame?

According to the documentation (?Biostrings::DNAStringSet): width(x): A vector of non-negative integers containing the number ...
Iakov Davydov's user avatar
7 votes

How to convert fasta file to tab delimited file

A very useful tool for this kind of data manipulation is bioawk: ...
bli's user avatar
  • 3,100
6 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,739
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
  • 646
6 votes
Accepted

How to convert fastq to fast5

NOTICE: I have altered my answer slightly from the original as I have turned the original script into a pip installable program (with tests) and have updated the ...
Michael Hall's user avatar
6 votes
Accepted

How to extract / convert gff3 CDS sequences to multifasta

I like bedtools getfasta. My typical option set is bedtools getfasta -fi <reference> -bed <gff_file> -name -s. Be ...
Bioathlete's user avatar
  • 2,574
5 votes
Accepted

How to safely and efficiently convert subset of bam to fastq?

I'm not aware of any pre-made program to do this, so I wrote one for you. This will take a BAM file with any ordering and produce properly ordered gzipped fastq files with the filtering as you ...
Devon Ryan's user avatar
  • 19.6k
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,301
5 votes
Accepted

How to convert GFF3 to GTF2

The following bit of python code should work: ...
Devon Ryan's user avatar
  • 19.6k
5 votes

How to convert the .vcf (imputed) file with GT:GP format to GT:DS?

You can do this in Hail. Here's the rough code to do it (0.1 versions). Setup: from hail import * hc = HailContext() Import the .gen file. VCF works too: <...
Tim's user avatar
  • 151
5 votes
Accepted

Convert SRA to FastA

Finally, I found an alternative to the SRA translation: a link that works! For those of you interested in knowing how to download FastA files from NCBI using an accession number, try the following ...
Poshi's user avatar
  • 221
5 votes

Can a gff file be converted to a fasta file?

A gff is a file of annotation. It generally doesn't include sequence information, so you can not inter-convert. But the file on your page has a fasta entry at the bottom.. I'd just grab the bottom ...
swbarnes2's user avatar
  • 1,882
5 votes

Can a gff file be converted to a fasta file?

You can use GFF utilities to get a fasta sequence from a GFF file using a reference genome file.
geek_y's user avatar
  • 321
5 votes
Accepted

How could I match atom orders between a .mol2 and a .pdb?

Atom reordering is a common problem in compchemistry. Rdkit (a python package) can do this, but it is limited by the formats it can read and mol2 files are a bit hit or miss. It works really well ...
Matteo Ferla's user avatar
  • 4,234
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,928
4 votes

How to convert FASTA to BED

Inspired by this answer to a related question on read length distributions, you could do this with Biopython: ...
Scott Gigante's user avatar
4 votes
Accepted

Customizing bigWig file

There's no equivalent to the wiggle header in bigWig (or bigBed) files, which is why UCSC uses the file name. This is actually the reason for the track line stuff that you linked to, since you can ...
Devon Ryan's user avatar
  • 19.6k

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