External scripts used to interact with the Lattice Database
- Create a virtual environment. This example uses anaconda. Other options would also work, like venv or pyenv
You will need to be in this environment for the following instructions
conda create --name lattice_submit python=3.7
conda activate lattice_submit
Note: the examples call the environment lattice_submit
but you can name it anything as long as it is clearly distinguishable from the enviroment you use to launch the encoded app
-
Install the following packages
pip install requests openpyxl Pillow gspread gspread_formatting oauth2client scanpy
pip install google-cloud-storage google-auth-httplib2
pip install python-magic-bin==0.4.14
conda install -c conda-forge anndata
conda install -c conda-forge pint
conda install pandas jsonschema
-
Define variables in your environment based on the various servers you might submit to based on an alias for each server (
ALIAS_KEY
,ALIAS_SECRET
,ALIAS_SERVER
). For example, when submitting to a local instance of the app, you might call thislocal
.
So you'd define the following three variables.$ conda env config vars set LOCAL_KEY=<key>
$ conda env config vars set LOCAL_SECRET=<secret>
$ conda env config vars set LOCAL_SERVER=http://localhost:6543
-
After defining those, you'll need to reactivate your environment
conda activate lattice_submit
You can then confirm that they are defined
conda env config vars list
-
qcmetrics_reader.py Transforms quality metrics and other processing information from various files of a standard CellRanger outs/ directory into the Lattice schema
-
checkfiles.py Gathers data file content information and compares with submitted metadata run instructions
-
DCP_mapper.py Transforms a Lattice Dataset into HCA DCP-approved schema and stages at the DCP for submission to the HCA Portal run instructions
-
flattener.py Transforms a contributor matrix, raw count data, and Lattice metadata into a cellxgene-approved matrix file run instructions
-
make_template.py Produces a tabular representation of Lattice schema submittable properties, for ease of wrangling
-
submit_metadata.py Transforms tabulated metadata into json objects and posts/patches to the Lattice DB use instructions