Harvard:Biophysics 101/2007/Notebook:Resmi Charalel/2007-4-19

From OpenWetWare

(Difference between revisions)
Jump to: navigation, search
(New page: ==Issues== *I think I have an appropriate algorithm for deriving keywords and printing some PMIDs. However, I keep getting this weird error message that says my spacing is incorrect and w...)
(Issues)
Line 1: Line 1:
==Issues==
==Issues==
-
*I think I have an appropriate algorithm for deriving keywords and printing some PMIDs.  However, I keep getting this weird error message that says my spacing is incorrect and when I follow the given instructions, I get the same error.  Shawn, could I meet with you about this?
+
*I think I have an appropriate algorithm for deriving keywords and printing some PMIDs.  However, I keep getting this weird error message that says my spacing is incorrect and when I follow the given instructions, I get the same error.  - Somehow this error disappeared. 
 +
 
 +
 
 +
==Program So Far==
 +
<pre>
 +
from Bio import PubMed
 +
from Bio import Medline
 +
import string
 +
 
 +
disease = a.name
 +
 
 +
search_term = "Review[ptyp] "+disease
 +
#print search_term
 +
 
 +
review_ids = PubMed.search_for(search_term)
 +
 
 +
rec_parser = Medline.RecordParser()
 +
medline_dict = PubMed.Dictionary(parser = rec_parser)
 +
 
 +
count = 1
 +
 
 +
for did in review_ids[0:5]:
 +
    cur_record = medline_dict[did]
 +
    print '\n', count, ')  ', string.rstrip(cur_record.title), cur_record.authors, string.strip(cur_record.source)
 +
    count=count+1
 +
 
 +
def extract_allelic_variant_data(str):
 +
        pmid = get_text(v.getElementsByTagName("Mim-reference_pubmedUID")[0].getElementsByTagName("Mim-text_text")[0].childNodes)
 +
        print pmid
 +
        key_source = PubMed.search_for(pmid)
 +
        key_rec = medline_dict[0]
 +
        keywords = get_text(key_rec.getElementsByTagName("MeshHeading")[0].childNodes)
 +
        print keywords

Revision as of 22:16, 18 April 2007

Issues

  • I think I have an appropriate algorithm for deriving keywords and printing some PMIDs. However, I keep getting this weird error message that says my spacing is incorrect and when I follow the given instructions, I get the same error. - Somehow this error disappeared.


Program So Far

from Bio import PubMed
from Bio import Medline
import string

disease = a.name

search_term = "Review[ptyp] "+disease
#print search_term

review_ids = PubMed.search_for(search_term)

rec_parser = Medline.RecordParser()
medline_dict = PubMed.Dictionary(parser = rec_parser)

count = 1

for did in review_ids[0:5]:
    cur_record = medline_dict[did]
    print '\n', count, ')  ', string.rstrip(cur_record.title), cur_record.authors, string.strip(cur_record.source)
    count=count+1

def extract_allelic_variant_data(str):
        pmid = get_text(v.getElementsByTagName("Mim-reference_pubmedUID")[0].getElementsByTagName("Mim-text_text")[0].childNodes)
        print pmid
        key_source = PubMed.search_for(pmid)
        key_rec = medline_dict[0]
        keywords = get_text(key_rec.getElementsByTagName("MeshHeading")[0].childNodes)
        print keywords
Personal tools