fasta2nexus by R script

Workspace loaded from ~/.RData] > setwd("/home/shenzy/work/beast/51samples") > library(seqinr) > data=read.fasta("51strain_core_gene_alignment.aln") > library(ape)  Attaching package: ‘ape’ The following objects are masked from ‘package:seqinr’: as.alignment, consensus[......]

Read more

[…]

Remove grid and background from plot (ggplot2)

Remove grid and background from plot (ggplot2)

HOMECATEGORIESTAGSMY TOOLSABOUTLEAVE MESSAGERSS2013-11-27 | category RStudy  | tag ggplot2 

Generate data

library(ggplot2) a <- seq(1, 20) b <- a^0.25 df <- as.data.frame(cbind(a, b)) 

basic plot

myplot = ggplot(df, aes(x = a, y[......]

Read more

[…]

Size Matters: Metabolic Rate and Longevity (Regression analysis sample)

Size Matters: Metabolic Rate and Longevity

John Tukey once said, “The best thing about being a statistician is that you get to play in everyone’s backyard.” I enthusiastically agree! I frequently enjoy reading and watching science-related material. This invariably raises questions, involving oth[……]

Read more

[…]

数据分析之美:如何进行回归分析

1. 确定自变量与Y是否相关

证明:自变量X1,X2,….XP中至少存在一个自变量与因变量Y相关
For any given value of n(观测数据的数目) and p(自变量X的数目), any statistical software  package can be used to compute the p-value associated with the F-statistic using this distribution. Based on this p-value, we can determine whether or not to reject H0. (用[……]

Read more

[…]

MSstats: an R package for statistical analysis of quantitative mass spectrometry-based proteomic experiments

MSstats: an R package for statistical analysis of quantitative mass spectrometry-based proteomic experiments. […]

R PheWAS: data analysis and plotting tools for phenome-wide association studies in the R environment

R PheWAS: data analysis and plotting tools for phenome-wide association studies in the R environment.

[…]

R pheatmap

> library(caTools); > library(bitops); > library(grid); > data=read.csv(“/home/shenzy/Desktop/R/Bac.heatmap1.csv”) > data=read.csv(“/home/shenzy/Desktop/R/Bac.heatmap1.2.csv”) > View(data) > data=read.csv(“/home/shenzy/Desktop/R/Bac.heatmap1.2.csv”,sep=”\t”) > View(dat[……]

Read more

[…]

参考这个 DATA[is.na(DATA)] <- 0 (把NA换成0)

参考这个 DATA[is.na(DATA)] <- 0 (把NA换成0) 空格在你的dataframe显示为什么? 如果就是空格的话,dat <- as.numeric(data) 能否把空格转换为NA?   有个例子: data.txt内容为: sex,height,weight F,158,51 F,162,55 M, ,72 M,173,57 M,166,64 在R读入时,空白变为NA > x <- read.table(“data.txt”,header=TRUE,sep=”,”) > x s[……]

Read more

[…]

R 列表随意组合 data.frame(x,y)

> protein_data_B30_min<-protein_data[1:2548,10:12] > protein_data_M30_min<-protein_data[1:2548,19:21] > protein_data_30_min<-data.frame(protein_data_B30_min,protein_data_M30_min) > protein_data_30_min[1:2,] B30 B30.1 B30.2 Mgo30 Mgo30.1 Mgo30.2 1 870.5042 867.0873 0 1086.82[......]

Read more

[…]

R画 维恩图

 

> install.packages('plotrix') Installing package(s) into ‘/home/shenzy/R/x86_64-pc-linux-gnu-library/2.15’ (as ‘lib’ is unspecified) 试开URL’http://cran.csiro.au/src/contrib/plotrix_3.4-5.tar.gz' Content type 'application/x-gzip' length 211113 bytes (206 Kb) 打开了URL ==================[......]

Read more

[…]