In [1]:
import codecs, string, random, math, cPickle as pickle, re

In [2]:
# load trial descriptions
trial_desc = pickle.load(open('../data/trial_desc.pkl','rb'))

In [3]:
trial_desc.items()[:2]


Out[3]:
[(u'NCT01025063',
  (u'This study will investigate the safety and efficacy of treatment of choroidal neovascularization (CNV) due to age-related macular degeneration (AMD) with a combination of ranibizumab (Lucentis) and verteporfin PDT (Visudyne), as compared with ranibizumab monotherapy.',
   '')),
 (u'NCT00499928',
  (u'This study will examine the biological fate of radioactive SB-751689 administered to healthy males and healthy postmenopausal women. Subjects will receive a single oral dose of radioactive SB-751689. Excreta and blood samples will be taken over the course of 7 days. This study will help determine the major route of elimination of SB-751689 in humans. It will also provide samples (blood, plasma, urine, and stools) for analysis of metabolites, if any.',
   ''))]

In [4]:
f = codecs.open('../data/MTIdescriptions.txt','w', encoding="ascii", errors="replace")
for nctid in trial_desc.keys():
    f.write('%s|%s\n' % (nctid,' '.join(trial_desc[nctid])))
f.close()

In [ ]: