diff --git a/pisces/index.py b/pisces/index.py index f1b0d6a..bdcf299 100755 --- a/pisces/index.py +++ b/pisces/index.py @@ -297,17 +297,17 @@ def features_to_string(features, fasta_in, masked=True, strand=True): total=db.count_features_of_type('gene'), unit='gene') as pbar: for gene in db.features_of_type('gene'): - first_transcript = next( + first_exon = next( db.children( gene, - featuretype='transcript', + featuretype='exon', order_by='start')) try: if options["gene_type"] == True: type_tag = "gene_type" else: type_tag = options["gene_type"] - gene_type = first_transcript[type_tag][0] + gene_type = first_exon[type_tag][0] except KeyError: logging.info("No gene type tag found for %s", gene['gene_id'][0]) gene_type = 'NA' @@ -316,7 +316,7 @@ def features_to_string(features, fasta_in, masked=True, strand=True): name_tag = "gene_name" else: name_tag = options["gene_name"] - gene_name = first_transcript[name_tag][0] + gene_name = first_exon[name_tag][0] except KeyError: logging.info("No gene name tag found for %s", gene['gene_id'][0]) gene_name = 'NA'