Installation
Phenofhy 1.0 is distributed as a Python package and is designed for the Our Future Health trusted research environment (TRE).
Install in the OFH TRE
PyPI is not directly accessible from the OFH TRE. Our Future Health approves packages for import into the TRE, after which approved packages can be installed in a project. Phenofhy is currently going through that approval process, so PyPI-based installation in the TRE should become available once approval is complete.
Until then, use the Airlock workaround:
Obtain the Phenofhy source package through the Airlock process: https://dnanexus.gitbook.io/ofh/airlock/importing-files-into-a-restricted-project
Add the approved package files to a folder in your DNAnexus project.
At the start of each JupyterLab session, download the package into the notebook working directory:
python!dx download "phenofhy:/phenofhy/v1/phenofhy/" -r
Replace the first phenofhy with your DNAnexus project name if it differs. The remote folder should contain the package files directly, including __init__.py, config.py, load.py, and the other modules. It should not contain an additional nested phenofhy/phenofhy/ directory.
Run the download command from the directory in which you want the local phenofhy/ package folder to be created. After downloading, verify the package is importable:
import phenofhy
print(phenofhy.__version__)Initialize a project
Run initialization once from a TRE JupyterLab notebook:
import phenofhy
phenofhy.init()Initialization discovers the current project and dataset, extracts and uploads the three OFH metadata dictionaries, and uploads a generated config.json to the project's phenofhy/ folder. The local metadata/ directory and config are written to the notebook's working directory.
In later sessions, importing Phenofhy is sufficient. If the local config is missing, Phenofhy downloads the project config automatically. Run init() again only when the dataset or metadata configuration changes.
Initialization requires:
DX_PROJECT_CONTEXT_IDset by the TRE;- an authenticated
dxtoolkit; - permission to read the selected dataset;
- permission to create or upload files in the project.
Install from PyPI
PyPI is not directly accessible from the OFH TRE, but it is the recommended installation method for local development and testing outside the TRE. This is particularly useful for testing the simulation utilities in simulate.py, which do not require DNAnexus access.
python -m pip install phenofhyFor development from a source checkout:
python -m pip install -e .Phenofhy requires Python 3.10 or newer. See the Simulating data locally tutorial for a local testing example.