File: Figure_for_random_access.R

package info (click to toggle)
pyfastx 2.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,336 kB
  • sloc: ansic: 4,820; python: 1,817; sh: 505; perl: 66; makefile: 31
file content (84 lines) | stat: -rw-r--r-- 2,391 bytes parent folder | download | duplicates (2)
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
library(ggplot2)
library(patchwork)

df <- read.table("matrix_fasta_random_access.tsv", header = TRUE, sep = "\t")
#df1 <- df[which(df$tool != 'pyfasta' & df$tool != 'pyfastx_gzip' & df$tool != 'biopython'),]
#df2 <- df[which(df$tool == 'pyfasta' | df$tool == 'pyfastx_gzip' | df$tool == 'biopython'),]

p1 <-
  ggplot(df, aes(
    x = reorder(genome, size),
    time,
    colour = tool,
    group = tool
  )) +
  geom_point(aes(size = memory)) +
  geom_line() +
  ylim(0, 1000) +
  facet_grid(rows = vars(tool)) +
  theme_bw() +
  theme(axis.text.x = element_text(angle = 30, hjust = 1),
        axis.title.x = element_blank()) +
  ylab("Elapsed time (s)") +
  guides(colour = guide_legend(title = "Tools"),
         size = guide_legend(title = "Memory (GB)"))

#p2 <-
#  ggplot(df2, aes(
#    x = reorder(genome, size),
#    time,
#    colour = tool,
#    group = tool
#  )) +
#  geom_point(aes(size = memory)) +
#  geom_line() +
  #facet_grid(rows = vars(tool), scales="free_y") +
#  theme_bw() +
#  theme(axis.text.x = element_text(angle = 30, hjust = 1),
#        axis.title.x = element_blank()) +
#  ylab("Elapsed time (s)") +
#  guides(colour = guide_legend(title = "Tools"),
#         size = guide_legend(title = "Memory (GB)"))

df2 <- read.table("matrix_fasta_extract_subsequences.tsv", header=TRUE, sep="\t")
p2 <-
  ggplot(df2, aes(
    x = reorder(genome, size),
    time,
    colour = tool,
    group = tool
  )) +
  geom_point(aes(size = memory)) +
  geom_line() +
  ylim(0, 50) + 
  facet_grid(rows = vars(tool)) +
  theme_bw() +
  theme(axis.text.x = element_text(angle = 30, hjust = 1),
        axis.title.x = element_blank()) +
  ylab("Elapsed time (s)") +
  guides(colour = guide_legend(title = "Tools"),
         size = guide_legend(title = "Memory (GB)"))

df3 <- read.table("matrix_fastq_random_access.tsv", header = TRUE, sep = "\t")

p3 <-
  ggplot(df3, aes(
    x = reorder(file, fsize),
    time,
    colour = tool,
    group = tool
  )) +
  geom_point(aes(size = memory)) +
  geom_line() +
  ylim(0, 500) + 
  facet_grid(rows = vars(tool)) +
  theme_bw() +
  theme(axis.text.x = element_text(angle = 30, hjust = 1),
        axis.title.x = element_blank()) +
  ylab("Elapsed time (s)") +
  guides(colour = guide_legend(title = "Tools"),
         size = guide_legend(title = "Memory (GB)"))

pp <- p1 | p2 | p3
pp <- pp + plot_annotation(tag_levels = 'A')
show(pp)