随笔分类 -  统计R

z-score Normalization
摘要:Z-score 表示一个值是高于或低于平均值多少个标准差( a score that indicates how many standard deviations a value is above or below the mean). 比如用于RNA-seq 的normalisation. 对每个 阅读全文

posted @ 2022-06-15 14:30 BioinformaticsMaster 阅读(2042) 评论(0) 推荐(1)

计算 GWAS的 lambda GC
摘要:You have conducted your genome-wide association study (GWAS) and have tested each genetic variant for an association with your trait of interest. Now 阅读全文

posted @ 2022-06-13 14:52 BioinformaticsMaster 阅读(1064) 评论(0) 推荐(0)

KING
摘要:KING 根据个体的基因组数据,判断亲子关系,推断个体间的亲缘关系 family relationship and flag pedigree errors。 PI作者是个华人 https://www.kingrelatedness.com/ 不同亲缘关系推断一句 依次解释如下: MT 同卵双胞胎 阅读全文

posted @ 2022-05-24 15:52 BioinformaticsMaster 阅读(707) 评论(0) 推荐(0)

ggplot2 的scale手动设置
摘要:scale_colour_manual(...,values) scale_fill_manual(...,values) scale_size_manual(...,values) scale_shape_manual(...,values) scale_linetype_manual(...,v 阅读全文

posted @ 2022-05-23 13:19 BioinformaticsMaster 阅读(353) 评论(0) 推荐(0)

expression函数在R图上增公式,数学符号
摘要:> x<-1:10 > y<-x^2 > plot(x,y) > plot(x,y,ylab=expression(x^y)) > plot(1:10,ylab=expression(a[b])) x<-1:10 > y<-sqrt(x) > plot(x,y,ylab=expression(y== 阅读全文

posted @ 2022-05-15 00:10 BioinformaticsMaster 阅读(126) 评论(0) 推荐(0)

na.rm 缺失值处理
摘要:is.na 检测缺失值,返回结果为true,false na.rm=TRUE 很多函数有这个参数,即在计算之前移除缺失值,并使用剩余值计算。 https://www.cnblogs.com/GhostBear/p/8416897.html 阅读全文

posted @ 2022-05-14 23:45 BioinformaticsMaster 阅读(188) 评论(0) 推荐(0)

geom_ribbon 给数据分组 的覆盖面积上色
摘要:huron<-data.frame(year=1875:1972,level=as.vector(LakeHuron),level2=as.vector(LakeHuron)) huron[1:50,2]<-huron[1:50,2]+100 #给第二列,1:50行每个值加100 huron[50: 阅读全文

posted @ 2022-05-14 22:26 BioinformaticsMaster 阅读(528) 评论(0) 推荐(0)

order_by 函数 R
摘要:order_by(order_by,call) 函数 更灵活的排序 This function makes it possible to control the ordering of window functions in R that don't have a specific ordering 阅读全文

posted @ 2022-05-09 17:42 BioinformaticsMaster 阅读(221) 评论(0) 推荐(0)

R 条件判断和循环
摘要:基本语句 判断: if(Condition1){ State1 }else if(Condition2){ State2} else { State_last } 循环 for ( i in xx){ yy} while (xx){yy} 嵌套 for ( i in xx) { if (i yy){ 阅读全文

posted @ 2022-05-01 20:22 BioinformaticsMaster 阅读(110) 评论(0) 推荐(0)

Rscript 给脚本内传递参数
摘要:最直接的方式是args<-commandArgs(trailingOnly = TRUE) ,对应args[1],args[2] 如:cat test.R #脚本内容如下 args<-commandArgs(trailingOnly = TRUE)print(args)print (args[1]) 阅读全文

posted @ 2022-05-01 19:42 BioinformaticsMaster 阅读(273) 评论(0) 推荐(0)

R 自定义函数
摘要:函数调用 R 所有函数的调用格式为 function(argument1=value1, argument2=value2,...) 如t.test(x=sample,mu=4.5) 对于二元计算 a %x% b 等价于 "x"(a,b) 如 > "+"(2,3) [1] 5 从function( 阅读全文

posted @ 2022-05-01 17:29 BioinformaticsMaster 阅读(443) 评论(0) 推荐(0)

肾病质控下机数据的脚本
摘要:library("tidyverse") library(ggplot2) library(ggpubr) data <- read_tsv("./rawDataStat20220215141517.txt") #fq qc dataPlot<-data %>% select("TotalBases 阅读全文

posted @ 2022-04-14 11:03 BioinformaticsMaster 阅读(34) 评论(0) 推荐(0)

rawdata0413<-read.csv("./rawDataStat20220413151324.txt",sep = "\t") 不等于read.tsv
摘要:文件内有%,rawdata0413<-read.csv("./rawDataStat20220413151324.txt",sep = "\t")识别错误 rawdata0413<-read.csv("./rawDataStat20220413151324.txt",sep = "\t") 里边的% 阅读全文

posted @ 2022-04-13 17:42 BioinformaticsMaster 阅读(28) 评论(0) 推荐(0)

Standard Deviation (SD), Standard Error (SE),Confidence Interval (CI). 画barplot,置信区间
摘要:Standard Deviation(SD) 标准(偏)差,代表变量的分散程度,离散量。统计为方差的平方根(Calculated as the root square of the variance) sd<-sd(vec) 等同于 sd<-sqrt(var(vec)) Standard Error 阅读全文

posted @ 2022-03-25 16:09 BioinformaticsMaster 阅读(560) 评论(0) 推荐(0)

ROC R脚本
摘要:AUC ROC ROC: receivers operating characteristic curve,是一种坐标图式的分析工具,是一个二元分类模型(0/1),输出结果只有两种类别的模型。如阳性/阴性,有病/没病,垃圾邮件/非垃圾邮件。 预测错误:针对正样本而言,即预测是正样本,但预测错了FP 阅读全文

posted @ 2022-03-12 19:32 BioinformaticsMaster 阅读(319) 评论(0) 推荐(0)

qplot(quick plot) 快速作图,能读懂就行,推荐用ggplot2适用于各种复杂图 分面 ~.
摘要:qplot( x, y, ..., data, facets = NULL, margins = FALSE, geom = "auto", xlim = c(NA, NA), ylim = c(NA, NA), log = "", main = NULL, xlab = NULL, ylab = 阅读全文

posted @ 2022-03-02 20:38 BioinformaticsMaster 阅读(304) 评论(0) 推荐(0)

ggplot2 分面 fact_grid() facet_wrap()
摘要:> facet_grid() 可以应用多个标准对数据分组。 如qplot(carat,price,data=diamonds,alpha=I(0.2))+facet_grid(color~cut) 这里 color~cut 波浪号~ 前是分行依据 波浪号~ 后是分列依据 相比facet_wrap,f 阅读全文

posted @ 2022-03-02 15:35 BioinformaticsMaster 阅读(937) 评论(0) 推荐(0)

ggplot2 注释文本到图所展示的数据上
摘要:best_in_class <-mpg %>% group_by(class) %>%filter(row_number(desc(hwy))==1) #取每组hwy 最大的那行观测赋值给best_in_class ggplot(mpg,aes(displ,hwy))+geom_point(aes( 阅读全文

posted @ 2022-02-26 22:09 BioinformaticsMaster 阅读(372) 评论(0) 推荐(0)

R glimpse比较全的查看列,但看不到rownames
摘要:R glimpse比较全的查看列,但看不到rownames。 rownames 可以通过View() 或head() 如glimpse(mtcars) View(mtcars) rownames(mtcars) head(mtcars) 阅读全文

posted @ 2022-02-26 16:13 BioinformaticsMaster 阅读(88) 评论(0) 推荐(0)

lm() 拟合线性模型linear module
摘要:lm() 拟合线性模型linear module ,用来进行回归、single stratum方差分析,协方差分析 lm(formula,data,subset,weights,na.action,【other args】) lm(y ~ x,data) 这样是最常见设置的参数 如lm(formul 阅读全文

posted @ 2022-02-25 13:00 BioinformaticsMaster 阅读(1062) 评论(0) 推荐(0)

导航