Package: uta-tools
uta-toolsService for querying theUTAdatabaseInstallationpippip install uta-toolsDevelopmentClone the repo:git clone https://github.com/cancervariants/uta-tools
cd uta_toolsInstall Pipenvif necessary.Install backend dependencies and enter Pipenv environment:pipenv shell
pipenv lock && pipenv sync
pipenv install --devUTA Database Installationuta-toolsuses intalls local UTA database. For other ways to install, visitbiocommons.uta.Local InstallationThe following commands will likely need modification appropriate for the installation environment.InstallPostgreSQLCreate user and database.$ createuser -U postgres uta_admin
$ createuser -U postgres anonymous
$ createdb -U postgres -O uta_admin utaTo install locally, from theuta_tools/datadirectory:export UTA_VERSION=uta_20210129.pgd.gz
curl -O http://dl.biocommons.org/uta/$UTA_VERSION
gzip -cdq ${UTA_VERSION} | grep -v "^REFRESH MATERIALIZED VIEW" | psql -h localhost -U uta_admin --echo-errors --single-transaction -v ON_ERROR_STOP=1 -d uta -p 5433UTA Installation IssuesIf you have trouble installing UTA, you can visitthese two READMEs.Connecting to the databaseTo connect to the UTA database, you can use the default url (postgresql://uta_admin@localhost:5433/uta/uta_20210129). If you use the default url, you must either set the password using environment variableUTA_PASSWORDor setting the parameterdb_pwdin the UTA class.If you do not wish to use the default, you must set the environment variableUTA_DB_URLwhich has the format ofdriver://user:pass@host:port/database/schema.Data DownloadsSeqRepouta-toolsrelies onseqrepo, which you must download yourself.From therootdirectory:pip install seqrepo
sudo mkdir /usr/local/share/seqrepo
sudo chown $USER /usr/local/share/seqrepo
seqrepo pull -i 2021-01-29  # Replace with latest version using `seqrepo list-remote-instances` if outdatedIf you get an error similar to the one below:PermissionError: [Error 13] Permission denied: '/usr/local/share/seqrepo/2021-01-29._fkuefgd' -> '/usr/local/share/seqrepo/2021-01-29'You will want to do the following:(Might not be ._fkuefgd, so replace with your error message path)sudo mv /usr/local/share/seqrepo/2021-01-29._fkuefgd /usr/local/share/seqrepo/2021-01-29exittranscript_mappings.tsvuta-toolsusesEnsembl BioMartto retrieveuta_tools/data/transcript_mappings.tsv. We currently useHuman Genes (GRCh38.p13)for the dataset and the following attributes we use are: Gene stable ID, Gene stable ID version, Transcript stable ID, Transcript stable ID version, Protein stable ID, Protein stable ID version, RefSeq match transcript (MANE Select), Gene name.LRG_RefSeqGeneuta-toolsfetches the latest version ofLRG_RefSeqGene. This file is found can be foundhere.MANE Summary Datauta-toolsfetches the latest version ofMANE.GRCh38.*.summary.txt.gz. This file is found can be foundhere.Starting the UTA Tools Service LocallyTo start the service, run the following:uvicorn uta_tools.main:app --reloadNext, view the FastAPI on your local machine:http://127.0.0.1:8000/uta_toolsInit coding style testsCode style is managed byflake8and checked prior to commit.We usepre-committo run conformance tests.This ensures:Check code styleCheck for added large filesDetect AWS CredentialsDetect Private KeyBefore first commit run:pre-commit installTestingFrom therootdirectory of the repository:pytest