function [stat] = my_insitus(descriptor) % contains predefined statements for use with pg_query % e.g. pg_query(conn,1, pg_insitus('xy'),'insitu9963.jpe') % choices: % xy return xy coordinates for insitu image with filename % coord = pg_query(conn,1, pg_insitus('xy'),'insitu9963.jpe') % path return the subdirectory name for filename % dir = pg_query(conn,0,pg_insitus('path'),'insitu9963.jpe') % qc return all embryos that passed final qc check % embryos_qc = pg_query(conn,0, pg_insitus('qc')) switch lower(descriptor) case 'termmatch' stat = 'select m.id from main m, annot a, annot_term at, term t where m.id = a.main_id and a.id = at.annot_id and at.term_id = t.id and at.annotator = ''unified'' and t.go_term = ''%s'''; case 'termimage' stat = 'select im.id from image im, annot a, annot_term at, term t where im.annot_id = a.id and a.id = at.annot_id and at.term_id = t.id and at.annotator = ''unified'' and t.go_term = ''%s'''; case 'image_orientation' stat = 'select distinct image_processing_flags, handedness from image where image_path = ''%s'''; case 'all_terms_stage' stat = ['select distinct(t.go_term) from main m, annot a, annot_term at, term t ' ... 'where m.id = a.main_id and a.id = at.annot_id and at.term_id = t.id and at.annotator = ''unified'' ' ... 'and a.stage = %d and t.go_term not like ''list_%%'' and t.go_term not like ''cat_%%'' ' ... 'order by go_term']; case 'symbol' stat = 'select distinct(m.flybase_name) from main m, annot a, image i where m.id = a.main_id and a.id = i.annot_id and i.image_path like ''%%%s'''; end