function [flagged_filenames,repeated_entries]=simple_database_querier%(filename_fragment_or_cellarray_of_filenames) %selection_clauses=query_generator; %select_statement=selection_clauses{1}{1} %from_expts_table='SELECT first_patchlogfile_this_expt, color_for_plotting FROM patchlog_expts_table WHERE expt_main_stimulus_class =''stdp'' AND expt_main_configuration_class = ''microperfusion'' AND expt_free_of_significant_technical_problems = 1 AND induction_can_be_measured = 1' %from_epochs_table='SELECT first_patchlogfile_this_expt,patchlogfiles_this_epoch, epoch_class_and_sequence, trials_to_ignore,suffix, next_epoch_class_and_sequence, next_C_epoch_if_C_epoch_and_epochs_can_be_compared, event_detection_threshold,minutes_per_trial,APs_per_trial,conversion_to_mV_or_pA_postsyn_channel,induction_interval_prepost_insamples FROM patchlog_epochs_table WHERE epoch_free_of_significant_technical_problems =1 AND next_C_epoch_if_C_epoch_and_epochs_can_be_compared IS NOT NULL' %lotsa_info_table=strcat('SELECT from_epochs_table.first_patchlogfile_this_expt,color_for_plotting, patchlogfiles_this_epoch, epoch_class_and_sequence, trials_to_ignore,suffix, next_epoch_class_and_sequence, next_C_epoch_if_C_epoch_and_epochs_can_be_compared, event_detection_threshold,minutes_per_trial,APs_per_trial,conversion_to_mV_or_pA_postsyn_channel,induction_interval_prepost_insamples FROM (',from_epochs_table,') AS from_epochs_table INNER JOIN (',from_expts_table,')AS from_expts_table ON from_epochs_table.first_patchlogfile_this_expt = from_expts_table.first_patchlogfile_this_expt') %selected_preinduction_table=strcat('SELECT patchlogfiles_this_epoch FROM (',lotsa_info_table,') AS lotsa_info_table ORDER BY patchlogfiles_this_epoch') % selected_induction_table=strcat('SELECT patchlog_epochs_table.patchlogfiles_this_epoch,patchlog_epochs_table.conversion_to_mV_or_pA_postsyn_channel,patchlog_epochs_table.induction_interval_prepost_insamples,lotsa_info_table.color_for_plotting,patchlog_epochs_table.suffix FROM patchlog_epochs_table INNER JOIN (',lotsa_info_table, ') AS lotsa_info_table ON patchlog_epochs_table.first_patchlogfile_this_expt =lotsa_info_table.first_patchlogfile_this_expt AND patchlog_epochs_table.suffix =lotsa_info_table.suffix AND patchlog_epochs_table.epoch_class_and_sequence =lotsa_info_table.next_epoch_class_and_sequence ORDER BY patchlog_epochs_table.patchlogfiles_this_epoch') % selected_postinduction_table=strcat('SELECT patchlog_epochs_table.patchlogfiles_this_epoch,patchlog_epochs_table.trials_to_ignore,patchlog_epochs_table.suffix,patchlog_epochs_table.event_detection_threshold,patchlog_epochs_table.minutes_per_trial,patchlog_epochs_table.APs_per_trial,lotsa_info_table.color_for_plotting FROM patchlog_epochs_table INNER JOIN (',lotsa_info_table, ') AS lotsa_info_table ON patchlog_epochs_table.first_patchlogfile_this_expt =lotsa_info_table.first_patchlogfile_this_expt AND patchlog_epochs_table.suffix =lotsa_info_table.suffix AND patchlog_epochs_table.epoch_class_and_sequence =lotsa_info_table.next_C_epoch_if_C_epoch_and_epochs_can_be_compared ORDER BY patchlog_epochs_table.patchlogfiles_this_epoch') %select_statement=selected_preinduction_table %select_statement='SELECT comment_on_epoch, patchlogfiles_this_epoch FROM patchlog_epochs_table WHERE patchlogfiles_this_epoch = ''[patch20060224T013408]'''% ORDER BY patchlogfiles_this_epoch ASC' %select_statement=strcat('select minutes_per_trial from patchlog_epochs_table where patchlogfiles_this_epoch = ''',filename_fragment_or_cellarray_of_filenames{1},'''') %nomen=strcat(' patchlogfiles_this_epoch = ''',filename_fragment_or_cellarray_of_filenames{1},'''') %select_statement=strcat('SELECT first_patchlogfile_this_expt FROM patchlog_epochs_table WHERE (',nomen,')'); %trials_to_ignore=''[1:43]'' OR trials_to_ignore=''[1:28]'' OR trials_to_ignore=''[66:82]'' OR select_statement=strcat('SELECT first_patchlogfile_this_expt FROM patchlog_epochs_table WHERE patchlogfiles_this_epoch LIKE ''%20060916%''') %SELECT patchlogfiles_this_epoch,trials_to_ignore,suffix,event_detection_threshold,minutes_per_trial,APs_per_trial,color_for_plotting,stable_minutes_from_relevant_induction,num_samples_per_event,values_to_average_for_local_correction FROM %(SELECT color_for_plotting,num_samples_per_event,values_to_average_for_local_correction,patchlogfiles_this_epoch,trials_to_ignore,suffix,event_detection_threshold,minutes_per_trial,APs_per_trial,stable_minutes_from_relevant_induction FROM %(SELECT first_patchlogfile_this_expt,patchlogfiles_this_epoch,trials_to_ignore,suffix,event_detection_threshold,minutes_per_trial,APs_per_trial,stable_minutes_from_relevant_induction FROM %patchlog_epochs_table WHERE ( patchlogfiles_this_epoch = 'patch20070321T234702') AND suffix='[]') AS from_epochs_table INNER JOIN (SELECT first_patchlogfile_this_expt,color_for_plotting,num_samples_per_event,values_to_average_for_local_correction FROM %patchlog_expts_table)AS from_expts_table ON from_epochs_table.first_patchlogfile_this_expt = from_expts_table.first_patchlogfile_this_expt) AS lotsa_info_table ORDER BY patchlogfiles_this_epoch %select_statement='SELECT patchlogfiles_this_epoch FROM patchlog_epochs_table WHERE patchlogfiles_this_epoch = ''[patch20070321T234702]''' %select_statement='select first_patchlogfile_this_expt from patchlog_epochs_table' %select_statement='select minutes_per_trial from patchlog_epochs_table where patchlogfiles_this_epoch = ''[patch20060224T013408]''' %sel='SELECT first_patchlogfile_this_expt FROM patchlog_epochs_table WHERE patchlogfiles_this_epoch = ''[patch20070208T010642]''' %select_statement=strcat('SELECT color_for_plotting FROM patchlog_expts_table INNER JOIN (',sel,') AS sel ON patchlog_expts_table.first_patchlogfile_this_expt = sel.first_patchlogfile_this_expt') %select_statement='SELECT first_patchlogfile_this_expt, patchlogfiles_this_epoch, epoch_class_and_sequence, suffix, next_epoch_class_and_sequence, next_C_epoch_if_C_epoch_and_epochs_can_be_compared FROM patchlog_epochs_table WHERE epoch_free_of_significant_technical_problems =1 AND next_C_epoch_if_C_epoch_and_epochs_can_be_compared IS NOT NULL ORDER BY patchlogfiles_this_epoch ASC' %select_statement='SELECT distinct LTP_from_prev_characterization_epoch FROM patchlog_epochs_table'% WHERE LTP_from_prev_characterization_epoch_pvalue IS NOT NULL' %select_statement='SELECT patchlog_expts_table.first_patchlogfile_this_expt FROM patchlog_expts_table INNER JOIN patchlog_epochs_table ON patchlog_expts_table.first_patchlogfile_this_expt = patchlog_epochs_table.first_patchlogfile_this_expt WHERE patchlog_expts_table.expt_main_stimulus_class <> ''stdp'' AND patchlog_expts_table.expt_main_stimulus_class <> ''sd'' AND patchlog_epochs_table.epoch_class_and_sequence LIKE ''%C%'' ORDER BY patchlog_expts_table.first_patchlogfile_this_expt ASC'; select_statement_cell{1}=select_statement; flagged_filenames=retrieve_data_from_sql_database(select_statement_cell); %flagged_filenames=sort(flagged_filenames); repeated_entries=find_repetitions_in_a_cell_array_input(flagged_filenames);