Hot answers tagged

10

No, there is currently no GFF support in biopython. However, you can read in GFF files into python using this package, gffutils. There are also a few other packages to read/write GFF files, like gff3.


5

You can use gffread to convert gff to gtf2, below is from the manual: In order to see the GTF2 version of the same transcripts, the -T option should be added: gffread -E annotation.gff -T -o- | more The examples above also show that gffread can be used to convert a file between GTF2 and GFF3 file formats.


5

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 half of it, and if the sequence length looks right, that's likely what you want.


5

You can use GFF utilities to get a fasta sequence from a GFF file using a reference genome file.


4

The three # are used for splitting group of features that belong together, e.g. a transcript and it's exons. Sometimes you see with a blank line instead of the #. To grep just the header, which has 1 or 2 # from the line start on, you can use extended regular expression: $ grep -E "^#{1,2}[^#]" Caenorhabditis_elegans.WBcel235.95.gff3 Which means: "grep ...


4

There are some good answers so far, but I don't think any of them fully communicate the significance of the ### directive. The GFF3 specification states: This directive (three # signs in a row) indicates that all forward references to feature IDs that have been seen to this point have been resolved. After seeing this directive, a program that is ...


3

As others have stated, those are just there to separate the entries for easier parsing. They enable you to do nifty tricks like: $ awk -v RF='###' '/Y74C9A.3/' Caenorhabditis_elegans.WBcel235.95.gff3 I WormBase mRNA 4116 10230 . - . ID=transcript:Y74C9A.3;Parent=gene:WBGene00022277;Name=Y74C9A.3;biotype=protein_coding;transcript_id=...


3

I would suggest to use agat_convert_sp_gff2gtf.pl from AGAT because you loose information with gffread. e.g here a gff example: ##gff-version 3 scaffold625 maker gene 337818 343277 . + . ID=CLUHARG00000005458;Name=TUBB3_2 scaffold625 maker transcript 337818 343277 . + . ID=CLUHART00000008717;Parent=CLUHARG00000005458 scaffold625 ...


3

"Transforming" Fasta files to GTF or GFF3 files is a common request, as are similar tasks such as "converting" BAM files to VCF files. But these are underdefined questions, and "transform" or "convert" isn't really the right way to think about the task. As far as your particular request is concerned, Fasta files and GTF files contain fundamentally different ...


3

Is there any tool that converts gff to annotated fasta? This is not an uncommon question / request, but perhaps a crash course refresher on file formats would provide some valuable context. FASTA files are designed to hold nucleotide or amino acid sequences. The "defline" (header) of each record may include some unique identifiers or descriptive metadata. ...


2

I extracted the sequence contained in the gff file into a separate file and added a header according to the fasta file format specifications. I named that file ERS654933.fasta and then used prokka to generate my own annotation. File header ERS654933.fasta: >ATCC_NCTN13373 GTGTATAACTTAAAAATTTAAGAAAGATGGAGTAAATTTATGTCGGAAAAAGAAATTTGG ...


2

I would use BCBio for gff handling as it is written to directly interface with BioPython’s object model. The only downside is that I believe it is no longer actively supported. It is however the package that the BioPython docs use generally. There are plans to properly incorporate GFF/GTF parsers in to BP in the not too distant future according to that link ...


2

The clodius tool puts tab-delimited data from a BED file into an rtree in a sqlite3 database: https://github.com/higlass/clodius/blob/c98bb16ade93402fcea3b749d705c52ea165b609/clodius/cli/aggregate.py#L457-L777 Data are stored in this database at multiple "zoom levels", which allows for fast queries at wide genomic extents: https://github.com/...


1

You might also take a look at this genomics-focused sqlite extension: https://github.com/mlin/GenomicSQLite As described in the repository README: This SQLite3 loadable extension adds features to the ubiquitous embedded RDBMS supporting applications in genome bioinformatics: genomic range indexing for overlap queries & joins in-SQL utility functions, e....


1

Maybe the contig names in your BAM files don't match those in the GFF file? Ensembl uses contig names like 1, some other reference sources use chr1. Generally, for ensembl GFF files, HTSeq's default value for idattr should be fine though.


1

Since you know that your sequences in your fastas are your genes of interest, why not just dummy up a gtf where every sequence is a gene? The point of a gtf is to tell software which genomic regions matter for a certain procedure, and which regions do not. But if you already know that your sequences are pared down to genes, then you know that the whole ...


1

I was wanting more time, but okay here's what I'm thinking, Would it make more sense to use the strain used as the vaccine candidate as the reference genome? Neither, because the GTF format is based on an HA protein structure (likely a crystal structure but could be cryoEM). This is not the same as an alignment position within a surface antigen, ...


1

Most GFF parsers handle the work of reading annotation data into objects for convenient data access, but most do not handle the important task of resolving relationships between features. The tag Python library does both, grouping related features together for inspection, traversal, and feature-by-feature processing. CAVEAT: The tag library only supports ...


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