Explorer
/proc/thread-self/root/tmp/mas_variant_verify.py
← Zurück ↓ Download
import sqlite3,json,os,glob
p='/opt/struktur/mas-visual-library/database/visual_library.db'; c=sqlite3.connect(p); c.row_factory=sqlite3.Row
print('COUNTS')
for q in ['select count(*) n from visuals where asset_group_id is not null','select count(*) n from asset_groups','select count(*) n from variant_candidates','select count(*) n from visuals where analysis_status="ANALYZED"','select count(*) n from visuals where asset_group_id is null']: print(c.execute(q).fetchone()[0])
print('CANDIDATES')
for r in c.execute('select visual_id_a,visual_id_b,status,evidence from variant_candidates order by variant_candidate_id'): print(dict(r))
print('GROUP_SIZE_DIST')
for r in c.execute('select n,count(*) from (select asset_group_id,count(*) n from visuals where asset_group_id is not null group by asset_group_id) group by n order by n'): print(tuple(r))
files=glob.glob('/opt/struktur/mas-visual-library/originals/*')
print('ORIGINALS',len(files),sum(os.path.getsize(x) for x in files if os.path.isfile(x)))
print('INTEGRITY',c.execute('pragma integrity_check').fetchone()[0])
print('PENDING',c.execute('select count(*) from visuals where analysis_status="ANALYSIS_PENDING"').fetchone()[0])
c.close()