diff --git a/.github/workflows/run_pipeline.yml b/.github/workflows/run_pipeline.yml index 8403490..2697ab8 100644 --- a/.github/workflows/run_pipeline.yml +++ b/.github/workflows/run_pipeline.yml @@ -29,7 +29,7 @@ jobs: - name: Install and set up transvar run: | . transvar_env_vars.sh - bash install_transvar_dependencies.sh + sudo apt install -y samtools tabix bash set_up_transvar.sh - name: Update file run: | diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 0e6a680..5bfb411 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -23,7 +23,7 @@ jobs: - name: Install and set up transvar run: | . transvar_env_vars.sh - bash install_transvar_dependencies.sh + sudo apt install -y samtools tabix bash set_up_transvar.sh - name: Run tests # -W because of transvar diff --git a/.gitignore b/.gitignore index 18f17aa..c6cc658 100755 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.env /.venv *.pyc /results diff --git a/Dockerfile b/Dockerfile index 14044fa..00722b8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,6 +21,6 @@ COPY ./*.sh /api/ COPY ./config.json /api/ COPY ./data /api/data -RUN bash install_transvar_dependencies.sh +RUN apt install -y samtools tabix CMD ["bash", "docker_start.sh"] diff --git a/install_transvar_dependencies.sh b/install_transvar_dependencies_locally.sh similarity index 100% rename from install_transvar_dependencies.sh rename to install_transvar_dependencies_locally.sh diff --git a/readme.md b/readme.md index 88e3995..e5f7d9b 100755 --- a/readme.md +++ b/readme.md @@ -27,6 +27,8 @@ bash run_analysis.sh ## Installing +### Python dependencies + To install the dependencies, we used poetry (see [poetry installation instructions](https://python-poetry.org/docs/)). In the source directory run: @@ -43,6 +45,31 @@ poetry shell Now when you call `python`, it will be the one from the `.venv`. +### Other dependencies and setting up transvar + +This project uses [transvar](https://github.com/zwdzwd/transvar). This requires to install some binaries. + +```bash + +# If you have linux and you want to install them globally +sudo apt install -y samtools tabix + +# If you want to install them locally (see the content of the script) +# > basically downloads the libs and uses make to build the necessary bin files, then deletes all unnecesary source code +bash install_transvar_dependencies_locally.sh + +``` + +Then, regardless of whether you are using local or global installation of `samtools` and `tabix`: + +```bash +# Env vars (see script) +. transvar_env_vars.sh + +# Build the transvar database, and test that it works +bash set_up_transvar.sh +``` + ## Getting the data To download the data from PomBase, run: diff --git a/set_up_transvar.sh b/set_up_transvar.sh index 7707d78..615a4a8 100644 --- a/set_up_transvar.sh +++ b/set_up_transvar.sh @@ -4,15 +4,12 @@ set -e transvar config -k reference -v "data/pombe_genome.fa" --refversion pombe_genome transvar index --ensembl data/pombe_genome.gtf --reference data/pombe_genome.fa -# At this point, we could delete the lib folder, but it's very small +# Hacky way to use the functions inside another script +cp $(which transvar) ./transvar_main_script.py # See whether it works transvar panno -i 'SPAC3F10.09:p.E2A' --ensembl data/pombe_genome.gtf.transvardb --reference data/pombe_genome.fa transvar ganno -i 'I:g.2832796A>T' --ensembl data/pombe_genome.gtf.transvardb --reference data/pombe_genome.fa transvar ganno -i 'I:g.2832795T>A' --ensembl data/pombe_genome.gtf.transvardb --reference data/pombe_genome.fa - -# Hacky way to use the functions inside another script -cp $(which transvar) ./transvar_main_script.py - transvar panno -i 'SPBC1198.04c:p.T566S' --ensembl data/pombe_genome.gtf.transvardb --reference data/pombe_genome.fa transvar panno -i 'SPAPB1A10.09:p.S372_N374delinsAAA' --ensembl data/pombe_genome.gtf.transvardb --reference data/pombe_genome.fa --gseq diff --git a/transvar_env_vars.sh b/transvar_env_vars.sh index 803930d..71af634 100644 --- a/transvar_env_vars.sh +++ b/transvar_env_vars.sh @@ -1,4 +1,6 @@ export TRANSVAR_CFG="$(pwd)/data/transvar.cfg" export TRANSVAR_DOWNLOAD_DIR="$(pwd)/data/transvar_download" + +# These are only needed if you install transvar locally, but it does not harm to have them export PATH="$(pwd)/lib/htslib/bin:$PATH" export PATH="$(pwd)/lib/samtools/bin:$PATH" \ No newline at end of file