Yorksite

All those moments will be lost in time, like tears in rain

数据可视化——基本图形元素及其应用

介绍可视化作图过程中使用的基本元素,简单分析不同数据类型与适合使用的展示方式。

七月 19, 2023 · Yorkson

单变量异常值检测方法

整理一下检测单变量异常值的方法。

七月 17, 2023 · Yorkson

复现一张相关性图

前几天看到群里有人问如何画一张类似下图的、带拟合线与误差的相关性图,这里找点数据来演示一下怎么画。 找了点数字画了个例子,假设数据读进来是这样的两列: 绘图的部分我用了这些 leg <- theme(title=element_text(size=15), axis.text.x=element_text(size=14), axis.text.y=element_text(size=14), legend.text=element_text(size=14)) label_text <- paste0("r = ", round(cor(subdata$Na,subdata$K),2)) library(ggplot2) ggplot(subdata, aes(x = log(Na), y = log(K))) + geom_point(size = 2,color = "#31705a") + stat_smooth(method = "lm", color = "#31705a")+ theme_classic() + annotate("text", x=5.8, y=9, label= label_text) + leg 以上代码画出来的图如下: 其中各部分的解释如下 leg <- theme(title=element_text(size=15), axis.text.x=element_text(size=14), axis.text.y=element_text(size=14), legend.text=element_text(size=14)) # 用于指定字体大小等,可以先忽略 label_text <- paste0("r = ", round(cor(subdata$Na,subdata$K),2)) # 用于计算相关系数r的值,并处理成标在图上的「r = xxx」的文本 library(ggplot2) # 用ggplot2包画图 ggplot(subdata, aes(x = log(Na), y = log(K))) + #指定画图的数据subdata,在aes(x = ,y = )中指定横纵坐标轴 geom_point(size = 2,color = "#31705a") + #绘制散点部分,点的大小为2,颜色为浅绿色 stat_smooth(method = "lm", color = "#31705a")+ #绘制拟合线部分,method = "lm" 使用线性拟合,颜色同前 theme_classic() + # 使用ggplot的classic画图主题,是个只显示横纵坐标轴的主题 annotate("text", x=5....

五月 30, 2023 · Yorkson

【读文献】单细胞分析最佳实践

Best practices for single-cell analysis across modalities

四月 7, 2023 · Yorkson

Docker 打包 Shiny App

介绍了如何将 Shiny App 打包成 Docker 格式,方便在不同设备环境下托管

三月 28, 2023 · Yorkson

部署预印本追踪 TRxiv 到 Github Action

将JS写的抓取 Altmetric 热门预印本,与 bioRxiv API 结合后储存在 csv 文件中的过程,部署在 Github Action 中。官方文档写的顺序都有点混乱,网上找到的教程又经常都比较老了,因此自己记录一个。 新建Github仓库 新建一个public仓库,名叫TRxiv,并将远程仓库git clone到本地。 git clone git@github.com:Yorks0n/TRxiv.git cd TRxiv 创建一个动作元数据文件 要让仓库里能被以Action的形式直接调用,需要在根目录中创建一个action.yml配置文件,可以在这个文件中指定Action的输入和输出,调用的参数及运行环境 # action.yml name: 'trxiv' description: 'Tracking popular bioRxiv and medRxiv preprints' runs: using: 'node16' main: 'dist/index.js' 准备运行的代码 手动将写好的JS脚本拷贝进来,完整代码在此 Yorkson/TRxiv。 # 在这里初始化一下npm npm init -y 准备一个.gitignore文件,防止在推送的时候把不必要的文件放到储存库,可以用下面这个工具,或者自己写一下,比如这里就可能有node_modules https://www.toptal.com/developers/gitignore 文件推送到远程仓库 然后push到远程仓库 git add . git commit -m "Initialize" git push 打包软件 因为前面把node_modules 从上传的文件列表中忽略了,但脚本index.js内有些依赖的包,所以最好把软件和依赖打包在一起,官方推荐用ncc npm install @vercel/ncc 然后对index.js 进行打包 ncc build index.js -o dist 打包产物会存放于dist/index....

三月 24, 2023 · Yorkson

Hello, again

我为什么又开始写 Blog 了?

三月 24, 2023 · Yorkson

1 dataset 100 visualizations 中有意思的可视化

分享最近看到的一组有意思的数据可视化

三月 9, 2023 · Yorkson

论文可视化配色简易指南

论文作图时用得上的配色技巧与工具

九月 20, 2022 · Yorkson

Karabiner 助力,让你的键盘操作快人一步

如何借助 Goku 书写 Karabiner 配置文件

六月 16, 2022 · Yorkson