随笔分类 -  python

上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 26 下一页
摘要:001、 root@PC1:/home/test# ls a.fastq test.py root@PC1:/home/test# cat a.fastq ## 测试fastq文件 @DJB775P1:248:D0MDGACXX:7:1202:12362:49613 TGCTTACTCTGCGTTG 阅读全文
posted @ 2022-08-15 16:51 小鲨鱼2018 阅读(157) 评论(0) 推荐(0)
摘要:001、 split + join实现 >>> str1 = 'abcdedfg' >>> str1 'abcdedfg' >>> str1.split('d') ## 拆分为列表 ['abc', 'e', 'fg'] >>> "".join(str1.split('d')) ## 组合成字符串 ' 阅读全文
posted @ 2022-08-15 16:44 小鲨鱼2018 阅读(835) 评论(0) 推荐(0)
摘要:001、 root@PC1:/home/test# ls a.fastq test.py root@PC1:/home/test# cat a.fastq ## 测试fastq文件 @DJB775P1:248:D0MDGACXX:7:1202:12362:49613 TGCTTACTCTGCGTTG 阅读全文
posted @ 2022-08-15 16:28 小鲨鱼2018 阅读(460) 评论(0) 推荐(0)
摘要:001、 root@PC1:/home/test# ls a.fastq test.py root@PC1:/home/test# cat a.fastq ## 测试fastq文件 @DJB775P1:248:D0MDGACXX:7:1202:12362:49613 TGCTTACTCTGCGTTG 阅读全文
posted @ 2022-08-15 16:03 小鲨鱼2018 阅读(232) 评论(0) 推荐(0)
摘要:001、 root@PC1:/home/test# ls a.fastq test.py root@PC1:/home/test# cat test.py ## 测试程序 #!/usr/bin/python in_file = open("a.fastq", "r") out_file = open 阅读全文
posted @ 2022-08-15 15:53 小鲨鱼2018 阅读(169) 评论(0) 推荐(0)
摘要:001、 >>> set1 = {"a", "b", "c", "d"} ## 测试集合 >>> set1 {'c', 'a', 'd', 'b'} >>> set1.remove("d") ## 删除集合中的元素 >>> set1 {'c', 'a', 'b'} >>> set1.add(&qu 阅读全文
posted @ 2022-08-15 14:49 小鲨鱼2018 阅读(92) 评论(0) 推荐(0)
摘要:001、 >>> dict1 = {"a":100, "b":200, "c":300, "d":400, "e":500} ## 测试字典 >>> dict1 {'a': 100, 'b': 200, 'c': 300, 'd': 400, 'e': 500} >>> dict1.get("b") 阅读全文
posted @ 2022-08-15 14:37 小鲨鱼2018 阅读(156) 评论(0) 推荐(0)
摘要:001、利用内置函数update实现 >>> dict1 = {"a":100, "b":200} ## 测试字典1 >>> dict1 {'a': 100, 'b': 200} >>> dict2 = {"c":300, "d":400} ## 测试字典2 >>> dict2 {'c': 300, 阅读全文
posted @ 2022-08-15 14:26 小鲨鱼2018 阅读(151) 评论(0) 推荐(0)
摘要:001、 直接利用索引实现 >>> test1 = {"a":100, "b":200, "c":300, "d":400} ## 测试字典 >>> test1 {'a': 100, 'b': 200, 'c': 300, 'd': 400} >>> test1["b"] = 8888 ## 更新字 阅读全文
posted @ 2022-08-15 14:15 小鲨鱼2018 阅读(433) 评论(0) 推荐(0)
摘要:001、利用索引实现 >>> test1 = {"a":100, "b":200, "c":300, "d":400} ## 测试字典 >>> test1 {'a': 100, 'b': 200, 'c': 300, 'd': 400} >>> test1["e"] = 500 ## 直接利用索引实 阅读全文
posted @ 2022-08-15 14:10 小鲨鱼2018 阅读(1384) 评论(0) 推荐(0)
摘要:001、 >>> test1 = ["a", "b", "c", "d", "e", "f", "g"] ## 测试列表 >>> test1 ['a', 'b', 'c', 'd', 'e', 'f', 'g'] >>> test1[2:-2] ## 同时删除首尾的两个字符 ['c&# 阅读全文
posted @ 2022-08-15 13:44 小鲨鱼2018 阅读(53) 评论(0) 推荐(0)
摘要:001、 >>> str1 = "xabdxyabxykk" ## 测试字符串 >>> str1 'xabdxyabxykk' >>> str1.find("ab") ## 返回测试字符串中首次匹配ab的首字符的索引 1 >>> str1.find("ab", 3) ## 指定在字符串中匹配的起始位 阅读全文
posted @ 2022-08-14 17:02 小鲨鱼2018 阅读(84) 评论(0) 推荐(0)
摘要:文章来源:https://www.jianshu.com/p/2475c3240a67 简化的短序列匹配程序 (map.py) 把short.fa中的序列比对到ref.fa, 输出短序列匹配到ref.fa文件中哪些序列的哪些位置。 f1 = r'E:\Bioinformatics\Python\pr 阅读全文
posted @ 2022-08-14 16:54 小鲨鱼2018 阅读(109) 评论(0) 推荐(0)
摘要:001、 >>> test1 = "100 200" ## test1为字符串 >>> test1 '100 200' >>> a,b = test1.split() ## 拆分字符串,直接赋值给变量名 >>> a '100' >>> b '200' >>> test2 = [500, 1000] 阅读全文
posted @ 2022-08-14 16:32 小鲨鱼2018 阅读(495) 评论(0) 推荐(0)
摘要:001、 方法1 root@PC1:/home/test3# ls a.txt test.py root@PC1:/home/test3# cat a.txt ## 测试文件 ACTGCCCTAAGTGCTCCTTCTGGC 2 ATAAGGTGCATCTAGTGCAGATA 25 TGAGGTAG 阅读全文
posted @ 2022-08-14 16:10 小鲨鱼2018 阅读(78) 评论(0) 推荐(0)
摘要:001、方法1 root@PC1:/home/test3# ls test.py root@PC1:/home/test3# cat test.py ## 测试程序 #!/usr/bin/python result = "" str1 = "ACGTACGTACGTCACGTCAGCTAGAC" # 阅读全文
posted @ 2022-08-14 15:30 小鲨鱼2018 阅读(176) 评论(0) 推荐(0)
摘要:001、 root@PC1:/home/test3# ls a.txt test.py root@PC1:/home/test3# cat test.py ## 测试程序 #!/usr/bin/python in_file = open("a.txt", "r") lines = in_file.r 阅读全文
posted @ 2022-08-14 14:53 小鲨鱼2018 阅读(402) 评论(0) 推荐(0)
摘要:001、 >>> "{0}".format("xxx") ## 位置参数 'xxx' >>> "{0}.{1}.{2}".format("xxx", "yyy", "zzz") 'xxx.yyy.zzz' >>> "\t{0}.{1}.{2}".format("xxx", "yyy", "zzz") 阅读全文
posted @ 2022-08-14 14:09 小鲨鱼2018 阅读(46) 评论(0) 推荐(0)
摘要:001、 root@PC1:/home/test3# ls a.map test.py root@PC1:/home/test3# cat a.map ## 测试数据 1 snp1 1 1 snp2 2 1 snp3 3 1 snp4 4 1 snp5 5 1 snp6 6 2 snp7 1 2 s 阅读全文
posted @ 2022-08-13 23:40 小鲨鱼2018 阅读(229) 评论(0) 推荐(0)
摘要:001、 root@PC1:/home/test2# ls a.fasta scaffold.txt test.py root@PC1:/home/test2# cat a.fasta ## 测试fasta文件 >gene2 myc AGCTGCCTAAGC GGCATAGCTAATCG >gene 阅读全文
posted @ 2022-08-13 23:14 小鲨鱼2018 阅读(113) 评论(0) 推荐(0)

上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 26 下一页