Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Samtools from apt #100

Merged
merged 2 commits into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/run_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.env
/.venv
*.pyc
/results
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
27 changes: 27 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
7 changes: 2 additions & 5 deletions set_up_transvar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions transvar_env_vars.sh
Original file line number Diff line number Diff line change
@@ -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"
Loading