今日骑车路线


View State College south bike paths in a larger map

感谢和我同行的三个人,Yong, Ye, Wenying,骑得很爽,最后在Creamary吃冰淇淋聊天也很开心。

可惜木有合影,几张超级糊的sgnv照片在此。(国内被墙,请自行翻墙,看不了不要怪我)

Python module相关

随便写写Python module怎么创建怎么用,详细解释请看 The Python Tutorial -> Modules
顺便推荐下Istvan牛开的Python课程:Practical Data Analysis for Life Scientists

—–

我创建一个python文件,叫做 example.py:

"This module is just an example."

def printHello():
    "This function prints the most famous sentence in programming."
    print "Hello, world!"

然后保存到 “/home/azalea/Desktop”

进入Python shell

#改变当前工作目录到example.py保存的目录,这样暂时你就不用考虑如何把module加入系统路径了:
>>> import os
>>> os.chdir(’/home/azalea/Desktop’)

#导入example.py,此时这个文件就被python认为是个module
>>> import example

#调用在example.py里定义的函数 printHello()
>>> example.printHello()
Hello, world!

#查看module的名字,这里自然就是example了
>>> example.__name__
‘example’

#查看module的文档,显示的就是example.py文件最上面的字符串,称为Docstring,即 documentation string.
>>> example.__doc__
‘This module is just an example.’

#查看module的原始文件的路径,这里就是当前目录下的example.py (因为前面我们把当前工作目录改了, remember? )
>>> example.__file__
‘example.py’

#列出module的所有可用函数
>>> dir(example)
['__builtins__', '__doc__', '__file__', '__name__', '__package__', 'printHello']

#显示example module里的printHello函数的文档,就是printHello函数最前面的字符串,同样也是Docstring。
>>> example.printHello.__doc__
‘This function prints the most famous sentence in programming.’

#查看example module的帮助文件:
>>> help(example)

你看到的就是

Help on module example:

NAME
example - This module is just an example.

FILE
/home/azalea/Desktop/example.py

FUNCTIONS
printHello()
This function prints the most famous sentence in programming.

#本质上,上面的帮助就是格式化的显示了 example.__name__, example.__doc__, example.__file__, …而已

#如果你觉得通过example.printHello()来调用函数很罗嗦,你可以直接导入example module下的函数,语法是 from module import function
#如果你用 from module import * 那么就是一次导入此module下的所有函数:
>>> from example import *

#这样调用函数就简洁了:
>>> printHello()
Hello, world!

#查看函数的文档也是同样:
>>> printHello.__doc__
‘This function prints the most famous sentence in programming.’

#不过这样带来一个问题,就是如果你导入了很多不同的module,而这些module里可能有重名的函数,那么可以这样查看函数属于哪个module:
>>> printHello.__module__
‘example’

#总结,我觉得python的自省功能还是很赞的(自省就是说一个module知道自己从哪里来,自己包含哪些函数,一个函数也知道自己来自哪个module),不知道其他语言有没有,大家留言指教下哈。

God Wrote in Lisp (The Eternal Flame)

今天发现一首关于编程语言的很搞笑的歌,God Wrote in Lisp (又名 The Eternal Flame)

点此欣赏

我觉得歌词写得很好,大意是God只有6天时间创造世界,如果他用C++写,根本啥也写不出。Perl, Fortran, Java, COBOL也out,God是用Lisp创造的世界!

I was taught assembler in my second year of school.
It’s kinda like construction work — with a toothpick for a tool.
So when I made my senior year, I threw my code away,
And learned the way to program that I still prefer today.

Now, some folks on the Internet put their faith in C++.
They swear that it’s so powerful, it’s what God used for us.
And maybe it lets mortals dredge their objects from the C.
But I think that explains why only God can make a tree.

For God wrote in Lisp code
When he filled the leaves with green.
The fractal flowers and recursive roots:
The most lovely hack I’ve seen.
And when I ponder snowflakes, never finding two the same,
I know God likes a language with its own four-letter name.

Now, I’ve used a SUN under Unix, so I’ve seen what C can hold.
I’ve surfed for Perls, found what Fortran’s for,
Got that Java stuff down cold.
Though the chance that I’d write COBOL code
is a SNOBOL’s chance in Hell.
And I basically hate hieroglyphs, so I won’t use APL.

Now, God must know all these languages, and a few I haven’t named.
But the Lord made sure, when each sparrow falls,
that its flesh will be reclaimed.
And the Lord could not count grains of sand with a 32-bit word.
Who knows where we would go to if Lisp weren’t what he preferred?

And God wrote in Lisp code
Every creature great and small.
Don’t search the disk drive for man.c,
When the listing’s on the wall.
And when I watch the lightning
Burn unbelievers to a crisp,
I know God had six days to work,
So he wrote it all in Lisp.

Yes, God had a deadline.
So he wrote it all in Lisp.

这里有歌曲的背景介绍。

The Road Not Taken

看了李开复的我的新公司:创新工场一文,发现我也曾经喜欢这首诗:

Robert Frost (1874–1963). Mountain Interval. 1920.

The Road Not Taken

TWO roads diverged in a yellow wood,
And sorry I could not travel both
And be one traveler, long I stood
And looked down one as far as I could
To where it bent in the undergrowth;

Then took the other, as just as fair,
And having perhaps the better claim,
Because it was grassy and wanted wear;
Though as for that the passing there
Had worn them really about the same,

And both that morning equally lay
In leaves no step had trodden black.
Oh, I kept the first for another day!
Yet knowing how way leads on to way,
I doubted if I should ever come back.

I shall be telling this with a sigh
Somewhere ages and ages hence:
Two roads diverged in a wood, and I—
I took the one less traveled by,
And that has made all the difference.

从无人问津到淘金热–微RNA研究简史

今天师兄Charles推荐了2008年Lasker Basic Medical Research Award得主之一Victor Ambros的一篇文章:

Ambros, V. (2008). The evolution of our thinking about microRNAs Nature Medicine, 14 (10), 1036-1040 DOI: 10.1038/nm1008-1036

题外话一下,Lasker Award是诺贝尔奖的摇篮,50%的Lasker奖得主都获得了诺贝尔奖,可见Ambros有多牛,微RNA有多么重要。

Victor Ambros是微RNA (microRNA) 的发现者之一。微RNA (又译作小分子RNA),是在动物和植物体内广泛存在的大约由20-25个核苷酸组成的单链RNA,现在已知的作用是在转录后调控基因表达。

而在1993年Victor Ambros等人在线虫中首次克隆出第一个微RNA lin-4 之前,我们根本不知道这种小分子的存在。

早在1989年,Victor就发现线虫 ( C. elegans) 中有个基因 lin-4 抑制另一个基因 lin-14,他们知道 lin-14表达一种调控发育的蛋白质,于是他们认为 lin-4 应该也表达一种调控蛋白质,因为基因转录成RNA并翻译成蛋白质是当时认为的公理。1993年,Victor的学生 Rosalind Lee 和 Phonda Feinbaum 克隆出了 lin-4,却发现这个基因非常小,而且这个基因的产物不是蛋白质,而是一个长度只有22个核苷酸的小RNA。它是由单链的RNA分子产生,这个分子的一端折回来形成不完全的互补配对(下图),人称发卡结构,因为长的像发卡嘛,现在我们称之为前体微RNA (pre-miRNA),因为微RNA就是由这个大一点的RNA分子加工产生的(下图中深蓝色或红色的那段)。

lin4

与此同时,Gary Ruvkun(2008年Lasker奖另外一个得主)的实验室发现 lin-14,就是lin-4抑制表达的那个基因的3′端非翻译区 (3′ UTR) 对 lin-4 的功能是很重要的,如果破坏了这段区域,lin-4就不再抑制 lin-14。Gary和Victor继而发现,lin-14 的 3′ UTR 与lin-4是部分互补配对的,于是lin-4可以通过碱基间氢键的作用与 lin-14 结合,进而抑制 lin-14 (下图,注意这里 lin-4的序列要从右往左看)。

lin4target

于是大家欣喜的认为他们发现了一类新的RNA,于是他们就在线虫的近亲里面寻找 lin-4和lin-14的同源基因,结果非常令人失望,他们啥也没找到。于是Victor觉得,也许lin-4的存在仅仅是线虫偶然进化出来的特例。十几年前,生物学家已经有了很好的模型解释基因调控,就是其他基因表达的蛋白质产物是调控因子,他们并不需要微RNA来解释这一切。于是在2000年以前,对微RNA的研究停滞不前。

终于到了2000年,Gary Ruvkun的实验室发现了线虫中的第2个微RNA let-7。和lin-4很相似,let-7长度是21个核苷酸,也是由发卡结构的前体RNA产生,然后与它调控的和发育相关的基因 lin-41 的mRNA部分互补 (下图红色)。

let7

两种不同的微RNA的存在似乎表明,微RNA可能真的在生物界广泛存在。确实,Gary和同事们很快发现,let-7在许多动物物种内都存在,而且序列完全一样。下图是 lin-4 和 let-7 在不同物种间序列的比较。可以看出线虫的 lin-4和其他物种的 lin-4 (由于差异太大,名字都改成别的了,叫 miR-125) 序列间的差异很大(22个核苷酸里有3个不同),而 let-7的序列,从线虫到果蝇到小鼠到人,都是一样的(除了末尾那个)。

lin4let7alignment

于是 Gary和Victor就着手寻找线虫中的其他微RNA。Victor在文章中回忆说,他们天真的以为只有他们在做微RNA的研究,因为这么多年以来,没有其他人对此感兴趣。一次有关线虫的会议上,他听到传言说 David Bartel(偶老板的老板耶) 在克隆线虫的微RNA,也没放心上,只想了下:”Bartel?…他根本不是搞线虫的” (言下之意,这是哪里的无名小卒啊)。

于是Victor和Rosalind不紧不慢的寻找微RNA中,基本上一天就能发现一个新的,他正自我陶醉时,Science杂志让他审阅 Tom Tuschl实验室的一篇投稿。那是2001年8月6日星期一,他“恐怖地”(原文如是说。。)发现,那篇手稿报道了果蝇和人中发现的微RNA!于是他周二一大早向Cell杂志预投递了他们的研究概要,说明他们发现了线虫中更多的微RNA,结果Cell没有向他们投出橄榄枝。于是周二下午,他们询问Science是否可以接收他们的研究。Science的编辑说,没问题,只要你们周五前把手稿提交就行,另外,这位编辑说,David Bartel也投了一篇内容相近的手稿。Victor默念,啊,那个Bartel ! (估计他悔不当初吧) 于是接下来的 60个小时,Victor和Rosalind不眠不休,补实验,写初稿(对的,初稿啊!),终于他们的论文和Tuschl、Bartel的另外两篇文章同时被接受了。不过,Victor写道,所有的审稿人都说,他们的手稿写得实在太烂了!

(如果你没当过烟酒僧这段可能难以理解,不过在科学界,如果你的论文发表在同类研究之后,就不被认为有原创性,影响力就大大降低了)。

ResearchBlogging.org
从此,微RNA的研究一发不可收拾,从无人问津迅速变成了遍地是黄金。科学家陆续发现许多微RNA都存在于多个物种,说明他们的起源很古老。在动物中,微RNA通常可以调控数十个基因,等等等等 (有机会我再专文论述哈)。现在基本上平均每天有一篇关于微RNA的研究论文问世,但是关微RNA仍然有很多未解之谜。比如: 动物中,微RNA通常仅通过6-7个核苷酸与被调控基因作用,但是并不是所有具有与这段序列互补的序列的基因都被调控。那么,还有什么其他因素决定微RNA到底调控哪些基因?

Victor说,也许仍然需要许多年才能解答关于微RNA详细作用机制的问题,但是相信问题的答案将会很有价值。(我补充下,因为现在已知很多微RNA都与癌症的产生有关,于是微RNA的作用机制对理解癌症的机制也会有帮助,也许这也是为什么Victor获得了Lasker基础医学研究奖)。

翻页: 往前翻 1 2 3 4 5 6 ...83 84 85 往后翻