Description
PR #1195 (GH1194-species-config-refactor) refactored species-specific parameters to be read from the JSON config. However, as noted by @jonbrenas in their review comment, removing aim_ids, aim_palettes, gff_gene_type, gff_gene_name_attribute, gff_default_attributes, and gene_names from AnophelesDataResource.__init__() breaks the constructor chain — these parameters no longer reach AnophelesAimData or AnophelesGenomeFeaturesData.
Root Cause
The cooperative inheritance chain works like this:
Ag3.__init__() → AnophelesDataResource.__init__() → ... → AnophelesAimData.__init__()
→ AnophelesGenomeFeaturesData.__init__()
Previously, ag3.py passed values like aim_ids=("gambcolu_vs_arab", "gamb_vs_colu") through AnophelesDataResource, which forwarded them via **kwargs to the subclasses.
After the refactor:
- These parameters were removed from
AnophelesDataResource.__init__(), so they're no longer forwarded
- The JSON configs (
v3-config.json, v1.0-config.json) do not contain AIM_IDS, AIM_PALETTES, GFF_GENE_TYPE, etc.
- Both the config lookup and constructor fallback return
None
Impact
| Species |
Parameter |
Effect |
ag3 |
aim_ids resolves to None |
AIM calls (aim_variants(), aim_calls(), plot_aim_heatmap()) will fail |
af1 |
gff_gene_type defaults to "gene" instead of "protein_coding_gene" |
Genome feature queries return wrong results |
af1 |
gff_gene_name_attribute defaults to "Name" instead of "Note" |
Genome feature queries return wrong results |
adar1, adir1, amin1 |
Same GFF params affected |
Same incorrect defaults applied |
Proposed Fix
Re-add the 6 removed parameters to AnophelesDataResource.__init__() and restore the corresponding values in the species files (ag3.py, af1.py, adar1.py, adir1.py, amin1.py). The subclass constructors (AnophelesAimData, AnophelesGenomeFeaturesData) already implement config-first-then-constructor-fallback logic, so this restores backward compatibility without undoing the config refactoring work.
Note: Moving AIM_PALETTES to the JSON config is not straightforward because the palette colors are computed from plotly at runtime.
Related
Description
PR #1195 (
GH1194-species-config-refactor) refactored species-specific parameters to be read from the JSON config. However, as noted by @jonbrenas in their review comment, removingaim_ids,aim_palettes,gff_gene_type,gff_gene_name_attribute,gff_default_attributes, andgene_namesfromAnophelesDataResource.__init__()breaks the constructor chain — these parameters no longer reachAnophelesAimDataorAnophelesGenomeFeaturesData.Root Cause
The cooperative inheritance chain works like this:
Previously,
ag3.pypassed values likeaim_ids=("gambcolu_vs_arab", "gamb_vs_colu")throughAnophelesDataResource, which forwarded them via**kwargsto the subclasses.After the refactor:
AnophelesDataResource.__init__(), so they're no longer forwardedv3-config.json,v1.0-config.json) do not containAIM_IDS,AIM_PALETTES,GFF_GENE_TYPE, etc.NoneImpact
ag3aim_idsresolves toNoneaim_variants(),aim_calls(),plot_aim_heatmap()) will failaf1gff_gene_typedefaults to"gene"instead of"protein_coding_gene"af1gff_gene_name_attributedefaults to"Name"instead of"Note"adar1,adir1,amin1Proposed Fix
Re-add the 6 removed parameters to
AnophelesDataResource.__init__()and restore the corresponding values in the species files (ag3.py,af1.py,adar1.py,adir1.py,amin1.py). The subclass constructors (AnophelesAimData,AnophelesGenomeFeaturesData) already implement config-first-then-constructor-fallback logic, so this restores backward compatibility without undoing the config refactoring work.Related