comparison gene_family_classifier.py @ 113:f517eb8b08de draft

Uploaded
author greg
date Mon, 27 Feb 2017 14:54:23 -0500
parents 9e688af74aae
children 1f357ae51fc4
comparison
equal deleted inserted replaced
112:9e688af74aae 113:f517eb8b08de
83 sys.exit(1) 83 sys.exit(1)
84 84
85 85
86 def write_html_output(output, title, dir): 86 def write_html_output(output, title, dir):
87 with open(output, 'w') as fh: 87 with open(output, 'w') as fh:
88 fh.write('<html><head><h2>%s</h2></head>\n' % title) 88 fh.write('<html><head><h3>%s</h3></head>\n' % title)
89 fh.write('<body><p/><table cellpadding="5">\n') 89 fh.write('<body><p/><table cellpadding="2">\n')
90 fh.write('<tr><th>Size</th><th>Name</th></tr>\n') 90 fh.write('<tr><th>Size</th><th>Name</th></tr>\n')
91 for fname in os.listdir(dir): 91 for fname in os.listdir(dir):
92 try: 92 try:
93 size = str(os.path.getsize(os.path.join(dir, fname))) 93 size = str(os.path.getsize(os.path.join(dir, fname)))
94 except: 94 except:
139 # Handle hmmscan.log output. 139 # Handle hmmscan.log output.
140 if args.classifier in ['hmmscan', 'both']: 140 if args.classifier in ['hmmscan', 'both']:
141 src_hmmscan_log = os.path.join(OUTPUT_DIR, 'hmmscan.log') 141 src_hmmscan_log = os.path.join(OUTPUT_DIR, 'hmmscan.log')
142 if os.path.exists(src_hmmscan_log): 142 if os.path.exists(src_hmmscan_log):
143 if args.save_hmmscan_log is None: 143 if args.save_hmmscan_log is None:
144 os.remove(args.hmmscan_log) 144 os.remove(src_hmmscan_log)
145 else: 145 else:
146 shutil.move(src_hmmscan_log, args.hmmscan_log) 146 shutil.move(src_hmmscan_log, args.hmmscan_log)
147 # Handle orthogroups outputs. 147 # Handle orthogroups outputs.
148 if create_ortho_sequences: 148 if create_ortho_sequences:
149 if create_corresponding_coding_sequences: 149 if create_corresponding_coding_sequences: