deps/kb_meme/meme-5.0.1/src/momo-input.c
/**
 * Add a single mod with its flanking amino acids to the mod table
 */
Add a single mod with its flanking amino acids to the mod table
Add a single mod with its flanking amino acids to the mod table
void add_mod_to_mod_list(HASH_TABLE mod_table,
                    char* modless,
                    int mod_index,
                    char* mod_name,
                    char* protein_id,
                    char* scan,
                    SEQ_T** all_sequences,
                    int num_sequences,
                    MOMO_OPTIONS_T* options,
                    SUMMARY_T* summary,
                    bool passes_threshold) {
  int i;
  MOD_INFO_T * modinfo = hash_get_entry_value(hash_lookup_str(mod_name, mod_table));
  int motif_width = options->width;
  KMER_LOC_T* kmerloc = mm_malloc(sizeof(kmerloc));
  kmerloc->seqidx = -1;
  kmerloc->kmeridx = -1;
  find_fasta(summary, options, all_sequences, num_sequences, modless, kmerloc);
  char* protein = (kmerloc->seqidx >= 0) ? get_raw_sequence(all_sequences[kmerloc->seqidx]) : modless;
  int start_of_mod = (kmerloc->kmeridx >= 0) ? kmerloc->kmeridx + mod_index : mod_index;
  if (passes_threshold) {
    add_kmer_to_sequence_list(&modinfo->seq_table, &modinfo->seq_list, protein, start_of_mod, options);
  }
  free(kmerloc);
}
void add_mod_to_mod_list ( HASH_TABLE mod_table , char * modless , int mod_index , char * mod_name , char * protein_id , char * scan , SEQ_T * * all_sequences , int num_sequences , MOMO_OPTIONS_T * options , SUMMARY_T * summary , bool passes_threshold ) { int i ; MOD_INFO_T * modinfo = hash_get_entry_value ( hash_lookup_str ( mod_name , mod_table ) ) ; int motif_width = options -> width ; KMER_LOC_T * kmerloc = mm_malloc ( sizeof ( kmerloc ) ) ; kmerloc -> seqidx = -1 ; kmerloc -> kmeridx = -1 ; find_fasta ( summary , options , all_sequences , num_sequences , modless , kmerloc ) ; char * protein = ( kmerloc -> seqidx >= 0 ) ? get_raw_sequence ( all_sequences [ kmerloc -> seqidx ] ) : modless ; int start_of_mod = ( kmerloc -> kmeridx >= 0 ) ? kmerloc -> kmeridx + mod_index : mod_index ; if ( passes_threshold ) { add_kmer_to_sequence_list ( & modinfo -> seq_table , & modinfo -> seq_list , protein , start_of_mod , options ) ; } free ( kmerloc ) ; }
Add a single mod with its flanking amino acids to the mod table
Add a single mod with its flanking amino acids to the mod table
// Set up variables // For this mod, we will create a kmerinfo object.