-
Notifications
You must be signed in to change notification settings - Fork 0
/
Fig_a-f.Rmd
169 lines (129 loc) · 3.97 KB
/
Fig_a-f.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
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
---
title: "R Notebook"
output: html_notebook
---
This is an [R Markdown](http://rmarkdown.rstudio.com) Notebook. When you execute code within the notebook, the results appear beneath the code.
Try executing this chunk by clicking the *Run* button within the chunk or by placing your cursor inside it and pressing *Cmd+Shift+Enter*.
Download data for Fig_a-e
```{r}
data<- read.csv("/Users/sanzidaakhteranee/Documents/HackBio_Contest/Phase_1/Data/untitled folder/fig_One_a_e.dat.csv", header= TRUE, sep = ",")
print(data)
```
Download data for figure f
```{r}
data1 <- read.csv ("/Users/sanzidaakhteranee/Documents/HackBio_Contest/fig_one_f.csv", header=TRUE, sep = ",")
print(data1)
```
```{r}
par(mfrow=c(3, 3))
par(mar=c(4,6,2,1))
#fig_a
plot(0,
type = "n",
xlim = c(5,40),
ylim = c(0,12000),
xlab = "Sequencing Depth",
ylab = "Unique Fragment in Peaks",
main = "Fig 1a",
las = 1)
data_color <- rainbow(10) #colors defined
technology <- unique(data$tech)
technology
#looping over the number of data
for (i in 1:10) {
subset_data <- data[data$tech == technology[i],]
lines(subset_data$depth,
subset_data$Unique_nr_frag_in_regions,
col = data_color[i], lwd =
5)}
#fig_b
plot(0,
type = "n",
xlim = c(5,40),
ylim = c(0,40),
xlab = "Sequencing Depth",
ylab = "Unique Fragment in Peaks",
main = "Fig 1b",
las = 1)
data_color <- rainbow(10) #colors defined
technology <- unique(data$tech)
technology
#looping over the number of data
for (i in 1:10) {
subset_data <- data[data$tech == technology[i],]
lines(subset_data$depth,
subset_data$TSS_enrichment,
col = data_color[i],
lwd = 5)}
#fig_c
plot(0,
type = "n",
xlim = c(5,40),
ylim = c(.0, .5),
xlab = "Sequencing Depth",
ylab = "Sequencing Efficiency",
main = "Fig 1c",
las = 1)
data_color <- rainbow(10) #colors defined
technology <- unique(data$tech)
technology
#looping over the number of data
for (i in 1:10) {
subset_data <- data[data$tech == technology[i],]
lines(subset_data$depth,
subset_data$X._unique_nr_frag_in_regions_in_cells,
col = data_color[i],
lwd =5)}
#fig_d
plot(0,
type = "n",
xlim = c(5,40),
ylim = c(.0, .9),
xlab = "Sequencing Depth",
ylab = "Median Seurat Score",
main = "Fig 1d",
las = 1)
data_color <- rainbow(10) #colors defined
technology <- unique(data$tech)
technology
#looping over the number of data
for (i in 1:10) {
subset_data <- data[data$tech == technology[i],]
lines(subset_data$depth,
subset_data$median_cell_type_pred_score,
col = data_color[i],
lwd =
5)}
#fig_e
plot(0,
type = "n",
xlim = c(5,40),
ylim = c(0, 35),
xlab = "Sequencing Depth",
ylab = "Bcell Strength(FC)",
main = "Fig 1d",
las = 1)
data_color <- rainbow(10) #colors defined
technology <- unique(data$tech)
technology
#looping over the number of data
for (i in 1:10) {
subset_data <- data[data$tech == technology[i],]
lines(subset_data$depth,
subset_data$fc__B_cell,
col = data_color[i],
lwd =5)}
#fig_f (scatter plot)
plot(x= data1$Median_Unique_nr_frag_in_regions,
y= data1$Mean_scrublet_doublet_scores_fragments,
col=factor(data1$technology),
pch=19,
xlim= c(0, 12000),
ylim= c(0.08, 0.20),
main= 'Fig 1f',
xlab='Median Unique Fragment',
ylab='Median Scrublet Score')
```
Add a new chunk by clicking the *Insert Chunk* button on the toolbar or by pressing *Cmd+Option+I*.
When you save the notebook, an HTML file containing the code and output will be saved alongside it (click the *Preview* button or press *Cmd+Shift+K* to preview the HTML file).
The preview shows you a rendered HTML copy of the contents of the editor. Consequently, unlike *Knit*, *Preview* does not run any R code chunks. Instead, the output of the chunk when it was last run in the editor is displayed.