| 分类: Python |
标签:
多层网络 |
分类: Python |
pymnet是python画多层网络图的一个模块。
pymnet模块主页:
http://mkivela.com/pymnet/index.html
http://mkivela.com/pymnet/tutorial.html
第一作者主页:http://www.mkivela.com/
文章:
https://academic.oup.com/comnet/article/2/3/203/2841130/Multilayer-networks
安装:
1. 下载源代码:
官网: https://bitbucket.org/bolozna/multilayer-networks-library/src
GitHub:https://github.com/tak-wah/Epidemic/tree/master/multilayer-networks-library
2. 运行: $ python setup.py install
示例:
http://mkivel
| 分类: Python |
1.
import random
r = lambda: random.randint(0,255)
print('#XXX' % (r(),r(),r()))
2.
import random
color ='#x' % random.randint(0,0xFFFFFF)
3. 生成随机 3字符颜色:
import random
color ='#x' % random.randint(0,0xFFF)
4.
import random
chars = '0123456789ABCDEF'
['#'+''.join(sample(chars,6)) for i in range(N)]
5.
from random import choice
color_sequence = ['#1f77b4', '#aec7e8', '#ff7f0e', '#ffbb78', '#2ca02c', '#98df8a', '#d62728', '#ff9896', '#9467bd', '#c5b0d5', '#
标签:
转载 |
分类: Biology |
| 分类: Ubuntu |
1. [takwah@Tak-Wah 02:59:42 /home/takwah~$] sudo apt-get update
W: Failed to fetch
http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu/dists/trusty/main/binary-i386/Packages
W: Failed to fetch
http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu/dists/trusty/main/i18n/Translation-en
W: Failed to fetch
http://ppa.launchpad.net/wine/wine-builds/ubuntu/dists/trusty/main/binary-amd64/Packages
W: Failed to fetch
http://ppa.launchpad.net/wine/wine-builds/ubuntu/dists/trusty/main/binary-i386/Packages
E: Some index files failed to download. They have been ignored, or old ones used instead.
2. 移除PPA仓库.
[t
| 分类: Python |
由字符TF组成的字符串,如:'TTFTTTFFFFTFFTT'能计算连续相同字符的个数,
eg1
eg2
python 代码:
My example:
| 分类: Python |
>>> list1
= ['a','b','c']
>>> list2
= ['d','b','c','a']
>>>
set(list1).issubset(set(list2))
True
| 分类: Shell |
#!/bin/bash
cat SNP.txt | while read line;do
grep --color=auto '$line' AllChr.impute.vcf >> signSNPs.vcf
done
### 根据SNP.txt文件提取到AllChr.impute.vcf文件中含有其内容的行。
例如SNP.txt文件中chr16:53570243出现在AllChr.impute.vcf文件中行内容被写入signSNPs.vcf文件中。
| 分类: Shell |
1、Linux里切割大文件的命令如下:
split
选项如下:
-a :
-b
-d
-l
2、比如我想让后缀长度为 2,即 -a 2。用数字后缀 -d。每个文件 10M,即 -b 10m。命令可以设计如下:
split
会在 /root 文件夹下生成下面的切割文件:
NewFiles.log00
NewFiles.log01
NewFiles.log02
......
然而,得到的文件名称并不令我满意,我的目标是:NewFiles_
| 分类: Biology |
Haploview需要导入数据的格式(linkage格式)
Haploview的第一个主界面的linkage格式需要输入两个文件,点击左侧的Linkage
Fofmat就会看到有两个导入文件的地方,一个是Data
File,另一个是Locus Information
File。下面详细的介绍一下这两个数据的格式,我们以Haploview自带的数据文件为例。在haploview安装的目录下(一般为C:\Program
Files\HaploView)有两个数据文件:(1)sample.ped
(2)sample.info。