Sunday, January 11, 2015

Calculate RLS for single-gene mutant

I could modify _Survival Analysis Gomp Weib_20140705qin.R to do this. However, I apparently finished this work in "_explore.20140705.R". In this script, I also used SceORF_name.csv to pick up the single-gene mutant.  I did exactly the same thing half a year later.

"ken-RLS-byORF20150111.csv" is the output file. 

Modified "_explore.20140705.R".
rm(list=ls())
setwd("~/projects/0.network.aging.prj/9.ken")

list.files()

tb = read.csv('conditionsWeibRedo_qin.csv') 
tb$genotypeOri = tb$genotype #change 20150111
tb$genotype = toupper( as.character(tb$genotype)) 
tb$media = as.character(tb$media)
str(tb)

tb[grep("ctf", tb$genotype, ignore.case=T), ]


tb2 = read.csv("SceORF_name.csv", header=F, colClass=c("character", "character"))
names(tb2) = c('ORF','name')
length(unique(tb$genotype))

table( tb$genotype %in% tb2$name )
table( tb2$name %in% tb$genotype )

tb$flag = tb$genotype %in% tb2$name
sub = tb[tb$flag, ]
sub$ORF = tb2$ORF[match(sub$genotype, tb2$name)]

length(unique(sub$genotype))
x = table(sub$media)
x[grep("YPD",names(x))]
tb$media[grep("% D", tb$media, ignore.case=T)]

write.csv(sub, "ken-RLS-byORF20150111.csv", row.names=F, quote=F)

x = sub[sub$n>30, ]
hist(log10(x$n)/log10(3))
summary(sub)
tb[tb$n>1000,]



No comments:

Post a Comment