/************************************************************************** * Callback invoked when matching a closing pattern tag for a CISML file of * a secondary motif database. Processes the matches found (see * spamo-matches.c for more details) and if the motif had a significant * spacing it optionally dumps the sequence matches to file. **************************************************************************/ void motif_end_secondary(void *ctx) { SECONDARY_LOADER_T *loader = (SECONDARY_LOADER_T*)ctx; if (loader->secondary_motif == NULL) return; // process matches process_matches(loader->margin, loader->bin, loader->significant_pvalue, loader->motif_evalue_cutoff, loader->test_max, loader->primary_motif, loader->sequences, loader->secondary_motif, loader->n_secondary_motifs, loader->secondary_matches); // dump sequences (if requested) if (loader->output_sequences && loader->secondary_motif->sig_count > 0) { output_sequence_matches(loader->output_directory, loader->margin, loader->bin, loader->significant_pvalue, loader->dump_sig_only, loader->sequences, loader->primary_motif, loader->secondary_motif, loader->secondary_matches); } }
/* perform a 3-way match between 3 hash sources */ static void three_way(struct hash_handle *hh1, struct hash_handle *hh2, struct hash_handle *hh_exclude) { while (hh_next(hh1) == 0) { if (hh_next_match(hh2, hh1) == 0 && (!hh_exclude || hh_next_match(hh_exclude, hh1) != 0)) { register_match(hh1, hh2); } if (hh_eof(hh2)) break; } process_matches(hh1, hh2); }