windows 网络配置

windows的网络在使用了很长一段时间,各种VPN,网络代理工具处理后,可能变得情况很复杂,然后就容易联网中断。

现在开始系统梳理一下这个网络问题。

1. netsh winsock reset:【原理待续】

2. 网络连接:重置网络:【原理待续】

 

daily & sophisticated shell built-in commands

1. compgen -b:display all built-in commands (completion of command)

2. type command: determine whether the command is a built-in command

3. pushd/popd: add/remove directories from stack

4. help command: display the help message of the command

R_LANG on MS Windows

1. Suits: R, RTools & Rstudio

2. environment variables:
Modify the variable  BINPREF in the file “/R-3.6.0/etc/x64/Makeconf” to “/path/to/Rtools/mingw_64/bin/” to solve a compiling error.

3. configure R environment:~/.Rprofile, R/R-x.x.x/etc/Rprofile.site

useful git command

1. windows下git对路径名长度存在限制,即使win10系统本身解除了这个限制。

git config –global core.longpaths true

但是没用,仍然报错:fatal: ‘$GIT_DIR’ too big

2.

安装glibc (libc.so.6 GLIBC_)

1. 安装glibc-2.29 (系统:Linux version 2.6.32)

GNU libc requires kernel header files from Linux 3.2.0 or later to be installed before configuring. checking installed Linux kernel header files… missing or too old!

添加&修改windows字体

1.添加字体

将ttf或者otf文件直接复制粘贴到文件夹:C:\Windows\Fonts,系统就会自动安装该字体。然后打开word或者adobe acrobat pro等软件就可以看到新的字体了。

2. 修改字体的名称

  • 使用font creator软件打开字体,然后点击“Font->Properties”;
  • 软件里面显示的字体名称:在identification标签页里面修改“font family”“Full font name”;
  • Font文件夹处的显示:在extended标签页里面修改“typographical family”“typographic subfamily”;

ulimit

1.参数:

-u: 最大进程数

-n: 最大文件句柄数目

2.soft limit vs hard limit

ulimit -S -a view all soft limits

ulimit -H -a view all hard limits

3.

 

 

gcc options

1.-Werror

视警告为错误;出现任何警告即放弃编译.

2.-Wl,-rpath

向ld传递-rpath参数,add a direcory to the runtime library search path. This is used when linking an ELF executable with shared objects. All -rpath arguments are concatenated and passed to the runtime linker, which uses them to locate shared objects at runtime.

3.环境变量

LD_LIBRARY_PATH=”/path/to/lib”, LDFLAGS=”-L/path/to/lib”, C_INCLUDE_PATH=”-I/path/to/include”, CFLAGS, CPPFLAGS

python 单元测试

unittest

https://docs.python.org/2/library/unittest.html

A testcase is created by subclassing unittest.TestCase. The three individual tests are defined with methods whose names start with the letters test. This naming convention informs the test runner about which methods represent tests.

The crux of each test is a call to assertEqual() to check for an expected result; assertTrue() or assertFalse() to verify a condition; or assertRaises() to verify that a specific exception gets raised. These methods are used instead of the assert statement so the test runner can accumulate all test results and produce a report.

The setUp() and tearDown() methods allow you to define instructions that will be executed before and after each test method. They are covered in more detail in the section Organizing test code.

The final block shows a simple way to run the tests. unittest.main() provides a command-line interface to the test script. When run from the command line, the above script produces an output that looks like this:

PCA – 数据降维

原数据,2维:(3,4),(6,8)

新数据,2维:(5,0), (10,0)

最终简化为一维:5, 10

从几何来理解,就是坐标轴的旋转。

这里降维的理由:所有的点实际上都是分布在y=(4/3)X这条斜线上的。

related posts:

1. http://www.iro.umontreal.ca/~pift6080/H09/documents/papers/pca_tutorial.pdf

2. https://stats.stackexchange.com/questions/90331/step-by-step-implementation-of-pca-in-r-using-lindsay-smiths-tutorial

3. http://www.cnblogs.com/pangxiaodong/archive/2011/10/15/2212786.html

 

 

git usage

1. 提交

git add .

git commit -m “your comments about this submission”

git push origin master

2. 同时开发,解决冲突

维护一个稳定的master,每个需要开发一个特征的人,都可以创建一个分支,当完成自己的分支工作后,再merge回master。可以想象的一种情况是,在某个人开发某个软件特性的时候,其他人可能在他之前完成了自己的特性的开发,并且merge回了master。那么可能出现的一种问题是:

如果两个人都对某个文件进行了修改,后提交的人咋办?

这个问题必须后提交的人手动解决这个冲突。如果直接覆盖前一个人的修改,那么可能前一个人的代码就会报错。

另一个问题是:如果后一个人修改了前一个人依赖的一个文件,并且前一个人并没有修改这个文件,那么,本次提交就会成功,本来前一个人可以正常运行的代码,就会报错。同样的,如果后一个人依赖的文件,并且在后一个人的开发过程中没有修改,而前一个人做了修改,那么,后一个人的提交可以通过,但是后一个人本来在本地可以正常运行的代码,提交以后就会报错。

所以,如果一个文件是大家都要依赖的,那么,这类文件的修改,必须由专人负责,并且每次的修改,必须要兼顾到所有依赖它的人。

Good place

1.Stanford Medical School:斯坦福医学院

(http://med.stanford.edu/: logo encrypted)

2.harvard medical school: 哈佛医学院

Purcell lab: in Department of Psychiatry at Brigham & Women’s Hospital, an affiliate of Harvard Medical School.(plink)

3.Division of Statistical Genetics, Department of Human Genetics, University of Pittsburgh: 匹兹堡大学,人类遗传学院,统计遗传所

4.ecole polytechnique federale de lausanne: 洛桑联邦理工学院

5.Stowers Institute for Medical Research: 斯托瓦斯医学研究所

 

eigensoft 7.2.1

1.vcf样例

##fileformat=VCFv4.2
#CHROM  POS     ID      REF     ALT     QUAL    FILTER  INFO    FORMAT  YC1.YC_snp      YC2.YC_snp      YC3.YC_snp      YC4.YC_snp      YC5.YC_snp      ZC1.ZC_snp      ZC2.ZC_snp      ZC3.ZC_snp     ZC4.ZC_snp      ZC5.ZC_snp
1       51      1_51    T       C       51.46   .       AC=1;AF=0.100;AN=10;BaseQRankSum=0.00;ClippingRankSum=0.00;DP=12;ExcessHet=3.0103;FS=0.000;MLEAC=1;MLEAF=0.100;MQ=57.80;MQRankSum=0.00;QD=17.15;ReadPosRankSum=0.00;SOR=1.179;set=GY_snp       GT:AD:DP:GQ:PL  0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37    1/1:1,0:1:3:0,3,37       1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37
1       65      1_65    T       C       51.46   .       AC=1;AF=0.100;AN=10;BaseQRankSum=0.00;ClippingRankSum=0.00;DP=12;ExcessHet=3.0103;FS=0.000;MLEAC=1;MLEAF=0.100;MQ=57.80;MQRankSum=0.00;QD=17.15;ReadPosRankSum=0.00;SOR=1.179;set=GY_snp       GT:AD:DP:GQ:PL  0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37    1/1:1,0:1:3:0,3,37       1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37
1       88      1_88    T       C       88.08   .       AC=3;AF=0.167;AN=18;ClippingRankSum=0.00;DP=25;FS=0.000;set=GY_snp-ZC_snp       GT:AD:DP:GQ:PL  0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37     0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37
1       298     1_298   T       C       224.54  .       AC=9;AF=0.300;AN=30;ClippingRankSum=0.00;DP=75;ExcessHet=4.7712;MLEAC=3;MLEAF=0.300;set=Intersection    GT:AD:DP:GQ:PL  0/0:1,0:1:3:0,3,37     0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37     1/1:1,0:1:3:0,3,37
1       346     1_346   C       T       75.50   .       AC=1;AF=0.100;AN=10;BaseQRankSum=0.00;ClippingRankSum=0.00;DP=30;ExcessHet=3.0103;FS=3.010;MLEAC=1;MLEAF=0.100;MQ=54.16;MQRankSum=-2.515e+00;QD=8.39;ReadPosRankSum=0.431;SOR=1.911;set=YC_snp GT:AD:DP:GQ:PL  0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37    1/1:1,0:1:3:0,3,37       1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37
1       367     1_367   G       A       75.35   .       AC=1;AF=0.100;AN=10;BaseQRankSum=0.431;ClippingRankSum=0.00;DP=28;ExcessHet=3.0103;FS=3.010;MLEAC=1;MLEAF=0.100;MQ=54.16;MQRankSum=-2.515e+00;QD=8.37;ReadPosRankSum=1.18;SOR=1.911;set=YC_snp GT:AD:DP:GQ:PL  0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37    1/1:1,0:1:3:0,3,37       1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37
1       388     1_388   C       T       116.43  .       AC=7;AF=0.233;AN=30;ClippingRankSum=0.00;DP=107;set=Intersection        GT:AD:DP:GQ:PL  0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37    0/0:1,0:1:3:0,3,37       0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37
1       399     1_399   G       C       74.43   .       AC=7;AF=0.233;AN=30;ClippingRankSum=0.00;DP=104;set=Intersection        GT:AD:DP:GQ:PL  0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37    0/0:1,0:1:3:0,3,37       0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37
1       438     1_438   C       T       114.71  .       AC=1;AF=0.100;AN=10;BaseQRankSum=1.25;ClippingRankSum=0.00;DP=31;ExcessHet=3.0103;FS=3.090;MLEAC=1;MLEAF=0.100;MQ=53.60;MQRankSum=-2.965e+00;QD=10.43;ReadPosRankSum=-2.690e-01;SOR=1.981;set=YC_snp   GT:AD:DP:GQ:PL  0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37     1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37
1       466     1_466   C       T       84.64   .       AC=4;AF=0.133;AN=30;ClippingRankSum=0.00;DP=119;set=Intersection        GT:AD:DP:GQ:PL  0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37    0/0:1,0:1:3:0,3,37       0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37

2.genotype

GT:AD:DP:GQ:PL  0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37     1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37
GT:AD:DP:GQ:PL  0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37     1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37
GT:AD:DP:GQ:PL  0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37     1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37
GT:AD:DP:GQ:PL  0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37     1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37
GT:AD:DP:GQ:PL  0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37     1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37
GT:AD:DP:GQ:PL  0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37     1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37
GT:AD:DP:GQ:PL  0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37     1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37
GT:AD:DP:GQ:PL  0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37     1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37
GT:AD:DP:GQ:PL  0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37     1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37
GT:AD:DP:GQ:PL  0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      0/0:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37     1/1:1,0:1:3:0,3,37      1/1:1,0:1:3:0,3,37

3.smartpca 结果

PC1 PC2
eigenvector1 eigenvector2
eigenvalue 9 0
YC1.YC_snp -0.3162 -0.3162
YC2.YC_snp -0.3162 -0.3162
YC3.YC_snp -0.3162 -0.3162
YC4.YC_snp -0.3162 -0.3162
YC5.YC_snp -0.3162 -0.3162
ZC1.ZC_snp 0.3162 0.3162
ZC2.ZC_snp 0.3162 0.3162
ZC3.ZC_snp 0.3162 0.3162
ZC4.ZC_snp 0.3162 0.3162
ZC5.ZC_snp 0.3162 0.3162

4.PCA图

PCA summary

方法:

1. 使用的population scale SNPs

2. EIGENSOFT 4.2

结果解读:

亚洲的野猪和家猪聚类在一起;欧洲的野猪和家猪以及巴克夏猪聚类在一起;非洲的疣猪和四种野生猪聚在一起(另外这四种野生猪是否也是非洲的?);

引文:

2014 – Whole-genome sequencing of Berkshire (European native pig) provides insights into its origin and domestication

BMC genomics – 2017 – Oreochromis niloticus (Nile Tilapia) – sex determination regions

Sex determination regions

The new O_niloticus_UMD1 assembly was used to study sequence differentiation across two sex-determining regions in tilapias. The first region is an XX/XY sex-determination region on LG1 found in many strains of til-apia [9, 34, 44–47]. We previously characterized this region by whole genome Illumina re-sequencing of pooled DNA from males and females [48]. We realigned these sequences to the new O_niloticus_UMD1 assembly and searched for variants that were fixed in the XX female pool and poly-morphic in the XY male pool. Figure 4 shows the FST and the sex-patterned variant alle le frequencies for the XX/XY O. niloticus comparison across the complete Orenil1.1 and O_niloticus_UMD1 assemblies, while Fig. 5 focuses on the highly differentiated ~9Mbp region on LG1 with a substantial number of sex-patterned variants, indicative of a reduction in recombination in a sex determination region that hasexistedforsometime[48].

The second sex comparison is for an ZZ/WZ sex-determination region on LG3 in a strain of O. aureus [11,49]. This region has not previously been characterized using whole genome sequencing. For this comparison we identified variant alleles fixed in the ZZ male pool and polymorphic in the WZ female pool. Figure 6 shows the FST and the sex-patterned variant allele frequencies for this comparison across the whole O_niloticus_UMD1 assembly, while Fig. 7 focuses on the differentiated region on LG3. O. aureus LG3 contains a large ~50Mbp region of differentiated sex-patterned variants, also indicative of a reduction in recombination in the sex determination region. Figure 6 also shows this differentiation pattern on several other LGs (LG7, LG9, LG14, LG16, LG18, LG22 and LG23). It is possible that these smaller regions of sex-patterned differentiation are actually translocations in O.aureus relative to the O. niloticus genome assembly.