User:Mdwang: Difference between revisions

From OpenWetWare
Jump to navigationJump to search
No edit summary
No edit summary
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Template:Harvard_Biophysics_101:2007}}
<div style="padding: 10px; width: 720px; border: 5px solid #DDDDFF;">
==Profile==
==Profile==
Michael Wang<br>
Michael Wang<br>
Line 7: Line 10:
[http://openwetware.org/wiki/Harvard:Biophysics_101/2007 Biophysics 101], [http://qemp.deas.harvard.edu:8182/students/?courseID=314 Physics 11b], [http://my.harvard.edu/icb/icb.do?keyword=k9936 General Education 187]
[http://openwetware.org/wiki/Harvard:Biophysics_101/2007 Biophysics 101], [http://qemp.deas.harvard.edu:8182/students/?courseID=314 Physics 11b], [http://my.harvard.edu/icb/icb.do?keyword=k9936 General Education 187]


 
==Biophysics 101 Assignments==
==Assignments==
<calendar>
===Feburary 1===
name=Harvard:Biophysics_101/2007/Notebook:Michael_Wang
<pre>
date=2007/03/01
#!/usr/bin/env python
view=fourmonths
from Bio.Seq import translate
format=%name/%year-%month-%day
from Bio import GenBank, Seq
weekstart=0
import sys
</calendar>
 
#user defines which array element to pick
array_position = int(sys.argv[-1])
print "Retrieving entry number ",array_position
 
#Creates a non-parsed library of genes with search terms Xenopus and notch
search_terms = "Xenopus AND notch"
gi_list = GenBank.search_for(search_terms)
print "Searching for", search_terms, "entries"
print gi_list
print "Done searching"
print "Entry ",array_position
ncbi_dict_alpha = GenBank.NCBIDictionary('nucleotide', 'genbank')
 
#prints the raw entry
print ncbi_dict_alpha[gi_list[0]]
 
# We can create a GenBank object that will parse a raw record
# This facilitates extracting specific information from the sequences
record_parser = GenBank.FeatureParser()
 
# NCBIDictionary is an interface to Genbank
ncbi_dict = GenBank.NCBIDictionary('nucleotide', 'genbank', parser = record_parser)
 
# If you pass NCBIDictionary a GenBank id, it will download that record
parsed_record = ncbi_dict[gi_list[0]]
print parsed_record
print "GenBank id:", parsed_record.id
 
# Extract the sequence from the parsed_record
s = parsed_record.seq.tostring()
print "total sequence length:", len(s)
 
#Translating the raw sequence
my_protein = translate(s)
print "translated sequence:", my_protein
 
max_repeat = 9
 
print "multiple T analysis"
print "method 1"
for i in range(max_repeat):
    substr = ''.join(['T' for n in range(i+1)])
    print substr, s.count(substr)
 
print "\nmethod 2"
for i in range(max_repeat):
    substr = ''.join(['T' for n in range(i+1)])
    count = 0
    pos = s.find(substr,0)
    while not pos == -1:
        count = count + 1
        pos = s.find(substr,pos+1)
    print substr, count
</pre>

Latest revision as of 06:20, 3 May 2007

Biophysics 101: Genomics, Computing, and Economics

Home        People        Schedule        Project        Python        Help       

Profile

Michael Wang
Biochemistry
Harvard College 2004-7
Genomics, Public Health, Informatics
Current Classes: Biophysics 101, Physics 11b, General Education 187

Biophysics 101 Assignments

<calendar> name=Harvard:Biophysics_101/2007/Notebook:Michael_Wang date=2007/03/01 view=fourmonths format=%name/%year-%month-%day weekstart=0 </calendar>