Dawei Huang | Pieces

Assemble your Jigsaw.

Mid autumn day is over.

20110913-074057.jpg

利雅得的中秋比北京或是承德结束的晚5个小时。没有月饼,没有出去吃饭,只是比平时多做了一个菜,洗刷完,跑到实验室。晚上回住处睡觉的时候,看到头顶的月亮才想起,今年今日,也就它依旧是往年的它。在国内它被包裹上多少碎碎念,而在这个沙漠中的城市,这个灯火辉煌的孤岛,圆满的它的光也不觉得比往日明亮多少。

早上起来依旧是看google reader里的rss,看fah的进展,写程序,看文章,今日的碎碎念并不比往日多。如果在家里,也许也是安静地陪父母去山上看看月亮,吃几块父母留下的月饼。不过今年的任务要到过年的时候完成了。

大学的时候,每到中秋,总是会感觉到孤独;看到离家近的同学都纷纷回家团聚,而自己因为离家远只能独自在外,心里总是有点不是滋味。记得那个时候是要买点比平时好的食物来弥补一下心情的。现在想想,用升高的血糖来改善情绪,虽然可笑,但却真是有效的方法。我们永远也无法回避的就是我们骨子里的动物性啊。

来到利雅得快9个月了。没有风沙的日子,月亮也是格外的清晰,甚至上面的海和环形山都清晰可辨。要是中秋一定要赏月的话,利雅得可是比北京好太多的赏月地点呢。不过这里的月亮也不会比故乡的更圆。我们总是不由自主地进入一个情境,为了一片风景而暗自神伤。如果真的享受这种过程,尝试一下也无妨,沉浸其中就太没必要了。

如果是在国内又如何呢?估计也是各回各家吧。其实过节还不如平时周末的朋友小聚欢乐多。每一代人都有各自的生活,回家团聚与其说是心理的需要,更不如说是一种责任,一种让自己感觉温暖的牵挂。现在朋友们工作的工作,飞往海外的也离开一个多月了。及时此时我身在北京,也许除了踏上回乡的旅途也就是在街头信步乱走了。

前几天看“乱象 印记”里的一篇帖子,其中的一个观点我很赞同:每到一个新的城市要迅速找到自己的坐标,这样一直又固定的方向,旧时的朋友不会忘记你,而你也容易找到新的朋友。而眼前的这个中秋,我对自己的坐标还是不甚明确,但心是坚定的;而远方的朋友们,也许都在低着头,努力寻找自己的坐标吧。于是在这里,这个简陋的博客里,码字也就成了一件有意义的事情了。

今天开始抄How to solve it。好记性不如烂笔头是经验之谈,肌肉记忆的辅助作用是科学常识。如果中秋真是个特别的日子,那么今天也算收获了个新的习惯。

Happy Mid Autumn Day!

此幻灯片需要JavaScript支持。

How to use BLAT to annotate a new sequenced genome

//My first post here.
I am in charge of Date Palm genome annotation recently. In fact, there is only one person doing this, me.
UCSC and Ensembl are the most famous genome sequence databases and both developed effective tool, BLAT from UCSC and pMatch from Ensembl, to do this.
pMatch need input of protein sequence. So it is suitable for use rich datasets to annotate a similar species’ genome without lots of sequence proteins.
BLAT is good at cDNA to genome alignment. So we choose BLAT because we got Newbler assembled cDNA sequence from 454.

The Data Palm Genome sequence assembly based on two data source, the 454 newbler assembled contig and solid mate pair reads.
Newbler assemble the 454 data of genome to contigs which provide the main structure of genome assembly.
Solid mate pair data provide the information of relationship between contigs, including order, gap length, etc.

454 can not provide sequence strand information. After assembly, the cDNA can be sense strand or anti-sense strand. Since both of the genome strand have the ability to encode genes as we defined as positive strand gene and negative strand gene, the BLAT mapping data can provide 4 kinds of mapping results due to the complexity discussed before.

So the first step of annotation is to convert the anti-sense cDNA to sense strand sequence, the the mapping results will remain only two types, the positive strand gene and negative strand gene.

There are several source of the strand information, splice signal, transcriptome data form solid strand specific experiment, CDS prediction data and alignment-based annotation of cDNA.

Splice signal is the first 2 and last two base of intron sequence. cDNA is sequenced from mRNA which only consist exons of gene. When mapped back to genome, the alignment region of cDNA will consist multiple alignment blocks. Blocks of cDNA sequence are usually continuous whereas blocks of genome is separated by unaligned sequence blocks, usually introns.

如何用IOS来阅读和保存生词卡片

//原文发表于2011-01-30 15:07,人人网.
iphone is perfect device for reading, especially for second language reading. But a lot of people complain about it shortage in extract word instantly by touch. There are many apps can do this, for example:

good apps
1.kindle from amazon
2.iBooks from apple
3.instapaper from instapaper
Then the question will be how to put the material u want to read into these apps.
First, we have a look at instapaper.
The design of the app is elegant. It is combine with net service. U store any material u like when browsing net. Just click the “read later” link to store it into instapaper.

read later link in ur bookmark bar

it shows “saving”

It is similar to google’s reader service. U can create folders and drag the folder’s own “read later” link to ur book mark bar for convenient. Although the instapaper cost 4.99 usd, I think it worth. But the dictionary integrate in it sucks for its short explanation copying from wikipedia. So this app is great for first language reader. But without a profession dictionary, it’s not so good for english learner.

Second one, we turn to iBooks.
This app is great. A lot of people become apple user for ipad and they bought it mostly for this app. The animation of flipping page is beautiful and the integrated dictionary is good, but not good enough for iphone and ipod touch user. As their screen size, apple didn’t design it to show the explanation and the context in one page. So when u save a screen shot as a vocabulary card, it’ll only contain the dictionary page. So difficult to remember what material u r reading by the card. But the good thing is u can transfer any materials through itunes and epub books can be edit and export from page, a software in apple’s iWork package. So with the high quality dictionary in it, u can make good vocabulary card by screen shot.
But better cards are form kindle screen shot. Without a transfer organize software like itunes, Kindle is not convenient as iBooks for reading ur personal material. But this is changed when instapaper and Kindle hooked up. Here is how I use them.
U can store any material into instapaper using its web service, it’s complete free. Then open the its main page in safari on ur iphone or ipod touch, click the ebook format u want in the download tool box.


instapaper web service

Choose ePub if prefer iBooks, but I’l use kindle. When a new page it open, instapaper will ask u whether u want to open it in “Kindle”.

download ebook in safari on ios device

Click it will launch kindle automatically. Then enjoy ur reading, ur dictionary and ur voc cards.

For iBook, the process is same. Just click the ePub button.
That’s all. Enjoy ur reading!

open instapaper ebook in kindle

OpenCL on OS X 之一:配置开发环境

//原文发表于2011-08-12 15:14 人人网。

学习之前的准备工作有很多可以做。

除了各种网上可以下的电子书,开发必修的文档,各种帖子,博客(短暂而密集的收集,之后是长期零散的收集~~~)之外,做有用的就是sample程序了。

除了apple官方的,网上牛人写的例子也很多。不过由于OpenCL还在发育阶段,所以版本的新老也是个问题。

收集之后,就是 如何 运行起来并学习了。

因为用的是mac,而且OpenCL原本是Apple牵头提出,此外,OS X下的利用cl技术的商业化软件也很多(可到app store内搜索),于是要学习Xcode。

曾经学习过,还是在iphone SDK出来之前。问题是IO S SDK出来之后,Xcode更新得越来越频繁,界面上都面目全非了。而update成瘾应该是很多MacHead的通病。于是摸索了一下,于是就有了我的第一个程序。

流程:(由于Xcode的语言为英文,所以以下流程使用英文更方便按葫芦画瓢)

1. Xcode: 通过launchpad或/Developer/Applications找到xcode,打开。

2. new project->in left pane->Mac os x->application->command line tool->click [next]->key in a name & choose ur preference language(in this case, choose C)->save ur project

3. add OpenCL.framework

这个事xcode4.0之后变化比较大的地方。源头是apple把ios的很多ui风格加入到xcode里,所以要重新熟悉。对于新手可能更容易上手。不过对于广大靠中文帖子入门的同学,可能“新版,想说爱你不容易”。好在有强大的股沟~

in left pane, click ur project->in right pane, click build phases->in link binary with libraries->click [+]->in search window click “opencl.framework”->then it will appeare in ur project, u can drag it into ur “frameworks folder”.

4.key in ur first openCL program.

 这个部分,等手头的项目忙完,在后边后面的帖子里会陆续贴学习笔记,这里只贴一个apple官方的hello_world,代码见本帖结尾,把代码替换soure:main.m文件。

 注意这里的kernel program是写在host program内部的,这个和标准的单独写kernel脚本的习惯不同。

5. compile and run in xcode

just clike run. and the compiled file is in product folder of the left pane.

6. compile and run in linux

由于服务器多使用redhat,而我目前在复习objC,下一帖学习以下在redhat下配置GNUstep,编译openCL的可执行文件。

关于10年前的碎碎念

//原文发表于2011-08-25 18:03,人人网。

师弟回国,留下的机器就被我收了。午饭前查看了一下fah的统计结果,果然两台客户端的跑分效率高了很多,但仍在unactive donor后面缓慢追赶。

吃饭的时候,突然想起师弟说他玩dc已经10年了,不由得让我回想起自己10年前在玩什么电子产品:貌似是考了个前10和母亲大人调价还价不成,说好买的电脑变成了随身听吧(很遗憾后来MD的这种机械模式被时代抛弃了,随之而来的就是sony电子帝国的崩溃。和现在测序仪的发展趋势是如此地相似啊。)。那是刚上高中的时候。

母亲大人给的原因无非是怕影响学习之类的。但没有电脑也不妨碍我在文曲星上写了一大堆程序,虽然是用BASIC,而且大多数都是没什么用处的。那个时候的文曲星上的编程环境,实在是不能再简单了。当时尽然还花时间把老妈的大学basic语言教材翻了一遍。而那一年也正好是apple把nextstep移植到了mac下,发布mac os x的一年…现在回想起来,受那个系统的局限,其实自己在编程方面并没学到什么精髓…

后来大学的时候选修了vb也是高中兴趣的延续,反倒与c失之交臂…

大三的时候买了第一台ipod,慢慢把我的兴趣转移到了mac下面;而开始学objC也是上研究生以后了。而学openCL的缘起也仅仅是apple提出了这个标准吧。

回忆10多年前的高中时代,其实课余的时间还是很多的,但确实没有花多少精力发展个人兴趣。这可能和家里的生活节奏的缓慢不无关系;当时读了好多科普,文艺和生物学理论方面的书,至今对自己思维习惯的影响还是很深。可当时谁也想不到现在我会做生物信息,于是很多当年的选择现在开来就有点戏剧化了。

其实如果要无限扩展回忆的碎碎念,是否应该上溯到老爸调任石家庄的时候呢?恐怕现在我就不会在沙特了吧?神游真是想跑多远就跑多远啊~

老妈说她为我骄傲。可有哪个母亲不觉得自己的儿子好呢?如果这份骄傲是因为我是个少年时代不好好学习,到了青年时代醒悟了之后,知道一切全靠自己打拼的头脑简单的人,其实这也就是个母亲特有的感情而已,在现在这个浮躁的社会,显得很苍白而廉价。

而我能做的,也只能是让孩子们能有更多的选择,不用因为比较而失去机会,不用因为遵从社会主流而放弃自己的兴趣。因为我们希望他们能拥有和其他的孩子不同的生活。试问,又哪对父母不希望呢?

想到这里,不由得又想起yellan和wq的水粉画,老舅家昏黄的灯光还有周老弟那被改造成柜台的书架;还有至今仍在北京一边做蚁族一边考研的高老弟。母亲大人的话又在耳边响起。哎,我们的确是该各自有各自的生活了…

写了一个并行跑BLAT的监控脚本

//原文发表于9月6日,google group: sth. about genomics(本站镜像)。

这个脚本可以自动化BLAT的运行。
提供以下功能:
1,提供打包后的并行运行功能。
2,监控所有节点上进程并在结束后更新log文件
3,通过生成ooc文件加快比对速度
4,所有中间文件被保存。单个任务的错误只学要重新提交单个包即可

适用:
1,主要适用cDNA对基因组注释的提速
2,可以指定包的数量;对于大的任务,可以拆分为更多的小包来提速。
3,通过修改system函数内的命令,可以应用于其他序列比对软件的提速。

使用:
1,必须用nohup命令在login上提交(cluster的管理节点)。
2,使用>符来指定log文件的输出位置。
3,提交后可以关闭console,但必须在log文件输出Done making ooc file.。这个位置的功能尚需要改进。

经过测试,单个基因组水平(使用人,小鼠,水稻测试)的cDNA注释可以在20分钟内完成。
cpuinfo:
Intel(R) Xeon(R)  Processor (Intel64 Harpertown)
=====  Processor composition  =====
Processors(CPUs)  : 8
Packages(sockets) : 2
Cores per package : 4
Threads per core  : 1

memory: 16G

下载地址:下载

游泳归来

//本文发表于2011年08月31日,校内网。博客迁移后转移到此。


从题目看就可以归为碎碎念。不过今天不想只写碎碎念~

来Al Khobar旅游比黄金海岸还要简约,连沙滩游都省了,在宾馆睡睡懒觉,看书,游泳。特别是最后一项,再惬意不过了。要知道这可是在消耗石油来净化海水得沙特~
于是,游泳。三天下来快被晒成黑蛋。热带得8月的日头可不是吹的。
把大学以来学的所有泳姿都复习了以下。总结体会如下:
1,自学一项技能无疑是可以的,但会走很多弯路。我从上小学前就开始学习游泳,一直都游不好。直到上初中后偷师学成蛙泳。而学会自由式,波式蛙泳,仰泳还是大学上游泳课之后。按难度排序如下:自学,偷师,上课,拜师。所以在学习新技能的时候,多看看牛人的技术博客会很有帮助的。不过游泳这种很难用语言描述的技能不在此列。
2,学习技能的过程控制是很重要。其实就是写个监控程序。我不一定了解自己的学习曲线,所以容易在曲线斜率最大的位置放弃。而上课和从师的过程中,会有人对你进行监控,帮助你度过难关。而对过程控制的技能其实也是中学教育,在中国应该是大学教育里重要的环节。很可惜,这点被很多老师忽略了(她们更重视的是知识的传授而不是思维习惯的培养)。相反,很多有自学成功经理的童鞋反倒经验比较多,在进入社会之后的再学习,自我充电的过程中占据优势。
3,学习任何技能都是循序渐进。蛙泳是入门泳姿,接下来学习仰泳,然后是自由泳,最后是蝶泳。这个顺序是按照对身体素质的要求来的。本人自小体弱多病,于是严格按照这个顺序学习。具体来讲,自由泳和蝶泳对腰部力量和肺活量要求尤其高。在上课的时候,老师也要求自由式的腿部打水要符合要求之后才可以学手部姿势。对应到最近看到的一个分享学习数学的帖子,讲从那里落下,就从那里补:高中的知识忘记了,就从高中的时候补。其实总结为一句话,就是基础很重要,学习不能好高骛远。
4,心理障碍是我们永远要克服的。游泳的心理障碍就是对水的恐惧。这个很好理解,因为人不是水生的。从羊水里钻出来之后,对这种能造成窒息的液体的控掘就深埋到潜意识里。而结果就是学习游泳时候的身体紧张,时候是动多的不协调,造成问题如疲劳,呛水,不能按照陆上练习的标准完成水下练习等等。在学习新的技能的时候,心理上的障碍是普遍存在的。关于人的两种状态的理论可以很好的和这个题目对应:人存在学习态和舒适态两种状态。在学习态人要不断更新自己的技能和思想,解决不熟悉的问题;而舒适态是不断熟练技能,解决自己熟悉的问题。很显然,后者是人更舒服的状态――我们都喜欢做自己擅长的事情。任务完成的越漂亮,我们越可以标榜自己的聪明。what a shame~强迫自己一直处于学习态,人才可以不断进步。克服你的心理障碍吧。
5,复习是很重要的。所以这两天好好练习了一下。
6,把你的技术传授给别人是强迫自己不断学习的好方法。原因不言自明,爱学习,勤奋练习的童鞋无处不在(在此表扬一下万飞童鞋)。比你更有天赋而且勤奋的童鞋(在这里表扬一下胜寒童鞋)无处不在。套用吴清源先生的书名,《天外有天》。把自己的技术高速别人除了激励自己,还可以结交志同道合的朋友。何乐而不为。
以上是今天游泳后的体会。
明天回利雅得,又要努力工作了。加油!

Hello world!

Welcome to WordPress.com. After you read this, you should delete and write your own post, with a new title above. Or hit Add New on the left (of the admin dashboard) to start a fresh post.

Here are some suggestions for your first post.

  1. You can find new ideas for what to blog about by reading the Daily Post.
  2. Add PressThis to your browser. It creates a new blog post for you about any interesting  page you read on the web.
  3. Make some changes to this page, and then hit preview on the right. You can always preview any post or edit it before you share it to the world.