blog.shenwei.me
Python note · Wei Shen's Note
http://blog.shenwei.me/python-note
11 Nov, 2014. Middot; Read in about 3 min · (454 Words). I plan to use Python as one of my main programming language for its huge numbers of libraries. With plugin Python PEP8 Autoformat. Datasetdefault('names', []).append('Ruby'). Dataget('foo', 0) # not data['foo']. 3*x for x in vec if x 3] # [(x, x* 2) for x in vec]. Iterate for x, y in data.iteritems():. Iterate through two sequences same time. For x, y in zip(a, b):. Sisalpha() # s.isdigit(). Ssplit -.join(GNU/Linux is great.split ). While 1 faster ...
blog.shenwei.me
Install Python applications on Linux · Wei Shen's Note
http://blog.shenwei.me/install-python-applications-on-linux
Install Python applications on Linux. 29 Oct, 2014. Middot; Read in about 1 min · (173 Words). Python is very popular. A lot of bioinformatics softwares are written in Python, so we have to learn how to install Python applications, particularly when you have no ROOT privilege. So we can easily install python modules. Wget https:/ bootstrap.pypa.io/get-pip.py python get-pip.py. Wget https:/ bootstrap.pypa.io/get-pip.py python get-pip.py. Example: to install pprospector. Python setup.py install - insta...
blog.shenwei.me
Lost my code by “mving” executables to source file! · Wei Shen's Note
http://blog.shenwei.me/lost-my-code-by-mving-executables-to-source-file
Lost my code by mving executables to source file! 27 Sep, 2014. Middot; Read in about 1 min · (81 Words). Like the title said, I lost my code, which costed more than half of a day. All possible rescue solutions failed:. Used, which rewrited the source file. It’s incurable. I supposed to upload the code to Github right after this rename operation, but I didn’t. Dropbox syncing was paused. No backup, even deleted old version in the trash. Text editor was closed. If not it will store the code in RAM.
blog.shenwei.me
R note · Wei Shen's Note
http://blog.shenwei.me/r-note
17 Jul, 2015. Middot; Read in about 10 min · (2049 Words). My R learning note. R max mem size =1Gb. 逻辑(logical) 逻辑向量( TRUE=T、 FALSE=F). 1 e10 = 10000000000. Groups - unlist(strsplit(args$groups, ,). Library(stringr) s - A 123 B found - str match(s, A(. )B) found [,1] [,2] [1,] A 123 B 123 found[,2] [1] 123 # str match all() to match all groups in a regex. Replace text in data frame. Data$genome - NULL # single column Data[1:2] - list(NULL) # remove multiple columns Data[1:2] - NULL # does not work! Speed...
blog.shenwei.me
Python multiprocessing.Pool: Difference between map, apply, map_async, apply_async · Wei Shen's Note
http://blog.shenwei.me/python-multiprocessing-pool-difference-between-map-apply-map_async-apply_async
Python multiprocessing.Pool: Difference between map, apply, map async, apply async. 3 Aug, 2015. Middot; Read in about 1 min · (161 Words). Is cool to do parallel jobs in Python. But some tutorials only take. For example, in which they used special cases of function accepting single argument. There are four choices to mapping jobs to process. Here are the differences:. Multi-args Concurrence Blocking Ordered-results map no yes yes yes apply yes no yes no map async no yes no yes apply async yes yes no no.
blog.shenwei.me
用Linux Live CD拯救无法启动的电脑中的数据,以及安装系统总结 · Wei Shen's Note
http://blog.shenwei.me/save-data-in-unbootable-computer
21 Jan, 2014. Middot; Read in about 1 min · (47 Words). 如果电脑无法进入操作系统 Windows, Linux,Mac OS X均适用 ,可以用Linux Live CD拯救硬盘中珍贵的数据。 为什么要用Linux的Live CD呢,因为Linux系统能够兼容更多的磁盘格式,而windows系统盘里的Win PE只认fat, ntfs等 而Mac OS X的系统盘似乎没有Live功能。 用fedora scientific kde live cd启动后,成功拷贝出硬盘中的数据。 最终还是用ubuntu 13.10 live cd进入后,原磁盘中个人目录下的自目录无法访问,命令行下使用root用户进入后用拷贝命令cp成功拷出所有数据。
blog.shenwei.me
Linux无root权限用CPAN安装Perl模块 · Wei Shen's Note
http://blog.shenwei.me/install-perl-module-without-root-privileges
14 Apr, 2014. Middot; Read in about 1 min · (40 Words).
blog.shenwei.me
GNU Parallel Note · Wei Shen's Note
http://blog.shenwei.me/gnu-parallel-note
4 Aug, 2015. Middot; Read in about 2 min · (406 Words). Is a shell tool for executing jobs in parallel using one or more computers. If you use xargs and tee today you will find GNU. Very easy to use as GNU. Is written to have the same options as xargs. If you write loops in shell, you will find GNU. May be able to replace most of the loops and make them run faster by running several jobs in parallel. As input for other programs. Parallel echo {} ; cat {} : : *.txt. Reading arguments from stdin and run.
blog.shenwei.me
Linux系统中NCBI BLAST+本地化教程 · Wei Shen's Note
http://blog.shenwei.me/local-blast-installation
6 Apr, 2014. Middot; Read in about 2 min · (302 Words). 请不要因为篇幅长,而觉得很困难,只是为了初学者能懂,叙述比较详 luo 细 suo 而已. Mdash;—————-[ 做好心理准备,开始了]——————-. 在 ftp:/ ftp.ncbi.nlm.nih.gov/blast/executables/blast /LATEST/. 中下载最新的BLAST可执行程序 不要下载源代码`,源码编译非常慢 ,选择预编译版本,如ncbi-blast-2.2.30 -x64-linux.tar.gz。 Wget ftp:/ ftp.ncbi.nlm.nih.gov/blast/executables/blast /LATEST/ncbi-blast-2.2.30 -x64-linux.tar.gz. Tar -zxvf ncbi-blast-2.2.30 -x64-linux.tar.gz. 将BLAST 可执行程序所在目录 bin 的绝对路径加入到环境变量$PATH中,方便通过程序名直接调用。 Mv ncbirc.txt .ncbirc. 下载完成后...
SOCIAL ENGAGEMENT