Wednesday, April 10, 2013

How to rename files in linux (regular expression)

Here is a very useful link to this question, just need to download their perl script and then use perl regular expression to rename file!!

It's a very good post, and I strongly recommend it!

http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html#perlscript

Friday, February 1, 2013

nucleotide degenercy code

ref: http://www.le.ac.uk/bl/phh4/nucredun.htm

A = Adenine
C = Cytosine
T = Thymine
G = Guanine
U = Uracil
N = A, G, C or T = aNy
R = A or G = puRine (9-ring with 4 N and 5 C)
Y = C or T (also U) = pYrimidine (6-ring with N at positions 1 and 3)
M = A or C = aroMatic
S =  G or C 
W = A or T 
 K = G or T = Keto 
V = A, C or G = Not T (letter after)
D = A, G or T = Not C
H = A, C or T = Not G
B = C, G or T = Not A

Wednesday, January 30, 2013

sample from discrete distribution in R


 Basically use sample function:

refer to this very useful blog:

http://msenux.redwoods.edu/math/R/SampleDiscrete.php

Thursday, November 1, 2012

find a good protocol website!

springer protocols

http://www.springerprotocols.com/BookToc/doi/10.1385/1597450073?uri=/Abstract/doi/10.1385/1-59745-007-3:103

Thursday, September 13, 2012

highlight scripts/codes in blog (just for Blogger)

I searched online, and found a good code-highlighter project called "SyntaxHighlighter"

There's an easy way to do it, just by copying code provided here:
http://www.cyberack.com/2007/07/adding-syntax-highlighter-to-blogger.html

However, this only supports a few brushes (means support highlighting certain type of code).

All the brushes are shown here
http://alexgorbatchev.com/SyntaxHighlighter/manual/brushes/

And all brushes to download plus brushes that are being worked on:
http://www.undermyhat.org/blog/2009/09/list-of-brushes-syntaxhighligher/

However, this does not support R language. Hope it will get better soon!

plot multiple axis in one graph and save in R


The useful blog I found is the following:

plot multiple axis in one graph in R


The basic idea is
1<code>> plot  <-- first plot
2 
3> par(new=T)   <-- tell R to overwrite the first plot
4 
5> plot( ..., axes=F, ... )   <-- plot our second plot, but don't touch the axes
6</code

Also, another trick when plotting a graph first, and then save to file is the following:

plot(...)
dev.copy(svg,"*.svg")
dev.off()

http://statistics.berkeley.edu/classes/s133/saving.html

How to rename files in linux (regular expression)

Here is a very useful link to this question, just need to download their perl script and then use perl regular expression to rename file!! ...