# download
git clone https://github.com/lh3/minigff
cd minigff
# obtain the k8 binary, or install via bioconda
wget https://zenodo.org/records/11357203/files/k8-1.2.tar.bz2
tar -jxvf k8-1.2.tar.bz2
cp k8-1.2/k8-`uname -m`-`uname -s` $HOME/bin/k8 # assuming $HOME/bin in $PATH
# conversion
./minigff.js all2bed test/gc47.gtf.gz > out.bed # convert to BED12
./minigff.js all2bed -1 test/gc47.gtf.gz > out.bed # one transcript per gene
# evaluation
./minigff.js eval -a1 test/gc47.gtf.gz test/mp.paf.gz
# extract sequences (no test case)
./minigff.js getseq in.gtf genome.fa > mRNA.fa # get transcript sequences
./minigff.js getseq -a in.gtf genome.fa > cds.fa # get CDS
./minigff.js getseq -t in.gtf genome.fa > aa.fa # translated protein sequences
./minigff.js getseq -ft in.gtf genome.fa > aa.fa # filter out in-frame stop codons
minigff is a script that parses gene annotation formats (GTF, GFF3 and BED12) and spliced alignment formats (SAM and PAF), extracts information and compares transcript structures. It seamlessly reads multiple formats, though for GTF/GFF3, transcripts are required to be grouped by genes. minigff is writen in a dialect of Javascript and depends on the k8 Javascript engine. Precompiled k8 binaries can downloaded from zenodo or installed via bioconda.
minigff grew out of my needs for processing and evaluating spliced alignment.
It unifies and deprecates gff2bed.js
in minisplice and the
splice2bed
, gff2bed
, gff2junc
, junceval
and exoneval
subcommands in
paftools.js. gffread and gffcompare are similar to
minigff in functionality and provide more features. They are more widely used.