Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Prevent tmhmm_scrape_web and lipop_scrape_web writing to cache unless…
… all batches are successful.
  • Loading branch information
pansapiens committed Dec 3, 2012
1 parent b045394 commit f49e36d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
3 changes: 0 additions & 3 deletions inmembrane/plugins/lipop_scrape_web.py
Expand Up @@ -124,9 +124,6 @@ def annotate(params, proteins, \

allresultpages += clean_result_page(resultpage)

if __DEBUG__:
log_stderr(resultpage)

# we store the cleaned up result pages concatenated together
fh = open(outfile, 'a+')
fh.write(allresultpages)
Expand Down
19 changes: 8 additions & 11 deletions inmembrane/plugins/tmhmm_scrape_web.py
Expand Up @@ -52,6 +52,7 @@ def annotate(params, proteins, \
proteins, id_mapping = generate_safe_seqids(proteins)

seqids = proteins.keys()
allresultpages = ""
while seqids:
seqid_batch = seqids[0:batchsize]
del seqids[0:batchsize]
Expand Down Expand Up @@ -117,18 +118,14 @@ def annotate(params, proteins, \
if __DEBUG__:
log_stderr(resultpage)

resultpage = clean_result_page(resultpage)
if __DEBUG__:
log_stderr(resultpage)

#soup = BeautifulSoup(resultpage)
proteins = parse_tmhmm(resultpage, proteins, id_mapping=id_mapping)

# we store the cleaned up result pages concatenated together
fh = open(outfile, 'a+')
fh.write(resultpage)
fh.close()
allresultpages += clean_result_page(resultpage)

# we store the cleaned up result pages concatenated together
fh = open(outfile, 'a+')
fh.write(resultpage)
fh.close()

proteins = parse_tmhmm(allresultpages, proteins, id_mapping=id_mapping)
return proteins

def clean_result_page(resultpage):
Expand Down

0 comments on commit f49e36d

Please sign in to comment.