Monday, February 4, 2013

NLS (nonlinear least square)

summary()->output

Formula: val ~ exp(-k * time)

Parameters:
   Estimate Std. Error t value Pr(>|t|)    
k 4.456e-03  3.398e-05   131.2 9.77e-07 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 

Residual standard error: 0.003644 on 3 degrees of freedom

Number of iterations to convergence: 4 
Achieved convergence tolerance: 3.743e-06 



Using T-Tables
We have learned the following things about a t-test:
  • The t-test produces a single value, t, which grows larger as the difference between the means of two samples grows larger;
  • t does not cover a fixed range such as 0 to 1 like probabilities do;
  • You can convert a t-value into a probability, called a p-value;
  • The p-value is always between 0 and 1 and it tells you the probability of the difference in your data being due to sampling error;
  • The p-value should be lower than a chosen significance level (0.05 for example) before you can reject your null hypothesis.

Thursday, January 31, 2013

Plot dots + functions with R

library("ggplot2")
eq<-function(x){x*x}
tmp<-data.frame(x=data[,4],y=eq(data[,5]))

p<-qplot(x,y,data=tmp)
c<-stat_function(fun=eq)
print(p+c)

or

qplot(x, y, data=as.data.frame(curve(eq)), geom="line")

Wednesday, January 30, 2013

How to build bowtie2 index from genome

1. Download genome sequences (*fa) from NCBI;

2. cat *.fa > genome.fa

3. bowtie2-build genome.fa hg19 ##mm9 bm3

4. cp *.bt2 to bowtie2 index folder