This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import cv2 #3.0.0-dev | |
import math | |
r1 = 70 | |
r2 = 30 | |
ang = 60 | |
d = 170 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
7万个SNP的hw平横检验MAF的过滤 | |
纯 python ver: | |
pypy 约 20s | |
python 约 25s | |
用 ctypes 调用 c ver: | |
pypy 约 18s | |
python 约 12s <- 比pypy还要好 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding:utf-8 | |
""" | |
构建最大简约法进化系统发育树 | |
使用 sh: | |
python sysevatree data > eva-tree.txt | |
""" | |
import sys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import re | |
id="id" | |
ns="namespace" | |
ia="is-a" | |
nps="node-ptrs" | |
def get_terms_namespaces(go_file): | |
terms={} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
import numpy as np | |
import sys | |
def get_features(gb): | |
context=open(gb,"r").read().split("FEATURES")[1].split("ORIGIN")[0].splitlines() | |
dc={} | |
for line in context: | |
if line[5]==' ': | |
continue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
def putin(name,other,peers): | |
if name in peers.keys(): | |
peers[name].append(other) | |
else: | |
peers[name]=[other] | |
def take_peers(filename,split_sign="\t"): | |
inters=open(filename,'r').read().splitlines() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#coding:UTF-8 | |
#!/usr/bin/python | |
import networkx as nx | |
import matplotlib.pyplot as plt | |
def cancergenes(filename="cancer_gene_census.tsv"): | |
doms,recs=[],[] | |
for line in open(filename,'r').read().split('\r'): | |
cons=line.split("\t") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#coding:utf-8 | |
import sys | |
#处理permutaion的阈值 返回SNPlist | |
def promusnp(mperm,p=0.001): | |
f=open(mperm,"r") | |
res=[] | |
total=[] | |
line=f.readline() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#coding:UTF-8 | |
#!/usr/bin/python | |
#使用方法: | |
#python seqcutloc.py fasta文件 序列 输出文件 | |
#./seqcutloc.py fasta文件 序列 输出文件 | |
#算法是通过将长序列按碱基切开 在拼接回原序列 | |
#eg seq:ATAATCGGCGATTAATCGAAT cut:AAT | |
#切完后得到子序列 AT CGGCGATT CG 长度为2 8 2 |
NewerOlder