Skip to content

Commit

Permalink
Merge pull request #185 from immunomind/dev
Browse files Browse the repository at this point in the history
Release 0.6.7
  • Loading branch information
Alexander230 authored Nov 2, 2021
2 parents 9dce2ea + 0b57b75 commit 75b7ece
Show file tree
Hide file tree
Showing 69 changed files with 3,435 additions and 1,832 deletions.
4 changes: 4 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
^fixVis$
^experiment data$
^docker$
^Dockerfile$
^.dockerignore$
^private$
^.gitlab-ci.yml$
^CONTRIBUTION.md$
Expand All @@ -18,3 +20,5 @@
^LICENSE$
^immunarch-citation.xml$
^.github$
^.RDataFiles$
^.idea$
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.git*
.RDataFiles
.idea
*.Rproj
45 changes: 45 additions & 0 deletions .github/workflows/dockerhub.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: DockerHub Image

on:
push:
branches:
- master
- dev
tags:
- "*"

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Get Image Tag
shell: bash
run: echo "##[set-output name=tag;]$([ "${GITHUB_REF}" == "refs/heads/master" ] && echo base || echo ${GITHUB_REF##*/})"
id: get_tag

- name: Check Out Repo
uses: actions/checkout@v2

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1

- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: ./
file: ./Dockerfile
builder: ${{ steps.buildx.outputs.name }}
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/immunarch-docker:${{ steps.get_tag.outputs.tag }}

- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
.Rhistory
.RData
.Ruserdata
.RDataFiles/*
src/*.o
src/*.so
src/*.dll
*.DS_Store
docs/*

.idea/*
34 changes: 20 additions & 14 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
Package: immunarch
Type: Package
Title: Bioinformatics Analysis of T-Cell and B-Cell Immune Repertoires
Version: 0.6.5
Version: 0.6.7
Authors@R: c(
person("Vadim I.", "Nazarov", , "vdm.nazarov@gmail.com", c("aut", "cre")),
person("Vadim I.", "Nazarov", , "support@immunomind.io", c("aut", "cre")),
person("Vasily O.", "Tsvetkov", , role = "aut"),
person("Eugene", "Rumynskiy", , role = "aut"),
person("Aleksandr A.", "Popov", , role = "aut"),
person("Ivan", "Balashov", , role = "aut"),
person("Anna", "Lorenc", , role = "ctb"),
person("Daniel J.", "Moore", , role = "ctb"),
person("Victor", "Greiff", , role = "ctb"),
person("ImmunoMind", role = c("cph", "fnd"))
)
Contact: support@immunomind.io
Description: A comprehensive framework for bioinformatics exploratory analysis of bulk and single-cell
T-cell receptor and antibody repertoires. It provides seamless data loading, analysis and
Description: A comprehensive framework for bioinformatics exploratory analysis of bulk and single-cell
T-cell receptor and antibody repertoires. It provides seamless data loading, analysis and
visualisation for AIRR (Adaptive Immune Receptor Repertoire) data, both bulk immunosequencing (RepSeq)
and single-cell sequencing (scRNAseq). It implements most of the widely used AIRR analysis methods,
such as: clonality analysis, estimation of repertoire similarities in distribution of clonotypes
and gene segments, repertoire diversity analysis, annotation of clonotypes using external immune receptor
and single-cell sequencing (scRNAseq). It implements most of the widely used AIRR analysis methods,
such as: clonality analysis, estimation of repertoire similarities in distribution of clonotypes
and gene segments, repertoire diversity analysis, annotation of clonotypes using external immune receptor
databases and clonotype tracking in vaccination and cancer studies. A successor to our
previously published 'tcR' immunoinformatics package (Nazarov 2015) <doi:10.1186/s12859-015-0613-1>.
License: AGPL-3
Expand All @@ -33,25 +35,28 @@ Imports:
circlize,
MASS (>= 7.3),
Rtsne (>= 0.15),
readr (>= 1.3.1),
readxl (>= 1.3.1),
shiny (>= 1.4.0),
shinythemes,
airr,
ggseqlogo,
stringr (>= 1.4.0),
ggalluvial (>= 0.10.0),
Rcpp (>= 1.0),
magrittr,
tibble (>= 2.0),
methods,
scales,
ggpubr (>= 0.2),
rlang (>= 0.4),
plyr,
dbplyr (>= 1.4.0)
dbplyr (>= 1.4.0),
jsonlite,
readr,
stringr,
tibble,
tidyselect,
purrr
Depends:
R (>= 3.5.0),
R (>= 4.0.0),
ggplot2 (>= 3.1.0),
dplyr (>= 0.8.0),
dtplyr (>= 1.0.0),
Expand All @@ -63,8 +68,9 @@ Suggests:
roxygen2 (>= 3.0.0),
testthat (>= 2.1.0),
pkgdown (>= 0.1.0),
assertthat
assertthat,
rmarkdown
VignetteBuilder: knitr
Encoding: UTF-8
RoxygenNote: 7.1.0
RoxygenNote: 7.1.2
LazyData: true
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM r-base

# Install apt dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential file libcurl4-openssl-dev libcairo2-dev libxml2-dev libssl-dev \
libharfbuzz-dev libfribidi-dev libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev \
&& rm -rf /var/lib/apt/lists/*

# Install R dependencies
RUN R -e "install.packages(c('remotes', 'svglite'))"

# Copy source files to the image
COPY . /immunarch-src/

# Install Immunarch from source
RUN R -e "remotes::install_local('/immunarch-src', dependencies=TRUE)"

# Delete Immunarch source from the image
RUN rm -rf /immunarch-src
12 changes: 11 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export(cross_entropy)
export(dbAnnotate)
export(dbLoad)
export(entropy)
export(exclude)
export(fixVis)
export(geneUsage)
export(geneUsageAnalysis)
Expand All @@ -56,10 +57,14 @@ export(immunr_mds)
export(immunr_pca)
export(immunr_tsne)
export(inc_overlap)
export(include)
export(inframes)
export(interval)
export(js_div)
export(kl_div)
export(kmer_profile)
export(lessthan)
export(morethan)
export(noncoding)
export(outofframes)
export(pubRep)
Expand All @@ -73,6 +78,7 @@ export(public_matrix)
export(repClonality)
export(repDiversity)
export(repExplore)
export(repFilter)
export(repLoad)
export(repOverlap)
export(repOverlapAnalysis)
Expand Down Expand Up @@ -127,7 +133,6 @@ importFrom(dplyr,rename)
importFrom(dplyr,select)
importFrom(dplyr,summarise)
importFrom(dplyr,tally)
importFrom(dplyr,tbl_df)
importFrom(dplyr,top_n)
importFrom(dplyr,ungroup)
importFrom(dtplyr,lazy_dt)
Expand All @@ -151,12 +156,15 @@ importFrom(grDevices,colorRampPalette)
importFrom(graphics,plot)
importFrom(grid,gpar)
importFrom(grid,rectGrob)
importFrom(jsonlite,read_json)
importFrom(magrittr,"%<>%")
importFrom(magrittr,"%>%")
importFrom(methods,as)
importFrom(patchwork,plot_annotation)
importFrom(patchwork,wrap_plots)
importFrom(pheatmap,pheatmap)
importFrom(plyr,mapvalues)
importFrom(purrr,map)
importFrom(readr,col_character)
importFrom(readr,col_double)
importFrom(readr,col_guess)
Expand Down Expand Up @@ -214,7 +222,9 @@ importFrom(stringr,str_order)
importFrom(stringr,str_replace_all)
importFrom(stringr,str_sort)
importFrom(stringr,str_split)
importFrom(stringr,str_trim)
importFrom(tibble,tibble)
importFrom(tidyselect,starts_with)
importFrom(utils,packageVersion)
importFrom(utils,read.table)
importFrom(utils,setTxtProgressBar)
Expand Down
5 changes: 2 additions & 3 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

fill_vec <- function(read_vec, read_indices) {
.Call(`_immunarch_fill_vec`, read_vec, read_indices)
.Call(`_immunarch_fill_vec`, read_vec, read_indices)
}

fill_reads <- function(new_reads, new_counts) {
.Call(`_immunarch_fill_reads`, new_reads, new_counts)
.Call(`_immunarch_fill_reads`, new_reads, new_counts)
}

8 changes: 3 additions & 5 deletions R/diversity.R
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,7 @@ repDiversity <- function(.data, .method = "chao1", .col = "aa", .max.q = 6, .min

res <- add_class(res, new_class)
return(res)
}
else if (.method == "raref") {
} else if (.method == "raref") {
if (!has_class(.data, "list")) {
.data <- list(Sample = .data)
}
Expand All @@ -203,8 +202,7 @@ repDiversity <- function(.data, .method = "chao1", .col = "aa", .max.q = 6, .min
summarise(Div.count = sum(!!sym(IMMCOL$count))) %>%
pull(Div.count)
})
}
else {
} else {
.col <- process_col_argument(.col)

if (has_class(.data, "data.table")) {
Expand Down Expand Up @@ -406,7 +404,7 @@ rarefaction <- function(.data, .step = NA, .quantile = c(.025, .975),
lo <- Sind
hi <- Sind
}
res <- c(sz, Sind, lo, hi)
res <- c(sz, lo, Sind, hi)
names(res) <- c("Size", paste0("Q", .quantile[1]), "Mean", paste0("Q", .quantile[2]))
if (.verbose) add_pb(pb)
res
Expand Down
8 changes: 3 additions & 5 deletions R/dynamics.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,7 @@
#' vis(tc, .order = sample_order)
#' @export trackClonotypes
trackClonotypes <- function(.data, .which = list(1, 15), .col = "aa", .norm = TRUE) {
if (!has_class(.data, "list")) {
stop("Error: please pass a list with immune repertoires to track clonotypes.")
}
.validate_repertoires_data(.data)
if (length(.data) < 2) {
stop("Error: please pass a list with 2 or more immune repertoires to track clonotypes.")
}
Expand Down Expand Up @@ -147,8 +145,8 @@ trackClonotypes <- function(.data, .which = list(1, 15), .col = "aa", .norm = TR
result_df <- NULL
for (i_df in 1:length(.data)) {
temp_df <- .data[[i_df]] %>%
select(.col, Count = count_col)
setDT(temp_df)
select(.col, Count = count_col) %>%
as.data.table()

if (.norm) {
temp_df$Count <- temp_df$Count / sum(temp_df$Count)
Expand Down
6 changes: 5 additions & 1 deletion R/explore.R
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@ repExplore <- function(.data, .method = c("volume", "count", "len", "clones"), .
res <- do.call(rbind, res)
res <- add_class(res, "immunr_exp_count")
} else if (.method[1] %in% c("len", "lens", "length")) {
seq_col <- switch(.col[1], nt = IMMCOL$cdr3nt, aa = IMMCOL$cdr3aa, stop("Unknown sequence column: ", .col, ". Please provide either 'nt' or 'aa'"))
seq_col <- switch(.col[1],
nt = IMMCOL$cdr3nt,
aa = IMMCOL$cdr3aa,
stop("Unknown sequence column: ", .col, ". Please provide either 'nt' or 'aa'")
)
res <- lapply(.data, function(df) {
if (has_class(df, "data.table")) {
df <- df %>% lazy_dt()
Expand Down
Loading

0 comments on commit 75b7ece

Please sign in to comment.