You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
make heatmap versions scaled based on both counts and relative abundance. Also make the cutoff zone a bit more opaque and scale it to the total length of the primers
# bind all the data, then group by Sample, add in relative abundance per Sample and binning info, then group by Sample + Bin and summarize counts and RelAb per bin
24
-
# It's a bit of a hack but it generally works; however it's not perfect
25
-
lens_all<- bind_rows(lens_tmp, .id="Sample") %>%
26
-
group_by(Sample) %>%
27
-
mutate(RelAb=Count/sum(Count),
28
-
Bin= cut(Length,
29
-
seq(min(Length),
30
-
max(Length),5),
31
-
include.lowest=TRUE)) %>%
32
-
group_by(Sample, Bin) %>%
33
-
mutate(ReadCountPerBin=sum(Count),
34
-
RelAbPerBin=sum(RelAb))
29
+
# bind all the data,
30
+
# group by Sample,
31
+
# add in relative abundance per Sample and binning info,
32
+
# group by Sample + Bin,
33
+
# summarize counts and RelAb per bin.
34
+
lens_all<- bind_rows(lens_tmp, .id="Sample") |>
35
+
group_by(Sample) |>
36
+
mutate(RelAb=Count/ sum(Count),
37
+
Bin= cut(Length,
38
+
seq(min(Length),
39
+
max(Length), 5),
40
+
include.lowest=TRUE)) |>
41
+
group_by(Sample, Bin) |>
42
+
mutate(ReadCountPerBin= sum(Count),
43
+
RelAbPerBin= sum(RelAb))
35
44
36
45
lens_all$Sample<-factor(lens_all$Sample)
37
46
38
47
# This will become settable, but essentially anything 50nt or less is not kept
0 commit comments