to use gxf2bed through Nextflow you can borrow the provided module from the assets/nf/gxf2bed folder.
Benchmark + FAQ
[!WARNING]
The data in this benchmark corresponds to version 0.2.* and below. Versions >0.3 are
a bit slower than the previous versions due to algorithmic changes.
If you google “gtf to bed” or “gff to bed” you’ll find some posts about recommended tools. Part of these tools are already deprecated or too difficult to run (even in Linux), due to poor maintenance. This project was conceived to provide an easy way to convert GTF/GFF files to BED structures and finish a set of high-performance converters between gene model formats in Rust (bed2gtf, bed2gff and now gxf2bed).
To test the efficiency of gxf2bed, I took 4 GTF/GFF-to-BED converters and ran them with the current GRCh38 GENCODE annotation (v.44), that has ~250,000 transcripts [the values showed here are the mean of 5 consecutive runs]. Briefly, the competitors are:
Besides the easy way to make gxf2bed run and the GFF-GTF channel that allows centralize both in a single converter, this tool showed a significant difference in computation time against the other tools in each one of the two formats. Even using a combination of different number of threads, times were practically the same 3.5s +/- 0.4s and the differences were maintained. Is important to note that GFF3 files took a lot more time than its GTF counterpart. This could be due to the need of chaining two different programs 1) GFF-to-GTF and 2) GTF-to-BED.
Taken together, gxf2bed offers an easier and faster way to convert GTF/GFF files to BED files. This tool could save you at least x2-3 times the time you used to spend using other tools to convert GTF files and x5 times if you want to convert GFF3 files!
gxf2bed
versatile BED-to-G{T,F}F converter in Rust
docs . usage . installation . conda
translates
into
Usage
Installation
to install gxf2bed on your system follow this steps:
curl https://sh.rustup.rs -sSf | shon unix, or go here for other optionscargo install gxf2bed(make sure~/.cargo/binis in your$PATHbefore running it)gxf2bedwith the required argumentsBuild
to build gxf2bed from this repo, do:
git clone https://github.com/alejandrogzi/gxf2bed.git && cd gxf2bedcargo run --release -- -i <GTF/GFF> -o <BED>Container image
to build the development container image:
git clone https://github.com/alejandrogzi/gxf2bed.git && cd gxf2bedstart dockerorsystemctl start dockerdocker image build --tag gxf2bed .docker run --rm -v "[dir_where_your_gtf_is]:/dir" gxf2bed -i /dir/<GTF/GFF> -o /dir/<BED>to pull the image from dockerhub:docker pull ghcr.io/alejandrogzi/gxf2bed:latestConda
to use gxf2bed through Conda just:
conda install gxf2bed -c biocondaorconda create -n gxf2bed -c bioconda gxf2bedNextflow
to use gxf2bed through Nextflow you can borrow the provided module from the assets/nf/gxf2bed folder.
Benchmark + FAQ
If you google “gtf to bed” or “gff to bed” you’ll find some posts about recommended tools. Part of these tools are already deprecated or too difficult to run (even in Linux), due to poor maintenance. This project was conceived to provide an easy way to convert GTF/GFF files to BED structures and finish a set of high-performance converters between gene model formats in Rust (bed2gtf, bed2gff and now gxf2bed).
To test the efficiency of gxf2bed, I took 4 GTF/GFF-to-BED converters and ran them with the current GRCh38 GENCODE annotation (v.44), that has ~250,000 transcripts [the values showed here are the mean of 5 consecutive runs]. Briefly, the competitors are:
gtfToGenePred | genePredToBed&gffToGenePred | genePredToBed(taken from here)gtf2bed.py&gff32gtf.py && gtf2bed.py(taken from here)gtf2bed.pl&gff2gtf.pl | gtf2bed.pl(taken from here)gtf2bed>f2bed(taken from here)Besides the easy way to make
gxf2bedrun and the GFF-GTF channel that allows centralize both in a single converter, this tool showed a significant difference in computation time against the other tools in each one of the two formats. Even using a combination of different number of threads, times were practically the same 3.5s +/- 0.4s and the differences were maintained. Is important to note that GFF3 files took a lot more time than its GTF counterpart. This could be due to the need of chaining two different programs 1) GFF-to-GTF and 2) GTF-to-BED.Taken together,
gxf2bedoffers an easier and faster way to convert GTF/GFF files to BED files. This tool could save you at least x2-3 times the time you used to spend using other tools to convert GTF files and x5 times if you want to convert GFF3 files!