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

Feature - animated 2Ds showing transition between 2D structures from PDB files #163

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
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
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -11,11 +11,11 @@ repos:
- id: check-json
- id: mixed-line-ending
- repo: https://github.com/ambv/black
rev: 22.10.0
rev: 24.10.0
hooks:
- id: black
- repo: https://github.com/PyCQA/pylint
rev: v2.15.6
rev: v3.3.2
hooks:
- id: pylint
args:
Expand All @@ -26,11 +26,11 @@ repos:
docs/conf.py
)$
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/MarcoGorelli/auto-walrus
rev: 'v0.2.2'
rev: '0.3.4'
hooks:
- id: auto-walrus
name: Auto-apply the walrus operator :=
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG BASE_IMAGE_VERSION=v2.0
ARG BASE_IMAGE_VERSION=latest

FROM rnacentral/r2dt-base:${BASE_IMAGE_VERSION}

Expand Down
26 changes: 24 additions & 2 deletions base_image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ ENV tRNAscan_VER=2.0.11 \
Ribovore_COMMIT=5df943c6f2866d7979bb13c948ca9d8531076898 \
BioEasel_VER=0.11 \
INFERNAL_VER=1.1.5 \
RNArtist_VER=0.4.6

RNArtist_VER=0.4.6 \
RNAView_COMMIT=2f74eccc47c86acdf0627004e6243454978cd4c1

FROM build AS rscape

Expand Down Expand Up @@ -109,6 +109,17 @@ FROM build AS rnartist
RUN \
wget -q -O rnartist.jar https://github.com/fjossinet/RNArtistCore/releases/download/${RNArtist_VER}-SNAPSHOT/rnartistcore-${RNArtist_VER}-SNAPSHOT-jar-with-dependencies.jar

FROM build AS rnaview

# Install RNAview
fryzjergda marked this conversation as resolved.
Show resolved Hide resolved
RUN \
git clone https://github.com/rcsb/RNAView && \
cd RNAView && \
git checkout ${RNAView_COMMIT} && \
make && \
mkdir -p /install/rnaview && \
cp -r ./* /install/rnaview/

FROM debian:bookworm-slim AS final-build

ENV \
Expand Down Expand Up @@ -165,11 +176,22 @@ ENV \
PERL5LIB="$RIBOSCRIPTSDIR":"$RIBOSEQUIPDIR":"$VECPLUSDIR":"$PERL5LIB" \
PATH="$RIBOSCRIPTSDIR":"$RRNASENSORDIR":"$PATH"



ENV \
PATH="$RIBOSCRIPTSDIR":"$RRNASENSORDIR":"$PATH" \
PATH="$RNA/traveler/bin:$RIBODIR:$RIBOEASELDIR:$RIBOINFERNALDIR:/rna/rscape/bin:/rna/jiffy-infernal-hmmer-scripts:/rna/r2dt:/rna/RNAstructure/exe:$PATH" \
PERL5LIB="$RIBOSCRIPTSDIR:$RIBOSEQUIPDIR:$VECPLUSDIR:$BIOEASELDIR:$RIBODIR:$EPNOPTDIR:$EPNOFILEDIR:$EPNTESTDIR:$PERL5LIB:/usr/lib/tRNAscan-SE"



ENV \
RNAVIEW="${RNA}/rnaview" \
PATH="${RNA}/rnaview/bin:${PATH}"


COPY --from=rnaview /install/ ${RNA}/

COPY --from=rscape /rna/rscape/ ${RNA}/rscape

COPY --from=trnascan-se /install/ /usr
Expand Down
36 changes: 36 additions & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,3 +243,39 @@ python3 utils/animate.py \
:::{note}
Note that the two input SVG files must have the same number of nucleotides.
:::

### Animating RNA secondary structures from PDB files

R2DT can be used to generate secondary structure diagrams directly from PDB files. Additionally R2DT can generate animated SVG file of the transition between two structures between two 3D structures from PDB files.

Generetion of a diagram from PDB file:

```bash
python3 utils/rnaview.py \
examples/PZ1_Bujnicki_1.pdb
```
`PZ1_Bujnicki_1.colored.svg` will be genreated.

:::{note}
Note - in cases that there are multiple interactions detected for one nucleotide, all of them will be omitted in the diagram.
:::

Animated transition between two structures from PDB:

```bash
python3 utils/animate3d.py \
examples/PZ1_solution_0.pdb \
examples/PZ1_Bujnicki_1.pdb
```

Performing animation on a reference PDB file, and a set of PDBs. User needs to specify the reference PDB file, and a directory with query PDB files:

```bash
python3 utils/animate3d.py -b \
examples/PZ1_solution_0.pdb \
examples/animate_bulk
```

:::{note}
Note - structures in the PDB files should be of the same length [nt].
:::
981 changes: 981 additions & 0 deletions examples/PZ1_Bujnicki_1.pdb

Large diffs are not rendered by default.

974 changes: 974 additions & 0 deletions examples/PZ1_solution_0.pdb

Large diffs are not rendered by default.

981 changes: 981 additions & 0 deletions examples/animate_bulk/PZ1_Bujnicki_1.pdb

Large diffs are not rendered by default.

981 changes: 981 additions & 0 deletions examples/animate_bulk/PZ1_Bujnicki_2.pdb

Large diffs are not rendered by default.

981 changes: 981 additions & 0 deletions examples/animate_bulk/PZ1_Bujnicki_3.pdb

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ scikit-image==0.21.0
Jinja2==3.1.2
numpy==1.26.4
tqdm==4.66.5
biopython==1.84
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
158 changes: 158 additions & 0 deletions tests/examples/rnaview/PZ1_Bujnicki_1.colored.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading