Sunday, January 4, 2015

toread, Rpc2p ribosome quality control complex (RQC)

http://www.ncbi.nlm.nih.gov/pubmed/25554787

2015 Jan 2;347(6217):75-8. doi: 10.1126/science.1259724.

Protein synthesis. Rqc2p and 60S ribosomal subunits mediate mRNA-independent elongation of nascent chains.

Ribosomal quality control is related to my translation fidelity project. 



writing in academy,

http://www.theguardian.com/higher-education-network/blog/2013/sep/06/academic-journal-writing-top-tips

1) Have a strategy, make a plan
2) Analyse writing in journals in your field
3) Do an outline and just write
4) Get feedback from start to finish
5) Set specific writing goals and sub-goals
6) Write with others
7) Do a warm up before you write
8) Analyse reviewers' feedback on your submission
9) Be persistent, thick-skinned and resilient
10) Take care of yourself       


http://serialmentor.com/blog/2014/11/16/how-to-prepare-an-article-for-resubmission
 

parse single mutant rows in rls.csv in R

Parse rls.csv in R to pick single-gene mutant rows.

bug on multiple entries of NAME-to-ORF mapping. This seems to be 8 bugs in file "SceORF_name.csv".



It seems that probably four ORFs share the same gene NAMES, probably due to merged annotations.  I need to revisit this annotation problem. 


The for-loop parsing of 50681 rows took about 2.5 hours on Byte, an apple laptop. 


Impressive. There 4101 single-gene RLS measures?! Visual check of ORF seems to confirm this. These covered almost all the essential genes. 

write.csv(tb,"rls_20150103.csv", quote=T, row.names=F )
#Visual check in Excel. All fields seem correct. 

R script is: "_find_LL_20150104.R", pwd ~/0.network.aging.prj/9.ken/

########  "_find_LL_20150104.R"
setwd("~/projects/0.network.aging.prj/9.ken")
rm(list=ls())

list.files(pattern='csv')

#get sce ORF and names
tb.sce = read.csv("SceORF_name.csv",header=F, colClasses = c(rep('character',2)))
str(tb.sce)
names(tb.sce)= c('ORF','NAME')
set_sce_names = unique(c(tb.sce$ORF, tb.sce$NAME)) #this is the dictionary


tb = read.csv("rls.csv", colClasses=c("integer", rep("character",8),
                                      rep("numeric",5), rep("character",8),
                                      rep("numeric",5),'character',
                                      rep('numeric',3), 'character')
              )
str(tb)

tb$setRLS_vs_ref_RLS = tb$set_lifespan_mean / tb$ref_lifespan_mean
hist(tb$setRLS_vs_ref_RLS, br = 30)
summary(tb$ranksum_p)
tb$LL = ifelse( tb$ranksum_p <0.05 & tb$setRLS_vs_ref_RLS>1, 'LL', 'NLL' )
table(tb$LL)

sort( unique(toupper(tb$set_genotype[tb$LL=='LL'])) ) 

# need to pick up single-gene mutants from tb$set_genotype 
tb$ORF = NA; tb$NAME = NA; tb$single_gene_flag = 0;
for( i in 1:length(tb[,1])) { 
#for( i in 1:100) {
  print (paste("i=",i))
  elements = strsplit(  tb$set_genotype[i], '\\s+',)
  current_name = toupper(elements[[1]][1])
  if (( current_name %in% set_sce_names) & (length(elements)==1 )){
    if (current_name %in% tb.sce$NAME) {
      tb$ORF[i] = tb.sce$ORF[tb.sce$NAME == current_name]
      tb$NAME[i] = current_name;
      tb$single_gene_flag[i] = 1;
    } else if (current_name %in% tb.sce$ORF ) {
      tb$NAME[i] = tb.sce$NAME[tb.sce$ORF == current_name]
      tb$ORF[i] = current_name;
      tb$single_gene_flag[i] = 1;  
    } else {
      print ("Excuse me. NAME or ORF seems weird at line 42. tb$single_gene_flag set to -1.")
      tb$single_gene_flag[i] = -1;
    }     
  }
} #run from 12:38- about 3pm. 

save.image("_20150104.RData")
table( tb$single_gene_flag)
length( unique(tb$ORF[tb$single_gene_flag == 1]) )

write.csv(tb,"rls_20150104.csv", quote=T, row.names=F )
######## end of  "_find_LL_20150104.R"














Saturday, January 3, 2015

parse single mutant rows from rls.csv in python

I wrote a python 2.7 script to pick single-gene mutant from set_genotype and output into a new csv file for R analysis.

I used the 'SceORF_name.csv' to generate a dictionary first.
(Python picked up two rows MF(ALPHA)1 and MF(ALPHA)2 without comma. I nano fixed this.)

I then pick set_genotype with a single element that exist in SceORF_name. For R analysis, I output ORF and NAME.

Trouble: 'rls.csv' stores quoted raw lifespan with commas. These quotes disappeared after python parsing and cause confusion in csv format.
Option1: output in tab format. ==> Still have problems.
Option 2: add quotes back to set_lifespans. ==> Seems to works fine in Excel, but not in R. 
(There are 29839 rows in Excel, but R read 35K rows). 
Option 3: convert csv to xlsx and read.xlsx(). ==> not enough memory to run read.xlsx()

11:43pm. Through converting xlsx to csv, I found many extra empty columns in the file. I copy-pasted the 34 columns into a new csv file. This time, load into R show 29838 observations. This is correct.
File 'single_gene_mutants_frm_filerlscsv_20150103.csv' is the output file. (wrong format!)


Python script is parse_rlscsv_20150103.py

20150104: checking in R found wrong values in many columns. Perhaps the best way to parse 'rls.csv' in R directly.

Option 4: remove the set_lifepans









#####################parse_rlscsv_20150103.py
import StringIO
import csv
import re

# parse ORF name pairs
FL1 = open('SceORF_name.csv', 'rb')
Dic = {} # dictionary
reader1 = csv.reader(FL1, dialect='excel', delimiter=',')
for row in reader1:
ORF = row[0]
NAME = row[1]
if ( not ( ORF in Dic.keys() ) ):
Dic[ORF] = ORF
Dic[NAME] = ORF  


outfile = open( 'single_gene_mutants_frm_filerlscsv_20150103.csv', 'w')
header="ORF,NAME,id,experiments,set_name,set_strain,set_background,set_mating_type,set_locus_tag,set_genotype,set_media,set_temperature,set_lifespan_start_count,set_lifespan_count,set_lifespan_mean,set_lifespan_stdev,set_lifespans,ref_name,ref_strain,ref_background,ref_mating_type,ref_locus_tag,ref_genotype,ref_media,ref_temperature,ref_lifespan_start_count,ref_lifespan_count,ref_lifespan_mean,ref_lifespan_stdev,ref_lifespans,percent_change,ranksum_u,ranksum_p,pooled_by\n"
#header = header.replace(',', '\t')
outfile.write(header)

csvfile = open('rls.csv','rb')
reader = csv.reader(csvfile, dialect='excel', delimiter=',')

for row in reader:
elements = re.split('\s+', row[7] )
current_name = elements[0].upper()
if (len(elements) == 1) & (current_name in Dic.keys()):
row[14] = "\"" + row[14] + "\""
row[27] = "\"" + row[27] + "\""
#outfile.write( Dic[current_name]+'\t'+current_name + '\t'+'\t'.join(row)+ '\n')
outfile.write( Dic[current_name]+','+current_name + ','+','.join(row)+ '\n')

outfile.close()

#####################end of parse_rlscsv_20150103.py



compare result table and rls.csv

rls.csv contains 50681 observations of 32 variables

in sqlite3 on rls.db
select max(id) from result
/* this is 50689 */

So, result table in rls.db contains similar entries in rls.csv.

_find_LL_20150103.r

# _find_LL_20150103.r

rm(list=ls())
tb = read.csv("rls.csv", colClasses=c("integer", rep("character",8),
                                      rep("numeric",5), rep("character",8),
                                      rep("numeric",5),'character',
                                      rep('numeric',3), 'character')
              )
str(tb)

tb$setRLS_vs_ref_RLS = tb$set_lifespan_mean / tb$ref_lifespan_mean
hist(tb$setRLS_vs_ref_RLS, br = 30)
summary(tb$ranksum_p)
tb$LL = ifelse( tb$ranksum_p <0.05 & tb$setRLS_vs_ref_RLS>1, 'LL', 'NLL' )
table(tb$LL)

sort( unique(toupper(tb$set_genotype[tb$LL=='LL'])) )

# need to pick up single-gene mutants from tb$set_genotype
tb$single_gene_mutant = 1;
tb$single_gene_mutant[grep( "[\\s|\\/]+", tb$set_genotype)] = 2
table(tb$single_gene_mutant)
summary(tb$single_gene_mutant)

tb.s = tb[tb$single_gene_mutant == 1, ]
#tb.s contains only single element
sort( unique(toupper(tb.s$set_genotype[tb.s$LL=='LL'])) )
head(tb.s)





Friday, January 2, 2015

Eric Raymond’s 17 Unix Rules


http://en.wikipedia.org/wiki/Unix_philosophy#Eric_Raymond.E2.80.99s_17_Unix_Rules


compare He14 with White2010 predictions

In He14Plos Genetics, there are 137 LL genes based on SGD annotations.

C white 2010 used Kaeberlein 564 data set for prediction. In this dataset, I have 113 known long-lived mutants. Comparison with He14Plos, I found 56 of the White10 LL genes are non-LL and only 32 have LL in the He14 data sets.


To do: I need use the ken rls.db to find out the RLS measures.


toread, pittman 2012 genetics for yeast strains on disease detection system


 * read pittman 2012 genetics for yeast strains on disease detection system; ask for strains and 
plasmids, -> GFP stability

github big file limit 57Mb received a warning

github big file limit 57Mb received a warning, but pushed successfully.


toread, G3, yeast cell cycle and birth size paper

He 14, ibuprofen on RLS

He C, Tsuchiyama SK, Nguyen QT, Plyusnina EN, Terrill SR, et al. (2014) Enhanced Longevity by Ibuprofen, Conserved in Multiple Species, Occurs in Yeast through Inhibition of Tryptophan Import. PLoS Genet 10(12): e1004860. doi:10.1371/journal.pgen.1004860

He14 partitioned the yeast genes into LL long-lived and NLL (non LL). This partition can be used to verify my svm project.  There were 137 LL genes and 3840 non-LL genes. 

0.2mM ibuprofen was used for yeast cells (a bit too high?)

Used Giaever's drug screen to identify the tryptophas pathway in ibuprofen effect. 

Did miscropscopic screen on bud sizes and growth. This is an useful data resource.

tb = read.xlsx("journal.pgen.1004860.s010.xlsx", 1)
tb = tb[,1:6]; tb[,1] = as.character(tb[,1])
names(tb)= c("ORF","RLS","BirthSize","MeanSize","G1DNAcontent", "Fitness")

#Birthsize is from
Hoose SA, Rawlings JA, Kelly MM, Leitch MC, Ababneh QO, et al. (2012) A
systematic analysis of cell cycle regulators in yeast reveals that most factors act
independently of cell size to control initiation of division. PLoS Genet 8:
e1002590.

Truong SK, McCormick RF, Polymenis M (2013) Genetic Determinants of Cell
Size at Birth and Their Impact on Cell Cycle Progression in Saccharomyces
cerevisiae. G3 (Bethesda) 3: 1525–1530.

# Fitness is from Giaever2002Nature,
# http://genomics.lbl.gov/YeastFitnessData/websitefiles/cel_index.html

http://www.plosgenetics.org/article/info%3Adoi%2F10.1371%2Fjournal.pgen.1004860
http://news.sciencemag.org/biology/2014/12/ibuprofen-boosts-some-organisms-life-spans



notes on proposed biology educational certificate course sequences


Chemistry and Physics major requirements were cut from 10 courses to 8 courses. Biology major requirement were cut to 7 courses. The main difference is that biology major require 4 chemistry courses and 2 physics courses, but chemistry and physics major do not require biology courses.

The current biology plan lacks the second physics course requirement in the default biology major. 
One option is to use Educational Psychology to replace the social science requirement (currently Adolescent psychology).