随笔分类 -  python

摘要:python3 configure参数: ./configure --prefix=/yourpath/python-3.10.12/ \ --enable-loadable-sqlite-extensions \ --enable-optimizations make -j16 make inst 阅读全文
posted @ 2024-12-12 14:07 天使不设防 阅读(8) 评论(0) 推荐(0) 编辑
摘要:在目录 C:\Users\用户名\AppData\Roaming下新建目录 pip,并在pip目录中新建文件pip.ini,文件内容为: ``` [global] index-url = https://pypi.tuna.tsinghua.edu.cn/simple ``` 速度起飞…… 阅读全文
posted @ 2023-07-17 16:34 天使不设防 阅读(81) 评论(0) 推荐(0) 编辑
摘要:最近在学习snakemake 用于生信流程管理,现在用一个snakemake 来完成小任务:将在某一文件夹下的多个bam文件截取一部分,然后建立索引,在提取出fastq序列,最后比对回基因组。 需要两个文件,一个配置文件config.yaml和snakemake文件。 config.yaml 文件内 阅读全文
posted @ 2021-09-27 16:53 天使不设防 阅读(214) 评论(0) 推荐(0) 编辑
摘要:基本思路是,将key对应的value设置为list,将对应的值append进去。 示例: f=open("a1.txt") ha={} for i in f: i=i.strip().split() print(i[0],i[1]) for k in i[1:]: ha.setdefault(i[0 阅读全文
posted @ 2021-09-06 21:13 天使不设防 阅读(2183) 评论(0) 推荐(0) 编辑
摘要:perl : while(defined(my f1=<FQ1>) && defined(myf2=<FQ2>)){ condition } python3 : for line1,line2 in zip(fileHandle1,fileHandle2): condition 阅读全文
posted @ 2020-09-28 16:54 天使不设防 阅读(135) 评论(0) 推荐(0) 编辑
摘要:今天有个统计需求,需要对应的元素的列求和,文件示例如下: 1 ID1 0 2 7 2 ID2 1 5 6 3 ID3 2 2 6 4 ID4 1 6 0 5 ID2 3 8 3 6 ID2 0 8 3 7 ID4 2 2 9 8 ID2 3 7 7 9 ID1 1 5 3 10 ID2 2 3 7 阅读全文
posted @ 2019-11-25 22:09 天使不设防 阅读(1914) 评论(0) 推荐(0) 编辑
摘要:有个瑕疵,某一块儿比例过小时,文字会重叠。 1 def pizza(data,labs,title): 2 import matplotlib 3 import matplotlib.pyplot as plt 4 cols=[col for col in matplotlib.colors.TAB 阅读全文
posted @ 2019-11-23 14:47 天使不设防 阅读(203) 评论(0) 推荐(0) 编辑
摘要:查了下资料,常见两种办法,一是设置行号,再者是利用python自带的itertools工具。 这里推荐一种新的方法,直接使用readline()函数就搞定。 示例: 创建一个文本文件,内容如下: 1 第1行 ID1 2 第2行 ID2 3 第3行 ID3 4 第4行 ID4 5 第5行 ID5 6 阅读全文
posted @ 2019-11-22 10:46 天使不设防 阅读(10844) 评论(0) 推荐(1) 编辑

点击右上角即可分享
微信分享提示