Package: cool-seq-tool
CommonOperationsOnLots-ofSequences ToolThecool-seq-toolprovides:Transcript alignment data from theUTAdatabaseFast access to sequence data usingSeqRepoLiftover between assemblies (GRCh38 <--> GRCh37) fromPyLiftoverLifting over to preferredMANEcompatible transcript. Seeherefor more information.Installationpippip install cool-seq-tool[dev,tests]DevelopmentClone the repo:git clone https://github.com/GenomicMedLab/cool-seq-tool
cd cool_seq_toolInstall Pipenvif necessary.Install backend dependencies and enter Pipenv environment:pipenv shell
pipenv update
pipenv install --devUTA Database Installationcool-seq-tooluses 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 thecool_seq_tool/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 DownloadsSeqRepocool-seq-toolrelies onseqrepo, which you must download yourself.Use theSEQREPO_ROOT_DIRenvironment variable to set the path of an already existing SeqRepo directory. The default is/usr/local/share/seqrepo/latest.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.tsvcool-seq-toolusesEnsembl BioMartto retrievecool_seq_tool/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.Use theTRANSCRIPT_MAPPINGS_PATHenvironment variable to set the path of an already existingtranscript_mappings.tsv. The default iscool_seq_tool/data/transcript_mapping.tsv.LRG_RefSeqGenecool-seq-toolfetches the latest version ofLRG_RefSeqGeneif the environment variableLRG_REFSEQGENE_PATHis not set. WhenLRG_REFSEQGENE_PATHis set,cool-seq-toolwill look at this path and expect the LRG_RefSeqGene file. This file is found can be foundhere.MANE Summary Datacool-seq-toolfetches the latest version ofMANE.GRCh38.*.summary.txt.gzif the environment variableMANE_SUMMARY_PATHis not set. WhenMANE_SUMMARY_PATHis set,cool-seq-toolwill look at this path and expect the MANE Summary Data file. This file is found can be foundhere.Starting the UTA Tools Service LocallyTo start the service, run the following:uvicorn cool_seq_tool.main:app --reloadNext, view the FastAPI on your local machine:http://127.0.0.1:8000/cool_seq_toolInit 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