Skip to content

Commit

Permalink
Add info on selected assembler to validate step
Browse files Browse the repository at this point in the history
Force scaffold plot to be drawn when only one scaffold is present
  • Loading branch information
skoren committed Sep 9, 2013
1 parent 324abfe commit f569f91
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Utilities/python/create_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ def create_plots(handlef,TITLE):
l = len(seq)
if(l > SIZE_CUTOFF):
sample.sf_sizes[header] = l
if len(sample.sf_sizes) == 1:
sample.sf_sizes["none"] = 0

#print " sf_size " + str(len(sample.sf_sizes))
sample.sfsort_sizes = sorted(sample.sf_sizes.values(), reverse=True)
Expand Down
17 changes: 13 additions & 4 deletions Utilities/python/create_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,21 @@ def outputLibraryInfo(html_prefix, markupFile, outputHeader, libcnt, format, mat
markupFile.td("NA")
markupFile.tr.close()

def outputValidate(html_prefix, markupFile, outputHeader, assembler, score):
def outputValidate(html_prefix, markupFile, outputHeader, best, assembler, score):
if outputHeader:
markupFile.table(border="1")
markupFile.tr()
markupFile.th("Assembler")
markupFile.th("LAP Score")
markupFile.tr.close()

isBest = False
if best == assembler:
isBest = True

markupFile.tr()
markupFile.add("<td align=\"left\">%s</td>"%(assembler.title()))
markupFile.add("<td align=\"right\">%.4f</td>"%(float(score)))
markupFile.add("<td align=\"left\">%s%s%s</td>"%("<b>" if isBest else "", assembler.title(), "</b>" if isBest else ""))
markupFile.add("<td align=\"right\">%s%.4f%s</td>"%("<b>" if isBest else "", float(score), "</b>" if isBest else ""))
markupFile.tr.close()

def create_summary(first,amosbnk,prefix,ref_asm,utils,img,rund,nLibs,taxa_level,dbdir):
Expand Down Expand Up @@ -284,17 +288,22 @@ def create_summary(first,amosbnk,prefix,ref_asm,utils,img,rund,nLibs,taxa_level,
validate_out = open("%s/Validate.html"%(html_prefix), 'w')
firstScore = True
if os.path.exists("%s/Postprocess/out/lap.scores"%(MA_dir)):
best = open("%s/Postprocess/out/best.asm"%(MA_dir), 'r')
bestAsm = best.read()
best.close()
laps = open("%s/Postprocess/out/lap.scores"%(MA_dir), 'r')
validate = markup.page()
validate.init()#bodyattrs={'style':"margin:0px"})
validate.p()
validate.add("Selected assembler: %s"%(bestAsm))
validate.br()
for line in laps:
line = line.replace("\n","")
if "#" in line:
continue
else:
res = line.split("\t")
outputValidate(html_prefix, validate, firstScore, res[0], res[1])
outputValidate(html_prefix, validate, firstScore, bestAsm, res[0], res[1])
firstScore = False
validate.table.close()
laps.close()
Expand Down

0 comments on commit f569f91

Please sign in to comment.