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 ...
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:
...
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:
...
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 ...
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:
...
12
votes
Convert bam file to highly compressible bam
You can just set the fields you don't need to *:
...
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.
...
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 - -
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 ...
8
votes
How to convert BED to GFF3
To answer the question as asked, for people googling.
For BED6, in python:
...
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:
...
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 ...
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 ...
7
votes
How to convert fasta file to tab delimited file
A very useful tool for this kind of data manipulation is bioawk:
...
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/
...
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.
...
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 ...
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 ...
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 ...
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:
...
5
votes
Accepted
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:
<...
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 ...
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 ...
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.
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 ...
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) ...
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 ...
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:
...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
format-conversion × 57file-formats × 15
fasta × 9
sam × 8
fastq × 6
r × 5
vcf × 5
phylogenetics × 5
software-recommendation × 5
bed × 4
gff3 × 4
samtools × 3
plink × 3
docking × 3
gtf × 3
conversion × 3
python × 2
sequence-alignment × 2
proteins × 2
snp × 2
linux × 2
reference-genome × 2
genbank × 2
sequence-annotation × 2
sratoolkit × 2