科学网

 找回密码
  注册
小的爬虫程序
顾海丰 2016-3-1 00:43
#!/usr/bin/python # coding:utf8 import re import urllib import urllib2 def getHtml(url): html1= urllib.urlopen(url.decode('utf-8')) outhtml = html1.read() return outhtml def getImgList(html): &nb ...
1867 次阅读|没有评论
python 字符串替换
顾海丰 2015-12-15 20:54
Python 替换字符串里的部分内容 例如 NM_66789.4 ,去掉后面的 .4, 只保留前面部分 #!/usr/bin/python f=open('gene_id.txt') f1=f.readlines() new= ) new= myfile=open(2.txt,w) myfile.writelines(new) print new
2029 次阅读|没有评论
python Consensus and Profile
顾海丰 2015-11-24 21:26
A matrix is arectangular table of values divided into rows and columns. An m×n matrixhas m rows and n columns. Given a matrix A, wewrite Ai,j to indicate the value found at the intersection ofrow i and column j. Say that we have a collection of DNA strings , all having thesame length n. Thei ...
3235 次阅读|没有评论
R语言做散点图
顾海丰 2015-11-24 08:57
R 语言做散点图,以 txt 文件里的每两列作比较 setwd(D:/) a=read.table(3.txt,header=TRUE,sep=t) a1=as.data.frame(a) colnames(a1) -c('gene_name','ES_FPKM','IPS_FPKM','MEF_FPKM') a1$ES_FPKM jpeg('1.jpg') plot(a1$ES_FPKM,a1$IPS_FPKM,p ...
3826 次阅读|没有评论
R语言进行T检验
顾海丰 2015-11-22 09:27
用 R 语言进行 T 检验,以两组数据为例 a1=c(1,1,1) a2=c(0.72905715,0.756032,0.700832) t.test(a1,a2,paired=T)
3052 次阅读|没有评论
python Finding a Motif in DNA
顾海丰 2015-11-20 08:51
Finding a Motif in DNA Combing Through the Haystack click to expand Problem Given two strings s and t, t isa substring of s if t iscontained as a contiguous collection of symbols in s (as a result, t mustbe no longer than s). The position of asymbol in a string is the total ...
2817 次阅读|没有评论
python 删除匹配特定字符的行
顾海丰 2015-11-19 16:27
python 删除匹配特定字符的行 #!/usr/bin/python f=open(1.txt,r) f1=open(2.txt,w) f3=f.readlines() for i in f3: if 'E' not in i: f1.write(i)
6544 次阅读|没有评论
python 处理文本
顾海丰 2015-11-19 15:55
Python 处理文件中的数值,比较一行中每一列的大小,以四列文本为基础,输出第一和第二列均小于第三和第四列的行 f=open(foxo3.txt,r) f2=open(1.txt,w) f1=f.readlines() for i in f1: val=i.split() if val val ...
2795 次阅读|没有评论
Translating RNA into Protein
顾海丰 2015-11-9 13:31
Translating RNA into Protein Problem The 20 commonly occurring amino acids areabbreviated by using 20 letters from the English alphabet (all lettersexcept for B, J, O, U, X, and Z). Protein strings areconstructed from these 20 symbols. Henceforth, the term genetic string willin ...
1817 次阅读|没有评论
Counting Point Mutations
顾海丰 2015-11-4 20:54
Counting Point Mutations Evolution as a Sequence of Mistakesclick tocollapse Figure 1. A point mutation in DNA changinga C-G pair to an A-T pair. A mutation is simply a mistake that occursduring the creation or copying of a nucleic acid, in particular DNA. Becausenucle ...
1774 次阅读|没有评论

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-4-27 22:43

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部