Repository navigation
Expand file tree
/
Copy pathReport.Rmd
More file actions
78 lines (53 loc) · 1.84 KB
/
Copy pathReport.Rmd
File metadata and controls
78 lines (53 loc) · 1.84 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
---
title: "Report"
output:
html_document:
highlight: tango
number_sections: yes
theme: cerulean
toc: yes
toc_float: yes
pdf_document:
toc: yes
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, warning=FALSE, message=FALSE)
library(knitr)
library(ggplot2)
library(tidyr)
library(devtools)
library(pander)
library(rmarkdown)
#getwd()
```
## Result of simulation with no error or mutation rate
### Simulation for each of reference genome
```{r report1 result by each of genome, echo=F}
report1=read.csv('summarise.csv',sep='\t',header=F)
colnames(report1)=c("gene","read_count","length","coverage")
#report1$acc_no =
prot_dict = read.csv('access_vs_prot.csv',sep=',',header=F)
colnames(prot_dict)=c("acc_id","no_prot")
t=separate(data = report1, col = gene, into = c("Acc_no", "Protein"), sep = "_")
t=as.data.frame(table(t$Acc_no))
colnames(t) = c("acc_id","No_of_detected_prot")
x=merge(t,prot_dict,by="acc_id",all.x=T)
x$pct_detect=round(x$No_of_detected_prot/x$no_prot*100,2)
#barplot()
```
Table below is resulted from simulating each reference genome, generating 10000 reads, each read is 100bp with zero mutation rate and 0.5% error rate when aligning one by one reference genome separately to the graph:
```{r pressure, echo=FALSE}
pander(x)
```
### Plots
```{r plot for detection, echo = F}
plot(x$pct_detect,ylim = c(60,100), ylab="% detected protein",pch=20,col="blue")
lines(x$pct_detect,col="grey")
```
### Simulation for mixture of 4 query genomes
### Simulation for mixture of 17 contaminations
### Simulation for mixture of 3 queries and 17 contaminations
## Simulation analysis with error and mutation rate
### Error rate from 0 to 0.1\%
### Mutation rate from 0 to 0.1\%
Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.