Skip to content

Commit e912c3f

Browse files
check on what i spopular now
1 parent 857f18b commit e912c3f

1 file changed

Lines changed: 29 additions & 9 deletions

File tree

Untitled.R

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ for(i in 1:length(all_pages)){
6565

6666
saveRDS(biostars_dat,"~/Desktop/biostars.rds")
6767

68-
68+
biostars_dat <- readRDS("~/Desktop/biostars.rds")
6969
biostars_dat_sub <- biostars_dat[,-1]
7070

7171
unlist(biostars_dat_sub)
@@ -114,16 +114,16 @@ to_plot <- data.frame("Python"=python_percentile, "R"=r_percentile,
114114

115115
to_plot3 <- to_plot[-c(1:100,(nrow(to_plot)-100):nrow(to_plot)),]
116116

117-
to_plot2 <- pivot_longer(to_plot,cols=1:6, names_to = "Language", values_to = "Tag%")
118-
to_plot4 <- pivot_longer(to_plot3,cols=1:6, names_to = "Language", values_to = "Tag%")
117+
to_plot2 <- pivot_longer(to_plot,cols=1:6, names_to = "Language", values_to = "Tag (per100)")
118+
to_plot4 <- pivot_longer(to_plot3,cols=1:6, names_to = "Language", values_to = "Tag (per100)")
119119

120120
library(ggplot2)
121121

122-
ggplot(to_plot4, aes(x=Time, y=`Tag%`, color=Language)) + geom_smooth()
122+
ggplot(to_plot4, aes(x=Posts, y=`Tag (per100)`, color=Language)) + geom_smooth()
123123

124-
ggplot(to_plot2, aes(x=Time, y=`Tag%`, color=Language)) + geom_smooth(span = 10000)
124+
ggplot(to_plot2, aes(x=Posts, y=`Tag (per100)`, color=Language)) + geom_smooth(span = 10000)
125125

126-
ggplot(to_plot2, aes(x=Time, y=`Tag%`, color=Language)) + geom_smooth(span = 0.01)
126+
ggplot(to_plot2, aes(x=Posts, y=`Tag (per100)`, color=Language)) + geom_smooth(span = 0.01)
127127

128128

129129

@@ -133,7 +133,7 @@ biopython <- sapply(t(biostars_dat_sub) ,function(x){
133133
})
134134

135135
bioconductor <- sapply(t(biostars_dat_sub) ,function(x){
136-
present <- any(x %in% c("Biopython", "biopython"))
136+
present <- any(x %in% c("Bioconductor", "bioconductor"))
137137
return(present)
138138
})
139139

@@ -155,6 +155,26 @@ seurat_percentile <- slide_dbl(seurat, ~sum(.x), .before = 49, .after = 50)
155155

156156
to_plot <- data.frame("Bioconductor"=bioconductor_percentile, "Biopython"=biopython_percentile,
157157
"Scanpy"=scanpy_percentile, "Seurat"=seurat_percentile, "Posts"=length(rust_percentile):1)
158-
to_plot2 <- pivot_longer(to_plot,cols=1:4, names_to = "Package", values_to = "Tag%")
158+
to_plot2 <- pivot_longer(to_plot,cols=1:4, names_to = "Package", values_to = "Tag (per100)")
159+
160+
ggplot(to_plot2, aes(x=Posts, y=`Tag (per100)`, color=Package)) + geom_smooth()
161+
162+
ggplot(to_plot2, aes(x=Posts, y=`Tag (per100)`, color=Package)) + geom_smooth()
163+
164+
165+
to_save <- dplyr::filter(to_plot2, Package %in% c("Scanpy","Seurat")) %>% ggplot( aes(x=Posts, y=`Tag (per100)`, color=Package)) + geom_smooth() + ggtitle("scRNAseq package posts on Biostars")+ theme_bw()
166+
ggsave("IntroToPython/inst/extdata/imgs/scanpy_vs_seurat.png", to_save)
167+
168+
169+
170+
171+
172+
173+
174+
geneNames <- c("Gene_1", "Gene_2", "Gene_3","Gene_4", "Gene_5", "Gene_6", "Gene_7", "Gene_8", "Gene_9", "Gene10")
175+
expression <- c(100, 3000, 200, 1000, 10,1000,500,2500,250,5000)
176+
geneLengths <- c(1000, 3000, 1000, 1200, 500, 500, 1000,750,1500,2000)
177+
goterm <- c("GO:Biosynthetic Process","GO:Catabolic Process","GO:Biosynthetic Process","GO:Catabolic Process","GO:Biosynthetic Process","GO:Catabolic Process","GO:Biosynthetic Process","GO:Catabolic Process","GO:Biosynthetic Process","GO:Catabolic Process")
178+
mydf <- data.frame(geneNames,expression,geneLengths,goterm)
159179

160-
ggplot(to_plot2, aes(x=Posts, y=`Tag%`, color=Package)) + geom_smooth()
180+
write.csv(mydf, "IntroToPython/inst/extdata/data/gene_expression.csv", row.names = F, quote = F)

0 commit comments

Comments
 (0)