Convert
Format to format, without breaking it
Most conversion bugs are silent: an off-by-one coordinate, a dropped strand, a chromosome named two ways. Every page here shows the command and the check that proves it worked.
From SAM
- How to Convert SAM to BAM (Commands, Checks, and Pitfalls)
samtools view converts the bytes; sort and index are what make the BAM actually usable downstream.
From BAM
- How to Convert BAM to CRAM (and What Changes Between Builds)
CRAM cuts your disk usage roughly in half and quietly makes the file unreadable without the exact reference FASTA it was built against.
- How to Convert BAM to FASTQ (Commands, Checks, and Pitfalls)
The two-step pattern that keeps paired reads paired, plus the default flag that quietly drops reads you didn't know you were missing.
From bedGraph
- How to Convert bedGraph to bigWig (and What Changes Between Builds)
The conversion tool never introduces a coordinate bug, the chrom.sizes file you feed it is where builds and chromosome naming quietly go wrong.
From GTF
- How to Convert GTF to BED (and Keep Your Coordinates Right)
gtf2bed subtracts one from the start coordinate for you; a naive awk one-liner won't, and that gap costs you a silent off-by-one bug three steps downstream.
- How to Convert GTF to GFF3 (and Why IDs Go Missing)
gffread reconstructs the Parent hierarchy GFF3 demands, but only if your GTF's gene_id and transcript_id were consistent to begin with.
From GFF3
- How to Convert GFF3 to GTF (and Why IDs Go Missing)
gffread -T looks like a one-command fix until your NCBI GFF3 comes out the other side missing gene_id on half its transcripts.
From 10x MTX (Matrix Market)
- How to Convert 10x MTX to CSV/TSV count table (Without Losing Your Metadata)
Densifying a sparse 10x matrix for a spreadsheet is usually the wrong call, here's how to do it safely on the rare occasion you can't avoid it.
- How to Convert 10x MTX to h5ad (and Why IDs Go Missing)
The default read call quietly swaps your Ensembl IDs for gene symbols, and the duplicate-name patch that follows hides the damage instead of fixing it.
- How to Convert 10x MTX to Seurat object (and Why IDs Go Missing)
Read10X reads a directory, not a file, and the column you pick for gene names quietly decides how many genes you actually have.
From 10x HDF5 (filtered_feature_bc_matrix.h5)
- How to Convert 10x HDF5 to h5ad (and Why IDs Go Missing)
read_10x_h5 looks like a one-line import, but its two default arguments quietly decide which features and which gene identifiers survive into your AnnData object.
- How to Convert 10x HDF5 to Seurat object (and Why IDs Go Missing)
Read10X_h5 hands you a matrix with the wrong row names by default, and nobody notices until a marker gene lookup comes back empty.
From h5ad (AnnData)
- How to Convert h5ad to SingleCellExperiment (Without Losing Your Metadata)
readH5AD does the transpose and slot mapping for you, but obs metadata and uns objects can survive broken or vanish silently, so check before you trust the object.
- How to Convert h5ad to Seurat object (Without Losing Your Metadata)
anndataR and capseuratconverter handle the transpose and slot mapping for you; deciding which layer actually becomes your counts slot is still on you.
From Seurat object (RDS)
- How to Convert Seurat object to CSV/TSV count table (Without Losing Your Metadata)
write.csv() on a full assay tries to densify a matrix that's sparse for a reason, export only what you need or you'll watch R run out of memory on a 40k-cell object.
- How to Convert Seurat object to h5ad (Without Losing Your Metadata)
Seurat v5's split layers and multiple assays don't collapse into a single AnnData X on their own; pick the assay and layer yourself or the converter will guess wrong.
- How to Convert Seurat object to h5Seurat (Without Losing Your Metadata)
SaveH5Seurat doesn't corrupt your data on Seurat v5 objects, it just refuses to write until you rejoin split layers, and knowing why saves you an hour of guessing.
- How to Convert Seurat object to Loom (Without Losing Your Metadata)
SaveLoom writes one assay and can quietly hand you scaled data instead of raw counts, so check the matrix before you trust it in pySCENIC or velocyto.
- How to Convert Seurat object to 10x MTX (Commands, Checks, and Pitfalls)
Pick the wrong Seurat layer, or reach for Matrix::writeMM instead of write10xCounts, and your MTX directory looks complete right up until Scanpy or Cell Ranger tries to load it.
- How to Convert Seurat object to SingleCellExperiment (Without Losing Your Metadata)
as.SingleCellExperiment() is one line, but that line decides which assay becomes primary, drops your scaled matrix, and can hand back an empty counts assay without ever throwing an error.
From Loom
- How to Convert Loom to Seurat object (Without Losing Your Metadata)
SeuratDisk's Connect-then-as.Seurat path works, but velocyto barcodes and Seurat v5 layers will quietly wreck your merge if you skip the cleanup step.
From SingleCellExperiment (RDS)
- How to Convert SingleCellExperiment to h5ad (Without Losing Your Metadata)
writeH5AD() decides which assay becomes X almost silently, get that wrong and every downstream scanpy step runs on the wrong matrix.
- How to Convert SingleCellExperiment to Seurat object (Without Losing Your Metadata)
as.Seurat() copies your matrices and cell metadata fine; it quietly leaves your gene annotations and altExps behind.
From CSV/TSV count table
- How to Convert CSV/TSV count table to Seurat object (and Why IDs Go Missing)
The matrix loads without error every time; whether your gene IDs survive the trip is a separate question you have to check yourself.