使用旧版的jquery 1.4.2时,在IE下不响应select的change事件(event),试过很多办法,包括bind(“change click”,…)等等,都没有效果。无意间在使用了.delegate(),意外发现问题得到解决。

在调用$(selector).live(“change”,)前,加入下面的语句:

762166897b5e3414d7316cd8b493daf20[......]

Read more

Tags: , , , ,

admin on 十一月 15th, 2011

安装HTSeq,需要Python版本在2.5以上(但是在Python 3下不行),并且需要安装NumPy。如果已经安装了NumPy的话,安装HTSeq并不困难。但是如果没有安装的话,可能会比较麻烦。

首先,需要安装python 2.5以上的版本。因为centOS 5所带的Python版本是2.4,无法满足HTSeq的安装要求。但是,我并不建议直接升组安装python2.5以上的版本,因为yum等很多功能都由python来实现,所以我的办法是全新安装一个python的版本到一个指定的目录下面去。

下载并安装Python 2.7.2.

[ouj@qiuworld.com ~]$ tar -xzvf Python-2.7.2.tgz
[ouj@qiuworld.com ~]$ cd Python-2.7.2
[ouj@qiuworld.com Python-2.7.2]$ sudo yum install tcl #需要安装tcl/tk库
[ouj@qiuworld.com Python-2.7.2]$ sudo yum install tcl-devel
[ouj@qiuworld.com Python-2.7.2]$ sudo yum install tk
[ouj@qiuworld.com Python-2.7.2]$ sudo yum install tk-devel
[ouj@qiuworld.com Python-2.7.2]$ ./configure --prefix=/opt/python2.7 --with-threads --enable-shared
[ouj@qiuworld.com Python-2.7.2]$ make
[ouj@qiuworld.com Python-2.7.2]$ sudo make install
[ouj@qiuworld.com Python-2.7.2]$ sudo ln -s /opt/python2.7/bin/python /usr/bin/python2.7
[ouj@qiuworld.com Python-2.7.2]$ sudo echo '/opt/python2.7/lib'>> /etc/ld.so.conf.d/opt-python2.7.conf
[ouj@qiuworld.com Python-2.7.2]$ sudo /sbin/ldconfig
[ouj@qiuworld.com Python-2.7.2]$ python2.7
Python 2.7.2 (default, Nov 14 2011, 17:02:46) 
[GCC 4.1.2 20080704 (Red Hat 4.1.2-51)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
  File "", line 1, in 
ImportError: No module named numpy

如果不新建/etc/ld.so.conf.d/opt-python2.7.conf文件并在当中写入一行/opt/python2.7/lib,将会得到如下错误:[......]

Read more

Tags: , ,

admin on 十一月 4th, 2011

本节的目标就是画出如下的图

circos绘制简单的ideogram

基础:circos作业流程

circos流程图

定义:
The symbolic representation of chromosomes are called ideograms.

circos为了能准确地画出染色体示意图,染色体的定义,位置,大小,以及显示的形式都是circos需要考虑的。这些要素需要在数据文件当中定义出来。[......]

Read more

Tags: , , ,

admin on 十一月 2nd, 2011

引子

Circular genome and data visualization with Circos (950 x 234)

闲来无事,翻看CELL杂志,发现很多基因组的图都使用circos来作图,于是就去circos.ca网上看了一眼,发现果然是个基因组研究绘图强大工具,应该为生物信息员掌握。于是花了点时间,来试验它的每一个设置。上网搜索发现,它的中文资料少得可怜,于是将心得体会做一总结,形成这一系列教程。希望能对急于掌握circos又不擅长阅读英语的人有所帮助。--糗世界之糗糗

下载与安装

下载地址:http://circos.ca/software/download/circos/

circos是基于perl的脚本程序。它的安装难度在于安装好perl以及它所需要的模块。对于windows用户,可以试着安装Strawberry Perl或者ActiveState Perl。这两者都是不错的选择。对于Unix/linux/MacOS用户,很可能你已经安装了perl,否则,你可以到http://www.perl.org/get.html去下载安装。

我们需要测试一下perl的环境, UNIX/Linux/MacOS用户

> which perl
/usr/bin/perl
> perl -v
This is perl, v5.10.0 built for ...

Windows用户

> perl -v
This is perl, v5.10.0 built for ...

接着,我们将下载下来的circos程序解压,假设它的目录是circos-x.xx

> cd circos-x.xx
> bin/circos -man

你可能得到一个帮助页面,那么你安装circos已经成功。也可能得到是出错信息。[......]

Read more

Tags: , ,

admin on 十一月 2nd, 2011

本来人们都说要避免使用document.write,因为网页一但加载完毕,它会重开网页,也就是会先生成一个空白页。于是最好使用DOM,然后append啊,html啊之类的。但是我想做的就是打开文件,然后使用document.write来重写整个网页。我的代码是

document.open();
document.write();
document.close();

在firefox[......]

Read more

Tags: , ,

admin on 十一月 1st, 2011

R的输入输出主要有几个类型:文本文件,xls文件,二进制文件,数据库文件,R文件,其它统计软件来源的文件,

首先是最简单的,文本文件,包括csv文件。假设我们有一个文件,题为qiuworld.com.txt,内容为

#this is a sample
ArrayDataFile	SourceName	FactorValue
GSM286765.CEL	t_24h_rep1	treated_24h
GSM286759.CEL	t_12h_rep1	treated_12h
GSM286763.CEL	c_24h_rep2	control_24h
GSM286760.CEL	t_12h_rep2	treated_12h
GSM286757.CEL	c_12h_rep2	control_12h
GSM286766.CEL	t_24h_rep2	treated_24h
GSM286756.CEL	c_12h_rep1	control_12h
GSM286762.CEL	c_24h_rep1	control_24h

我们现在需要把它读入R,可以使用read.table命令。read.table还有几个快捷的形式,比如read.delim,read.delim2,read.csv,read.csv2。这几个快捷的方式帮助我们减少参数的书写。一般的,如果是csv文件,它的分隔符是逗号,字符串的两边会加上引号,可以直接使用read.csv(“文件名”)的方式读入数据。

> read.table("qiuworld.com.txt",header=TRUE,sep="\t",quote="",comment.char="#")
  ArrayDataFile SourceName FactorValue
1 GSM286765.CEL t_24h_rep1 treated_24h
2 GSM286759.CEL t_12h_rep1 treated_12h
3 GSM286763.CEL c_24h_rep2 control_24h
4 GSM286760.CEL t_12h_rep2 treated_12h
5 GSM286757.CEL c_12h_rep2 control_12h
6 GSM286766.CEL t_24h_rep2 treated_24h
7 GSM286756.CEL c_12h_rep1 control_12h
8 GSM286762.CEL c_24h_rep1 control_24h
> read.delim("qiuworld.com.txt",header=TRUE,sep="\t",quote="",comment.char="#")
  ArrayDataFile SourceName FactorValue
1 GSM286765.CEL t_24h_rep1 treated_24h
2 GSM286759.CEL t_12h_rep1 treated_12h
3 GSM286763.CEL c_24h_rep2 control_24h
4 GSM286760.CEL t_12h_rep2 treated_12h
5 GSM286757.CEL c_12h_rep2 control_12h
6 GSM286766.CEL t_24h_rep2 treated_24h
7 GSM286756.CEL c_12h_rep1 control_12h
8 GSM286762.CEL c_24h_rep1 control_24h
> read.csv("qiuworld.com.txt",header=TRUE,sep="\t",quote="",comment.char="#")
  ArrayDataFile SourceName FactorValue
1 GSM286765.CEL t_24h_rep1 treated_24h
2 GSM286759.CEL t_12h_rep1 treated_12h
3 GSM286763.CEL c_24h_rep2 control_24h
4 GSM286760.CEL t_12h_rep2 treated_12h
5 GSM286757.CEL c_12h_rep2 control_12h
6 GSM286766.CEL t_24h_rep2 treated_24h
7 GSM286756.CEL c_12h_rep1 control_12h
8 GSM286762.CEL c_24h_rep1 control_24h

有时候我们只需要读取文件的前几行,那么可以在上面的命令当中加入nrows参数,比如

> read.delim("qiuworld.com.txt",comment.char="#",nrows=5)
  ArrayDataFile SourceName FactorValue
1 GSM286765.CEL t_24h_rep1 treated_24h
2 GSM286759.CEL t_12h_rep1 treated_12h
3 GSM286763.CEL c_24h_rep2 control_24h
4 GSM286760.CEL t_12h_rep2 treated_12h
5 GSM286757.CEL c_12h_rep2 control_12h

[......]

Read more

Tags: , ,