Skip to content

Commit 71c0b23

Browse files
authored
Merge pull request #875 from 31puneet/fix/814-genome-features-gene-type-af1
Fix hardcoded gene type and name attribute in test_plot_genes_with_ge…
2 parents 3ac7bec + fdbc4b2 commit 71c0b23

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

tests/anoph/test_genome_features.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,9 @@ def test_plot_genes_with_gene_labels(fixture, api: AnophelesGenomeFeaturesData):
169169
# For each contig in the fixture...
170170
for contig in fixture.contigs:
171171
# Get the genes for this contig.
172-
genes_df = api.genome_features(region=contig).query("type == 'gene'")
172+
genes_df = api.genome_features(region=contig).query(
173+
f"type == '{api._gff_gene_type}'"
174+
)
173175

174176
# If there are no genes, we cannot label them.
175177
if not genes_df.empty:
@@ -181,7 +183,10 @@ def test_plot_genes_with_gene_labels(fixture, api: AnophelesGenomeFeaturesData):
181183

182184
# Put the random gene "ID" and its "Name" in a dictionary.
183185
random_gene_labels = dict(
184-
zip(random_sample_genes_df["ID"], random_sample_genes_df["Name"])
186+
zip(
187+
random_sample_genes_df["ID"],
188+
random_sample_genes_df[api._gff_gene_name_attribute],
189+
)
185190
)
186191

187192
# Check that we get a Bokeh figure from plot_genes() with these gene_labels.

0 commit comments

Comments
 (0)