gffutils.interface.FeatureDB.bed12
- FeatureDB.bed12(feature, block_featuretype=['exon'], thick_featuretype=['CDS'], thin_featuretype=None, name_field='ID', color=None)[source]
Converts
feature
into a BED12 format.GFF and GTF files do not necessarily define genes consistently, so this method provides flexiblity in specifying what to call a “transcript”.
- Parameters:
feature (str or Feature instance) – In most cases, this feature should be a transcript rather than a gene.
block_featuretype (str or list) –
Which featuretype to use as the exons. These are represented as blocks in the BED12 format. Typically ‘exon’.
Use the
thick_featuretype
andthin_featuretype
arguments to control the display of CDS as thicker blocks and UTRs as thinner blocks.Note that the features for
thick
orthin
are not automatically included in the blocks; if you do want them included, then those featuretypes should be added to thisblock_features
list.If no child features of type
block_featuretype
are found, then the fullfeature
is returned in BED12 format as if it had a single exon.thick_featuretype (str or list) –
Child featuretype(s) to use in order to determine the boundaries of the “thick” blocks. In BED12 format, these represent coding sequences; typically this would be set to “CDS”. This argument is mutually exclusive with
thin_featuretype
.Specifically, the BED12 thickStart will be the start coord of the first
thick
item and the thickEnd will be the stop coord of the lastthick
item.thin_featuretype (str or list) –
Child featuretype(s) to use in order to determine the boundaries of the “thin” blocks. In BED12 format, these represent untranslated regions. Typically “utr” or [‘three_prime_UTR’, ‘five_prime_UTR’]. Mutually exclusive with
thick_featuretype
.Specifically, the BED12 thickStart field will be the stop coord of the first
thin
item and the thickEnd field will be the start coord of the lastthin
item.name_field (str) – Which attribute of
feature
to use as the feature’s name. If this field is not present, a “.” placeholder will be used instead.color (None or str) – If None, then use black (0,0,0) as the RGB color; otherwise this should be a comma-separated string of R,G,B values each of which are integers in the range 0-255.