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

From OpenWetWare

(Difference between revisions)
Jump to: navigation, search
(Issues)
Line 33: Line 33:
         keywords = get_text(key_rec.getElementsByTagName("MeshHeading")[0].childNodes)
         keywords = get_text(key_rec.getElementsByTagName("MeshHeading")[0].childNodes)
         print keywords
         print keywords
 +
 +
==Tasks for Tuesday and Thursday==
 +
*For Tuesday:
 +
**Understand XML code parsing better, so that I can correct errors in previous code to parse out PMIDs from OMIM and then search those PMIDs in PubMed and return key words.
 +
*For Thursday:
 +
**Brainstorm approaches to dealing with SNPs that are not part of OMIM.

Revision as of 23:25, 23 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.
  • I am still having a few issues in terms of implementing what I hope to do in the code - there is very little documentation for accessing PubMed in this fashion. The code below is the code I have added thus far to Xiaodi's general code. Everything works up until the last stanza of the program.

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

==Tasks for Tuesday and Thursday==
*For Tuesday:
**Understand XML code parsing better, so that I can correct errors in previous code to parse out PMIDs from OMIM and then search those PMIDs in PubMed and return key words.
*For Thursday:
**Brainstorm approaches to dealing with SNPs that are not part of OMIM.
Personal tools