Skip to content

Commit

Permalink
Merge branch 'dev' into 'master'
Browse files Browse the repository at this point in the history
prepare release

See merge request tron/bnt_neoants/splice2neo!138
  • Loading branch information
ibn-salem committed Nov 7, 2024
2 parents 3a028e9 + fb5837d commit beedf38
Show file tree
Hide file tree
Showing 12 changed files with 322 additions and 27 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: splice2neo
Title: Aberrant splice junction analysis with associated mutations
Version: 0.6.11
Version: 0.6.12
Authors@R:
c(
person(given = "Jonas",
Expand Down
90 changes: 90 additions & 0 deletions Docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
FROM docker://rocker/r-ver:4.2.3

MAINTAINER [email protected]

ENV SRC /usr/local/src
ENV BIN /usr/local/bin


COPY DESCRIPTION /usr/local/src

RUN apt update && apt install -y \
build-essential \
libxml2-dev \
libcairo2-dev \
libgit2-dev \
default-libmysqlclient-dev \
libpq-dev \
libsasl2-dev \
libsqlite3-dev \
libssh2-1-dev \
libxtst6 \
libcurl4-openssl-dev \
libharfbuzz-dev \
libfribidi-dev \
libfreetype6-dev \
libpng-dev \
libtiff5-dev \
libjpeg-dev \
libbz2-dev \
unixodbc-dev \
tini \
git \
locales \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
apt clean && \
apt autoremove -y && \
rm -rf /var/lib/{apt,dpkg,cache,log}/

RUN locale-gen en_US.UTF-8

RUN install2.r --error --skipinstalled -n 8 \
readr \
tibble \
dplyr \
magrittr \
argparse \
stringr \
tidyr \
purrr \
devtools \
remotes \
BiocManager \
vroom


RUN Rscript -e 'library(remotes); remotes::install_version("Matrix", version = "1.6-5", repos = "http://cran.us.r-project.org", Ncpus=8)'
RUN Rscript -e 'library(remotes); remotes::install_version("MASS", version = "7.3-60", repos = "http://cran.us.r-project.org", Ncpus=8)'
RUN Rscript -e 'BiocManager::install(c("BSgenome.Hsapiens.UCSC.hg19"), Ncpus=8)'
RUN export SPLICE2NEO_VERSION=$(grep 'Version:' /usr/local/src/DESCRIPTION | awk '{print $2}') && \
Rscript -e "library(remotes); remotes::install_git('https://github.com/TRON-Bioinformatics/splice2neo.git', ref = 'v${SPLICE2NEO_VERSION}', Ncpus=8)"

RUN apt autoremove -y

# Remove build dependencies from container
RUN apt remove -y \
build-essential \
libxml2-dev \
libcairo2-dev \
libgit2-dev \
default-libmysqlclient-dev \
libpq-dev \
libsasl2-dev \
libsqlite3-dev \
libssh2-1-dev \
libxtst6 \
libcurl4-openssl-dev \
libharfbuzz-dev \
libfribidi-dev \
libfreetype6-dev \
libpng-dev \
libtiff5-dev \
libjpeg-dev \
unixodbc-dev \
libbz2-dev \
git \
locales

WORKDIR /
ENTRYPOINT ["tini", "--"]
CMD [ "/bin/bash" ]
40 changes: 40 additions & 0 deletions Docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Container support

We provide a Singularity and a Docker image that contains all software pre-installed for running the splice2neo analysis.
However, singularity is our preferred method for running splice2neo as it allows unprivileged users to run the application in a container.


## Singularity

To use the the singularity image, you have to first build it from the definition file. Please make sure you have `fakeroot` permissions or ask your sysadmin to build the image.

```
singularity build --fakeroot splice2neo.sif splice2neo.def
```


To run the analysis, bind your input directory into the container. The container ships the HG19 version of BSgenome.

### Script usage

```
singularity exec -e -B `pwd` -B /path/to/your/inputs splice2neo.sif Rscript splice2neo.R
```

### Interactive usage

```
singularity shell -B `pwd` -B /path/to/your/inputs splice2neo.sif
```

Within the container you can now open a R-Session and execute the commands.


## Docker / podman

We use podman to build and manage our Docker images. Podman is API compatible with Docker and provides unprivileged execution of images.


```
podman build -t tronbioinformatics/splice2neo:"${TAG}" .
```
13 changes: 13 additions & 0 deletions Docker/build_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
#
# Maintainer: Johannes Hausmann <[email protected]>
# Build OCI images for splice2neo

cp ../DESCRIPTION DESCRIPTION

export TAG=$(grep 'Version:' DESCRIPTION | awk '{print $2}')

podman build -t tronbioinformatics/splice2neo:"${TAG}" .
#podman build -t tronbioinformatics/splice2neo:latest .

rm DESCRIPTION
100 changes: 100 additions & 0 deletions Docker/splice2neo.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
Bootstrap: docker
From: rocker/r-ver:4.2.3
Stage: spython-base

%files
../DESCRIPTION /usr/local/src/
%labels
MAINTAINER [email protected]
%post


SRC=/usr/local/src
BIN=/usr/local/bin


apt update && apt install -y \
build-essential \
libxml2-dev \
libcairo2-dev \
libgit2-dev \
default-libmysqlclient-dev \
libpq-dev \
libsasl2-dev \
libsqlite3-dev \
libssh2-1-dev \
libxtst6 \
libcurl4-openssl-dev \
libharfbuzz-dev \
libfribidi-dev \
libfreetype6-dev \
libpng-dev \
libtiff5-dev \
libjpeg-dev \
unixodbc-dev \
libbz2-dev \
git && \
apt clean && \
apt autoremove -y

install2.r --error --skipinstalled -n 8 \
readr \
tibble \
dplyr \
magrittr \
argparse \
stringr \
tidyr \
purrr \
devtools \
remotes \
BiocManager \
vroom

export SPLICE2NEO_VERSION=$(grep 'Version:' /usr/local/src/DESCRIPTION | awk '{print $2}') && \
R --no-save <<__EOF__

BiocManager::install("BSgenome.Hsapiens.UCSC.hg38", Ncpus=8)

library(remotes)
remotes::install_version("Matrix", version = "1.6-5", repos = "http://cran.us.r-project.org")
remotes::install_version("MASS", version = "7.3-60", repos = "http://cran.us.r-project.org")
remotes::install_git('https://github.com/TRON-Bioinformatics/splice2neo.git', ref = "v${SPLICE2NEO_VERSION}")

__EOF__


apt autoremove -y

# Remove build dependencies from container
apt remove -y \
build-essential \
libxml2-dev \
libcairo2-dev \
libgit2-dev \
default-libmysqlclient-dev \
libpq-dev \
libsasl2-dev \
libsqlite3-dev \
libssh2-1-dev \
libxtst6 \
libcurl4-openssl-dev \
libharfbuzz-dev \
libfribidi-dev \
libfreetype6-dev \
libpng-dev \
libtiff5-dev \
libjpeg-dev \
unixodbc-dev \
libbz2-dev


%environment
export SRC=/usr/local/src
export BIN=/usr/local/bin
%runscript
cd /
exec tini -- /bin/bash "$@"
%startscript
cd /
exec tini -- /bin/bash "$@"
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# splice2neo 0.6.12

- Add docker container support
- support parsing of junctions with no strand info from STAR output

# splice2neo 0.6.11

- fix of liftover function
Expand Down
29 changes: 21 additions & 8 deletions R/parse_star.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,33 +46,43 @@ import_star_sj <- function(file.name) {
#' Transforms STAR intermediate table into standardized junction format
#'
#' @param tib STAR *SJ.out.tab as tibble
#' @param keep_unstranded Logical, to keep junctions without strand annotation.
#' If FALSE (default) junctions without strand annotation "*" are filtered out,
#' otherwise they are considered as two separate junctions with "+" and "-" strand.
#'
#' @return A tibble in standardized junction format
#'
#' Junctions without strand annotation "*" are filtered out.
#'
#' @examples
#' path <- system.file("extdata", "test_star_SJ.out.tab", package = "splice2neo")
#' star_raw <- splice2neo:::import_star_sj(path)
#' splice2neo:::transform_star_sj(star_raw)
#'
#' @import dplyr
#' @keywords internal
transform_star_sj <- function(tib){
transform_star_sj <- function(tib, keep_unstranded = FALSE){

tib <- tib %>%
mutate(
junction_start = as.character(intron_start - 1),
junction_end = as.character(intron_end + 1),
strand = case_when(
strand_enc == "0" ~ "*",
strand_enc == "0" ~ "+|-",
strand_enc == "1" ~ "+",
strand_enc == "2" ~ "-",
),
Gene = NA,
class = NA
) %>%
filter(strand != "*") %>%
)

if(!keep_unstranded){
tib <- tib %>%
filter(strand != "+|-")
} else {
tib <- tib %>%
tidyr::separate_rows(strand, sep = '[|]')
}

tib <- tib %>%
mutate(
junc_id = generate_junction_id(chromosome, junction_start, junction_end, strand)
) %>%
Expand All @@ -95,6 +105,9 @@ transform_star_sj <- function(tib){
#' into standardized junction output format.
#'
#' @param path The path to STAR SJ.out.tab
#' @param keep_unstranded Logical, to keep junctions without strand annotation.
#' If FALSE (default) junctions without strand annotation "*" are filtered out,
#' otherwise they are considered as two separate junctions with "+" and "-" strand.
#'
#' @return A tibble in standardized junction format
#'
Expand All @@ -105,10 +118,10 @@ transform_star_sj <- function(tib){
#'
#' @import readr
#' @export
parse_star_sj <- function(path) {
parse_star_sj <- function(path, keep_unstranded = FALSE) {

dat.junc <- path %>%
import_star_sj() %>%
transform_star_sj()
transform_star_sj(keep_unstranded)
return(dat.junc)
}
9 changes: 5 additions & 4 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ knitr::opts_chunk$set(
)
```


# splice2neo

<!-- badges: start -->
Expand All @@ -23,8 +24,9 @@ knitr::opts_chunk$set(
`r badger::badge_last_commit("TRON-Bioinformatics/splice2neo")`
<!-- badges: end -->

Documentation: https://tron-bioinformatics.github.io/splice2neo/

- Documentation: https://tron-bioinformatics.github.io/splice2neo/
- Publication: Lang et al. (2024) [Prediction of tumor-specific splicing from somatic mutations as a source of neoantigen candidates](https://doi.org/10.1093/bioadv/vbae080)

## Overview

Expand Down Expand Up @@ -145,7 +147,6 @@ toy_junc_df %>%

Please report issues here: https://github.com/TRON-Bioinformatics/splice2neo/issues

## Citation

Lang, Franziska, Patrick Sorn, Martin Suchan, Alina Henrich, Christian Albrecht, Nina Koehl, Aline Beicht, et al. 2023. “Prediction of Tumor-Specific Splicing from Somatic Mutations as a Source of Neoantigen Candidates.” bioRxiv. https://doi.org/10.1101/2023.06.27.546494.
## Reference

Lang F, Sorn P, Suchan M, Henrich A, Albrecht C, Köhl N, Beicht A, Riesgo-Ferreiro P, Holtsträter C, Schrörs B, Weber D, Löwer M, Sahin U, Ibn-Salem J. Prediction of tumor-specific splicing from somatic mutations as a source of neoantigen candidates. Bioinform Adv. 2024 May 29;4(1):vbae080. doi: [10.1093/bioadv/vbae080](https://doi.org/10.1093/bioadv/vbae080). PMID: 38863673; PMCID: PMC11165244.
Loading

0 comments on commit beedf38

Please sign in to comment.