-
Notifications
You must be signed in to change notification settings - Fork 0
/
Hill_diversity_test.Rmd
51 lines (40 loc) · 2.12 KB
/
Hill_diversity_test.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
---
title: "Hill_ILE"
author: "Carolina Monzo"
date: "7/31/2020"
output: pdf_document
---
In order to get this working we had to annotate the database with the file name and then merge them:
(MPI) CMonzo@LP-080:~/workspace/CM_IgSeq_tmp
$ ParseDb.py add -d dedup-mpg_L19253_I10_S10_001_PRIMER-S3_R1_genotype_airr_clone-pass_germ-pass.tsv -f sample_id -u I10_S10_001_PRIMER-S3_R1 --outdir ./
(MPI) CMonzo@LP-080:~/workspace/CM_IgSeq_tmp
$ ParseDb.py add -d dedup-mpg_L19253_I10_S10_001_PRIMER-S4_R1_genotype_airr_clone-pass_germ-pass.tsv -f sample_id -u I10_S10_001_PRIMER-S4_R1 --outdir ./
(MPI) CMonzo@LP-080:~/workspace/CM_IgSeq_tmp
$ ParseDb.py merge -d dedup-mpg_L19253_I10_S10_001_PRIMER-S3_R1_genotype_airr_clone-pass_germ-pass_parse-add.tsv dedup-mpg_L19253_I10_S10_001_PRIMER-S4_R1_genotype_airr_clone-pass_germ-pass_parse-add.tsv -o merged_I10_S3_S4.tsv
```{r libraries, message = FALSE}
suppressPackageStartupMessages(library(alakazam))
suppressPackageStartupMessages(library(tigger))
suppressPackageStartupMessages(library(dplyr))
suppressPackageStartupMessages(library(ggplot2))
suppressPackageStartupMessages(library(airr))
suppressPackageStartupMessages(library(shazam))
suppressPackageStartupMessages(library(scoper))
#names(IG_COLORS) <- c( "IGA", "IGD", "IGE", "IGG12", "IGM", "IGG3")
names(IG_COLORS) <- c( "IGM", "IGG12", "IGA", "IGD", "IGE", "IGG3")
# Read file that passed cloning and germline creation
db <- read_airr("~/workspace/CM_IgSeq_tmp/merged_I10_S3_S4.tsv")
```
```{r}
sample_colors <- c("I10_S10_001_PRIMER-S4_R1"="#000099", "I10_S10_001_PRIMER-S3_R1"="#000099")
curve <- estimateAbundance(db, group = "sample_id", ci = 0.95, nboot = 200, clone = "clone_id")
plot(curve, colors = sample_colors, legend_title="Sample")
```
```{r}
sample_curve <- alphaDiversity(db, group = "sample_id", clone="clone_id", min_q=0, max_q=4, step_q=0.1, ci=0.95, nboot=200)
sample_main <- paste0("Sample diversity")
plot(sample_curve, colors=sample_colors, main_title=sample_main, legend_title="Sample")
```
```{r}
sample_test <- alphaDiversity(db, group="sample_id", clone="clone_id", min_q=0, max_q=2, step_q=1, nboot=200)
print(sample_test@tests)
```