Skip to content

Commit 75b7ece

Browse files
author
Alexander230
authored
Merge pull request #185 from immunomind/dev
Release 0.6.7
2 parents 9dce2ea + 0b57b75 commit 75b7ece

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+3435
-1832
lines changed

.Rbuildignore

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
^fixVis$
1010
^experiment data$
1111
^docker$
12+
^Dockerfile$
13+
^.dockerignore$
1214
^private$
1315
^.gitlab-ci.yml$
1416
^CONTRIBUTION.md$
@@ -18,3 +20,5 @@
1820
^LICENSE$
1921
^immunarch-citation.xml$
2022
^.github$
23+
^.RDataFiles$
24+
^.idea$

.dockerignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.git*
2+
.RDataFiles
3+
.idea
4+
*.Rproj

.github/workflows/dockerhub.yml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: DockerHub Image
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- dev
8+
tags:
9+
- "*"
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Get Image Tag
17+
shell: bash
18+
run: echo "##[set-output name=tag;]$([ "${GITHUB_REF}" == "refs/heads/master" ] && echo base || echo ${GITHUB_REF##*/})"
19+
id: get_tag
20+
21+
- name: Check Out Repo
22+
uses: actions/checkout@v2
23+
24+
- name: Login to Docker Hub
25+
uses: docker/login-action@v1
26+
with:
27+
username: ${{ secrets.DOCKERHUB_USERNAME }}
28+
password: ${{ secrets.DOCKERHUB_TOKEN }}
29+
30+
- name: Set up Docker Buildx
31+
id: buildx
32+
uses: docker/setup-buildx-action@v1
33+
34+
- name: Build and push
35+
id: docker_build
36+
uses: docker/build-push-action@v2
37+
with:
38+
context: ./
39+
file: ./Dockerfile
40+
builder: ${{ steps.buildx.outputs.name }}
41+
push: true
42+
tags: ${{ secrets.DOCKERHUB_USERNAME }}/immunarch-docker:${{ steps.get_tag.outputs.tag }}
43+
44+
- name: Image digest
45+
run: echo ${{ steps.docker_build.outputs.digest }}

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
.Rhistory
33
.RData
44
.Ruserdata
5+
.RDataFiles/*
56
src/*.o
67
src/*.so
78
src/*.dll
89
*.DS_Store
910
docs/*
10-
11+
.idea/*

DESCRIPTION

+20-14
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
Package: immunarch
22
Type: Package
33
Title: Bioinformatics Analysis of T-Cell and B-Cell Immune Repertoires
4-
Version: 0.6.5
4+
Version: 0.6.7
55
Authors@R: c(
6-
person("Vadim I.", "Nazarov", , "[email protected]", c("aut", "cre")),
6+
person("Vadim I.", "Nazarov", , "[email protected]", c("aut", "cre")),
77
person("Vasily O.", "Tsvetkov", , role = "aut"),
88
person("Eugene", "Rumynskiy", , role = "aut"),
9+
person("Aleksandr A.", "Popov", , role = "aut"),
10+
person("Ivan", "Balashov", , role = "aut"),
911
person("Anna", "Lorenc", , role = "ctb"),
1012
person("Daniel J.", "Moore", , role = "ctb"),
1113
person("Victor", "Greiff", , role = "ctb"),
1214
person("ImmunoMind", role = c("cph", "fnd"))
1315
)
1416
15-
Description: A comprehensive framework for bioinformatics exploratory analysis of bulk and single-cell
16-
T-cell receptor and antibody repertoires. It provides seamless data loading, analysis and
17+
Description: A comprehensive framework for bioinformatics exploratory analysis of bulk and single-cell
18+
T-cell receptor and antibody repertoires. It provides seamless data loading, analysis and
1719
visualisation for AIRR (Adaptive Immune Receptor Repertoire) data, both bulk immunosequencing (RepSeq)
18-
and single-cell sequencing (scRNAseq). It implements most of the widely used AIRR analysis methods,
19-
such as: clonality analysis, estimation of repertoire similarities in distribution of clonotypes
20-
and gene segments, repertoire diversity analysis, annotation of clonotypes using external immune receptor
20+
and single-cell sequencing (scRNAseq). It implements most of the widely used AIRR analysis methods,
21+
such as: clonality analysis, estimation of repertoire similarities in distribution of clonotypes
22+
and gene segments, repertoire diversity analysis, annotation of clonotypes using external immune receptor
2123
databases and clonotype tracking in vaccination and cancer studies. A successor to our
2224
previously published 'tcR' immunoinformatics package (Nazarov 2015) <doi:10.1186/s12859-015-0613-1>.
2325
License: AGPL-3
@@ -33,25 +35,28 @@ Imports:
3335
circlize,
3436
MASS (>= 7.3),
3537
Rtsne (>= 0.15),
36-
readr (>= 1.3.1),
3738
readxl (>= 1.3.1),
3839
shiny (>= 1.4.0),
3940
shinythemes,
4041
airr,
4142
ggseqlogo,
42-
stringr (>= 1.4.0),
4343
ggalluvial (>= 0.10.0),
4444
Rcpp (>= 1.0),
4545
magrittr,
46-
tibble (>= 2.0),
4746
methods,
4847
scales,
4948
ggpubr (>= 0.2),
5049
rlang (>= 0.4),
5150
plyr,
52-
dbplyr (>= 1.4.0)
51+
dbplyr (>= 1.4.0),
52+
jsonlite,
53+
readr,
54+
stringr,
55+
tibble,
56+
tidyselect,
57+
purrr
5358
Depends:
54-
R (>= 3.5.0),
59+
R (>= 4.0.0),
5560
ggplot2 (>= 3.1.0),
5661
dplyr (>= 0.8.0),
5762
dtplyr (>= 1.0.0),
@@ -63,8 +68,9 @@ Suggests:
6368
roxygen2 (>= 3.0.0),
6469
testthat (>= 2.1.0),
6570
pkgdown (>= 0.1.0),
66-
assertthat
71+
assertthat,
72+
rmarkdown
6773
VignetteBuilder: knitr
6874
Encoding: UTF-8
69-
RoxygenNote: 7.1.0
75+
RoxygenNote: 7.1.2
7076
LazyData: true

Dockerfile

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM r-base
2+
3+
# Install apt dependencies
4+
RUN apt-get update && apt-get install -y --no-install-recommends \
5+
build-essential file libcurl4-openssl-dev libcairo2-dev libxml2-dev libssl-dev \
6+
libharfbuzz-dev libfribidi-dev libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev \
7+
&& rm -rf /var/lib/apt/lists/*
8+
9+
# Install R dependencies
10+
RUN R -e "install.packages(c('remotes', 'svglite'))"
11+
12+
# Copy source files to the image
13+
COPY . /immunarch-src/
14+
15+
# Install Immunarch from source
16+
RUN R -e "remotes::install_local('/immunarch-src', dependencies=TRUE)"
17+
18+
# Delete Immunarch source from the image
19+
RUN rm -rf /immunarch-src

NAMESPACE

+11-1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export(cross_entropy)
4343
export(dbAnnotate)
4444
export(dbLoad)
4545
export(entropy)
46+
export(exclude)
4647
export(fixVis)
4748
export(geneUsage)
4849
export(geneUsageAnalysis)
@@ -56,10 +57,14 @@ export(immunr_mds)
5657
export(immunr_pca)
5758
export(immunr_tsne)
5859
export(inc_overlap)
60+
export(include)
5961
export(inframes)
62+
export(interval)
6063
export(js_div)
6164
export(kl_div)
6265
export(kmer_profile)
66+
export(lessthan)
67+
export(morethan)
6368
export(noncoding)
6469
export(outofframes)
6570
export(pubRep)
@@ -73,6 +78,7 @@ export(public_matrix)
7378
export(repClonality)
7479
export(repDiversity)
7580
export(repExplore)
81+
export(repFilter)
7682
export(repLoad)
7783
export(repOverlap)
7884
export(repOverlapAnalysis)
@@ -127,7 +133,6 @@ importFrom(dplyr,rename)
127133
importFrom(dplyr,select)
128134
importFrom(dplyr,summarise)
129135
importFrom(dplyr,tally)
130-
importFrom(dplyr,tbl_df)
131136
importFrom(dplyr,top_n)
132137
importFrom(dplyr,ungroup)
133138
importFrom(dtplyr,lazy_dt)
@@ -151,12 +156,15 @@ importFrom(grDevices,colorRampPalette)
151156
importFrom(graphics,plot)
152157
importFrom(grid,gpar)
153158
importFrom(grid,rectGrob)
159+
importFrom(jsonlite,read_json)
160+
importFrom(magrittr,"%<>%")
154161
importFrom(magrittr,"%>%")
155162
importFrom(methods,as)
156163
importFrom(patchwork,plot_annotation)
157164
importFrom(patchwork,wrap_plots)
158165
importFrom(pheatmap,pheatmap)
159166
importFrom(plyr,mapvalues)
167+
importFrom(purrr,map)
160168
importFrom(readr,col_character)
161169
importFrom(readr,col_double)
162170
importFrom(readr,col_guess)
@@ -214,7 +222,9 @@ importFrom(stringr,str_order)
214222
importFrom(stringr,str_replace_all)
215223
importFrom(stringr,str_sort)
216224
importFrom(stringr,str_split)
225+
importFrom(stringr,str_trim)
217226
importFrom(tibble,tibble)
227+
importFrom(tidyselect,starts_with)
218228
importFrom(utils,packageVersion)
219229
importFrom(utils,read.table)
220230
importFrom(utils,setTxtProgressBar)

R/RcppExports.R

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
33

44
fill_vec <- function(read_vec, read_indices) {
5-
.Call(`_immunarch_fill_vec`, read_vec, read_indices)
5+
.Call(`_immunarch_fill_vec`, read_vec, read_indices)
66
}
77

88
fill_reads <- function(new_reads, new_counts) {
9-
.Call(`_immunarch_fill_reads`, new_reads, new_counts)
9+
.Call(`_immunarch_fill_reads`, new_reads, new_counts)
1010
}
11-

R/diversity.R

+3-5
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,7 @@ repDiversity <- function(.data, .method = "chao1", .col = "aa", .max.q = 6, .min
184184

185185
res <- add_class(res, new_class)
186186
return(res)
187-
}
188-
else if (.method == "raref") {
187+
} else if (.method == "raref") {
189188
if (!has_class(.data, "list")) {
190189
.data <- list(Sample = .data)
191190
}
@@ -203,8 +202,7 @@ repDiversity <- function(.data, .method = "chao1", .col = "aa", .max.q = 6, .min
203202
summarise(Div.count = sum(!!sym(IMMCOL$count))) %>%
204203
pull(Div.count)
205204
})
206-
}
207-
else {
205+
} else {
208206
.col <- process_col_argument(.col)
209207

210208
if (has_class(.data, "data.table")) {
@@ -406,7 +404,7 @@ rarefaction <- function(.data, .step = NA, .quantile = c(.025, .975),
406404
lo <- Sind
407405
hi <- Sind
408406
}
409-
res <- c(sz, Sind, lo, hi)
407+
res <- c(sz, lo, Sind, hi)
410408
names(res) <- c("Size", paste0("Q", .quantile[1]), "Mean", paste0("Q", .quantile[2]))
411409
if (.verbose) add_pb(pb)
412410
res

R/dynamics.R

+3-5
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,7 @@
9797
#' vis(tc, .order = sample_order)
9898
#' @export trackClonotypes
9999
trackClonotypes <- function(.data, .which = list(1, 15), .col = "aa", .norm = TRUE) {
100-
if (!has_class(.data, "list")) {
101-
stop("Error: please pass a list with immune repertoires to track clonotypes.")
102-
}
100+
.validate_repertoires_data(.data)
103101
if (length(.data) < 2) {
104102
stop("Error: please pass a list with 2 or more immune repertoires to track clonotypes.")
105103
}
@@ -147,8 +145,8 @@ trackClonotypes <- function(.data, .which = list(1, 15), .col = "aa", .norm = TR
147145
result_df <- NULL
148146
for (i_df in 1:length(.data)) {
149147
temp_df <- .data[[i_df]] %>%
150-
select(.col, Count = count_col)
151-
setDT(temp_df)
148+
select(.col, Count = count_col) %>%
149+
as.data.table()
152150

153151
if (.norm) {
154152
temp_df$Count <- temp_df$Count / sum(temp_df$Count)

R/explore.R

+5-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,11 @@ repExplore <- function(.data, .method = c("volume", "count", "len", "clones"), .
101101
res <- do.call(rbind, res)
102102
res <- add_class(res, "immunr_exp_count")
103103
} else if (.method[1] %in% c("len", "lens", "length")) {
104-
seq_col <- switch(.col[1], nt = IMMCOL$cdr3nt, aa = IMMCOL$cdr3aa, stop("Unknown sequence column: ", .col, ". Please provide either 'nt' or 'aa'"))
104+
seq_col <- switch(.col[1],
105+
nt = IMMCOL$cdr3nt,
106+
aa = IMMCOL$cdr3aa,
107+
stop("Unknown sequence column: ", .col, ". Please provide either 'nt' or 'aa'")
108+
)
105109
res <- lapply(.data, function(df) {
106110
if (has_class(df, "data.table")) {
107111
df <- df %>% lazy_dt()

0 commit comments

Comments
 (0)