monarch-initiative / gpsea

A Python library for discovery of genotype-phenotype associations
https://monarch-initiative.github.io/gpsea/stable
MIT License
4 stars 1 forks source link

default imports #191

Closed pnrobinson closed 1 month ago

pnrobinson commented 3 months ago

It is relatively difficult to figure out which modules to import. I wonder if we can define something like this

# gpc_defaults.py
import genophenocorr
from genophenocorr.analysis import configure_cohort_analysis, CohortAnalysisConfiguration
from genophenocorr.analysis.predicate import PatientCategories
from genophenocorr.preprocessing import load_phenopacket_folder
from genophenocorr.preprocessing import configure_caching_cohort_creator
from genophenocorr.model import FeatureType, VariantEffect
from genophenocorr.view import CohortViewable
from genophenocorr.preprocessing import UniprotProteinMetadataService
from genophenocorr.model.genome import GRCh38
from genophenocorr.preprocessing import VVTranscriptCoordinateService
from genophenocorr.view import ProteinVisualizable, ProteinVisualizer, ProteinViewable
import hpotk
from IPython.display import display, HTML
# Add other imports as needed

__all__ = [...  (include all classes from the above imports here)]

Then in the notebooks we would have only this

from gpc_defaults import *

If we wanted extra control, we could define multiple such files for the variant use-cases, and the documentation would enable powerusers to import individual packages as needed.

ielis commented 3 months ago

I agree that it is not 100% easy to know how to use genophenocorr and there is a decent number of imports.

I think we should exemplify the package in the Tutorial & User guide sections - the same way how Matplotlib, Pandas, and Scikit Learn are presented. However, since we are still developing the package, this is still WIP and I'll keep this issue open until we're done with explaining the docs.

So,

ielis commented 1 month ago

We improved the docs and the Tutorial as well as the User guide explain how to perform the analysis.