int Argument_main(Argument *arg) { register FastaDB *fdb; register ArgumentSet *as = ArgumentSet_create("Sequence Input Options"); gchar *query_path; FastaComposition_Data fcd = {{0},FALSE, FALSE}; ArgumentSet_add_option(as, 'f', "fasta", "path", "Fasta input file", NULL, Argument_parse_string, &query_path); ArgumentSet_add_option(as, 'i', "ignorecase", NULL, "Ignore sequence case", "FALSE", Argument_parse_boolean, &fcd.ignore_case); ArgumentSet_add_option(as, 's', "separate", NULL, "Report composition for each sequence separately", "FALSE", Argument_parse_boolean, &fcd.report_separately); Argument_absorb_ArgumentSet(arg, as); Argument_process(arg, "fastacomposition", "A utility to report sequence composition\n" "Guy St.C. Slater. [email protected]. 2000-2003.\n", NULL); fdb = FastaDB_open(query_path, NULL); FastaDB_traverse(fdb, FastaDB_Mask_ID|FastaDB_Mask_SEQ, fasta_composition_traverse_func, &fcd); if(!fcd.report_separately) fasta_composition_report(query_path, fcd.count, fcd.ignore_case); FastaDB_close(fdb); return 0; }
int Argument_main(Argument *arg){ register FastaDB *fdb; register ArgumentSet *as = ArgumentSet_create("Sequence Input Options"); gchar *query_path; gchar clip_char; ArgumentSet_add_option(as, 'f', "fasta", "path", "Fasta input file", NULL, Argument_parse_string, &query_path); ArgumentSet_add_option(as, 'c', "clip", "path", "Clip character", "N", Argument_parse_char, &clip_char); Argument_absorb_ArgumentSet(arg, as); Argument_process(arg, "fastaclip", "A utility clip terminal Ns from fasta format sequences\n" "Guy St.C. Slater. [email protected]. 2000-2003.\n", NULL); fdb = FastaDB_open(query_path, NULL); FastaDB_traverse(fdb, FastaDB_Mask_ALL, fasta_clip_traverse_func, GINT_TO_POINTER((gint)clip_char)); FastaDB_close(fdb); return 0; }