[../2006-03]

(->)

2006 / February
Sunday Monday Tuesday Wednesday Thursday Friday Saturday
-1- -2- -3- -4-
-5- -6- -7- -8- -9- -10- -11-
-12- -13- -14- -15- -16- -17- -18-
-19- -20- -21- -22- -23- -24- -25-
BioXP
-->
-->
-->
BioXP
-26- -27- -28-


2006-02-28

final : DNA FASTA file을 입력 받아서 출력으로 peptides의 질량 리스트를 구하라.

표준입출력을 사용하는 명령행 프로그램이어야 한다. 
./est2pmass -option < input.fasta > output.txt
입력은 복수개의 레코드로 이루어진 FASTA format 으로 구성된 DNA 서열파일 
출력은 펩타이드 조각들의 질량 (반올림하여 소수점 두째자리까지 표시) 
>seqnence1 : 1234.12, 2345.34, 3456.45, 4532.20
>sequence2 : 1237.89, 4326.43

   1 def main():
   2     try:
   3         gc = int(sys.argv[2])
   4         re = int(sys.argv[8])
   5     except:
   6         gc = 1
   7         re = 1
   8     g = FastaGenerator(sys.stdin)
   9     for record in g:
  10         dna = DNA.parseFasta(record)
  11         protein = dna.getProtein()
  12         masses = protein.getMassesOfPeptide(re)
  13         title = dna.title.split('|')
  14         sys.stdout.write('>' + title[4] + ' : ' + ', '.join("%.2f"%mass for mass in masses)  +'\n')

총정리 시간


2006-02-27

protease에 의해 잘린 peptide의 mass 측정

   1 def getPeptidesBy(self, kw=1):
   2         peptide = []
   3         RE = self.RestrictionEnzymes[kw]
   4         resite = RE.re
   5         repos = RE.rpos
   6         for aminoacid in self.sequence:
   7             if repos == 'C':
   8                 peptide.append(aminoacid)
   9             if aminoacid in resite:
  10                 if peptide:
  11                     yield ''.join(peptide)
  12                 peptide = []
  13             if repos == 'N':
  14                 peptide.append(aminoacid)
  15         if peptide:
  16             yield ''.join(peptide)
  17 
  18 
  19 def calculateMass(self, peptide):
  20         mass = 0
  21         for aminoacid in peptide:
  22             mass += self.AminoAcidMass[aminoacid]
  23         return mass - 18.02*(len(peptide)-1)
  24 
  25 
  26 def getMassesOfPeptide(self):
  27         masses = []
  28         for peptide in self.peptidelist:
  29             mass = self.calculateMass(peptide)
  30             masses.append(mass)
  31         return masses


2006-02-17

protease로 절단한 부위 리턴하기

   1 def digest(aProtein, ReSites, RsPos='C'):
   2         peptide=[]
   3         for aminoacid in aProtein:
   4                 if RsPos=='C':
   5                         peptide.append(aminoacid)
   6                 if aminoacid in ReSites:
   7                         yield ''.join(peptide)
   8                         peptide = []
   9                 if RsPos=='N':
  10                         peptide.append(aminoacid)
  11         else:
  12                 yield ''.join(peptide)


2006-02-16

오늘은 회사 홈페이지 몇 군데를 수정했다.

포토샵 팁) gif파일 수정하기


2006-02-15

RNA translate

DNA서열로 만든 protein서열을 fasta로 돌려주기

amino acid sequence에서 trysine으로 절단한 부위 리턴하기

   1 def getTrypticDigests(self):
   2         result = []
   3         changelist = self.sequence
   4         for each in changelist:
   5             self.sequence = changelist
   6             Arg = self.sequence.find('R')+1
   7             Lys = self.sequence.find('K')+1
   8             if each == 'R':
   9                 result.append(self.sequence[:Arg])
  10                 changelist = self.sequence[Arg:]
  11             elif each == 'K':
  12                 result.append(self.sequence[:Lys])
  13                 changelist = self.sequence[Lys:]
  14         if changelist != '':
  15             result.append(changelist)
  16         return result

amino acid sequence에서 chymotrypsin으로 절단한 부위 리턴하기


2006-02-14

error 메시지를 자세히 보면서 풀면 잘 해낼 수 있다...

RNA 서열 fasta 포맷 형식으로 출력하기...

상속

새로운 문제

   1 class RNA(NucleicAcid):
   2     def getcDNA(self):
   3         dna = DNA()
   4         dna.title = 'cDNA of ' + self.title
   5         dna.sequence = self.sequence.replace('U', 'T')
   6         return dna


2006-02-13

-1을 제외한 가장 작은 수를 구하는 함수를 만들어서 start codon을 구해서 code 작성.

새로운 문제

   1 def testGetRna(self):
   2     rna = self.dna.getRna()
   3     self.assertEquals('RNA of test', rna.title)
   4     self.assertEquals('AGUC', rna.sequence)

이 테스트 code를 통과하는 함수를 만들어라...


2006-02-10

계속해서 translation code 작성 중... - start codon이 여러개일때 가장 먼저 나오는 start codon을 찾아야 한다.


2006-02-08

translation code 작성


[../2006-03]

(->)


CategoryWebLogYong

parkpro/2006-02 (last edited 2011-08-03 11:00:55 by localhost)