int main(int argc,char ** argv) { int i; char * temp; build_defaults(); strip_out_standard_options(&argc,argv,show_help,show_version); potential_file = strip_out_assigned_argument(&argc,argv,"pg"); pal_file = strip_out_assigned_argument(&argc,argv,"pal_file"); if( (temp = strip_out_assigned_argument(&argc,argv,"gap")) != NULL ) gap_str = temp; if( (temp = strip_out_assigned_argument(&argc,argv,"g")) != NULL ) gap_str = temp; if( (temp = strip_out_assigned_argument(&argc,argv,"ext")) != NULL ) ext_str = temp; if( (temp = strip_out_assigned_argument(&argc,argv,"e")) != NULL ) ext_str = temp; if( (temp = strip_out_assigned_argument(&argc,argv,"matrix")) != NULL ) matrix_file = temp; if( (temp = strip_out_assigned_argument(&argc,argv,"m")) != NULL ) matrix_file = temp; if( (temp = strip_out_assigned_argument(&argc,argv,"s")) != NULL ) qstart_str = temp; if( (temp = strip_out_assigned_argument(&argc,argv,"t")) != NULL ) qend_str = temp; if( (temp = strip_out_assigned_argument(&argc,argv,"u")) != NULL ) tstart_str = temp; if( (temp = strip_out_assigned_argument(&argc,argv,"v")) != NULL ) tend_str = temp; if( (strip_out_boolean_argument(&argc,argv,"trev")) == TRUE ) reverse = TRUE; if( (strip_out_boolean_argument(&argc,argv,"[no]newgene")) == TRUE ) use_new_stats = TRUE; if( (strip_out_boolean_argument(&argc,argv,"tfor")) == TRUE ){ if( reverse == TRUE ) { warn("You have specified both trev and tfor. Treating as both"); do_both = TRUE; reverse = FALSE; } else { reverse = FALSE; } } if( (temp = strip_out_assigned_argument(&argc,argv,"insert")) != NULL ) { if( strcmp(temp,"flat") == 0 ) { flat_insert = TRUE; } else { flat_insert = FALSE; } } if( (strip_out_boolean_argument(&argc,argv,"both")) == TRUE ) do_both = TRUE; if( (strip_out_boolean_argument(&argc,argv,"fembl")) == TRUE ) is_embl = TRUE; if( (strip_out_boolean_argument(&argc,argv,"tabs")) == TRUE ) target_abs = TRUE; pseudo = strip_out_boolean_argument(&argc,argv,"pseudo"); if( (temp = strip_out_assigned_argument(&argc,argv,"codon")) != NULL ) codon_file = temp; if( (temp = strip_out_assigned_argument(&argc,argv,"gene")) != NULL ) gene_file = temp; if( (temp = strip_out_assigned_argument(&argc,argv,"alg")) != NULL ) alg_str = temp; if( (temp = strip_out_assigned_argument(&argc,argv,"kbyte")) != NULL ) kbyte_str = temp; if( (temp = strip_out_assigned_argument(&argc,argv,"subs")) != NULL ) subs_string = temp; if( (temp = strip_out_assigned_argument(&argc,argv,"indel")) != NULL ) indel_string = temp; if( (temp = strip_out_assigned_argument(&argc,argv,"cfreq")) != NULL ) cfreq_string = temp; if( (temp = strip_out_assigned_argument(&argc,argv,"splice")) != NULL ) { warn("deprecated command line option -splice. use -splice_gtag now"); splice_string = temp; } if( (temp = strip_out_assigned_argument(&argc,argv,"init")) != NULL ) startend_string = temp; if( (temp = strip_out_assigned_argument(&argc,argv,"null")) != NULL ) null_string = temp; if( (temp = strip_out_assigned_argument(&argc,argv,"intron")) != NULL ) intron_string = temp; if( (temp = strip_out_assigned_argument(&argc,argv,"alln")) != NULL ) allN_string = temp; if( (strip_out_boolean_argument(&argc,argv,"hmmer")) == TRUE ) use_tsm = TRUE; if( (strip_out_boolean_argument(&argc,argv,"intie")) == TRUE ) use_tied_model = TRUE; if( (temp = strip_out_assigned_argument(&argc,argv,"hname")) != NULL ) hmm_name = temp; if( (strip_out_boolean_argument(&argc,argv,"pretty")) != FALSE ) show_pretty = TRUE; if( (strip_out_boolean_argument(&argc,argv,"gff")) != FALSE ) show_gff = TRUE; if( (strip_out_boolean_argument(&argc,argv,"diana")) != FALSE ) show_diana = TRUE; if( (strip_out_boolean_argument(&argc,argv,"embl")) != FALSE ) show_embl = TRUE; if( (strip_out_boolean_argument(&argc,argv,"genes")) != FALSE ) show_pretty_gene = TRUE; if( (strip_out_boolean_argument(&argc,argv,"genesf")) != FALSE ) show_supp_gene = TRUE; if( (strip_out_boolean_argument(&argc,argv,"para")) != FALSE ) show_para = TRUE; if( (strip_out_boolean_argument(&argc,argv,"trans")) != FALSE ) show_trans = TRUE; if( (strip_out_boolean_argument(&argc,argv,"pep")) != FALSE ) show_pep = TRUE; if( (strip_out_boolean_argument(&argc,argv,"cdna")) != FALSE ) show_cdna = TRUE; if( (strip_out_boolean_argument(&argc,argv,"sum")) != FALSE ) show_match_sum = TRUE; if( (strip_out_boolean_argument(&argc,argv,"alb")) != FALSE ) show_AlnBlock = TRUE; if( (strip_out_boolean_argument(&argc,argv,"ace")) != FALSE ) show_ace = TRUE; if( (strip_out_boolean_argument(&argc,argv,"pal")) != FALSE ) show_PackAln = TRUE; if( (strip_out_boolean_argument(&argc,argv,"gener")) != FALSE ) show_gene_plain = TRUE; if( (strip_out_boolean_argument(&argc,argv,"over")) != FALSE ) show_overlap = TRUE; if( (temp = strip_out_assigned_argument(&argc,argv,"divide")) != NULL ) divide_str = temp; if( (temp = strip_out_assigned_argument(&argc,argv,"block")) != NULL ) main_block_str = temp; dpri = new_DPRunImpl_from_argv(&argc,argv); gmp = new_GeneModelParam_from_argv(&argc,argv); ppp = new_PhasedProteinPara_from_argv(&argc,argv); gwrp = new_GeneWiseRunPara_from_argv(&argc,argv); strip_out_remaining_options_with_warning(&argc,argv); if( argc != 3 ) { warn("Wrong number of arguments (expect 2)!\n"); if( argc > 1 ){ warn("Arg line looked like (after option processing)"); for(i=1;i<argc;i++) { fprintf(stderr," %s\n",argv[i]); } } show_short_help(); } if( show_embl == FALSE && show_diana == FALSE && show_gff == FALSE && show_overlap == FALSE && show_pretty_gene == FALSE && show_match_sum == FALSE && show_ace == FALSE && show_gene_plain == FALSE && show_pretty == FALSE && show_AlnBlock == FALSE && show_PackAln == FALSE && show_pep == FALSE ) { show_pretty = TRUE; show_para = TRUE; } dna_seq_file = argv[2]; if( use_tsm == FALSE) protein_file = argv[1]; else hmm_file = argv[1]; if( build_objects() == FALSE) fatal("Could not build objects!"); if( show_para == TRUE) { show_parameters(); } if( build_alignment() == FALSE) fatal("Could not build alignment!"); if( show_output() == FALSE) fatal("Could not show alignment. Sorry!"); if( do_both == TRUE) { reverse_target(); if( build_alignment() == FALSE) fatal("Could not build alignment!"); if( show_output() == FALSE) fatal("Could not show alignment. Sorry!"); } free_temporary_objects(); free_io_objects(); return 0; }
int main(int argc,char ** argv) { int i; char * temp; build_defaults(); bootstrap_HMMer2(); strip_out_standard_options(&argc,argv,show_help,show_version); if( (temp = strip_out_assigned_argument(&argc,argv,"gap")) != NULL ) gap_str = temp; if( (temp = strip_out_assigned_argument(&argc,argv,"g")) != NULL ) gap_str = temp; if( (temp = strip_out_assigned_argument(&argc,argv,"ext")) != NULL ) ext_str = temp; if( (temp = strip_out_assigned_argument(&argc,argv,"e")) != NULL ) ext_str = temp; if( (temp = strip_out_assigned_argument(&argc,argv,"matrix")) != NULL ) matrix_file = temp; if( (temp = strip_out_assigned_argument(&argc,argv,"m")) != NULL ) matrix_file = temp; if( (temp = strip_out_assigned_argument(&argc,argv,"s")) != NULL ) qstart_str = temp; if( (temp = strip_out_assigned_argument(&argc,argv,"t")) != NULL ) qend_str = temp; if( (temp = strip_out_assigned_argument(&argc,argv,"aln")) != NULL ) aln_number_str = temp; if( (temp = strip_out_assigned_argument(&argc,argv,"codon")) != NULL ) codon_file = temp; if( (temp = strip_out_assigned_argument(&argc,argv,"alg")) != NULL ) alg_str = temp; if( (temp = strip_out_assigned_argument(&argc,argv,"aalg")) != NULL ) aln_alg_str = temp; if( (temp = strip_out_assigned_argument(&argc,argv,"cut")) != NULL ) search_cutoff_str = temp; if( (temp = strip_out_assigned_argument(&argc,argv,"ecut")) != NULL ) evalue_search_str = temp; if( (temp = strip_out_assigned_argument(&argc,argv,"subs")) != NULL ) subs_string = temp; if( (temp = strip_out_assigned_argument(&argc,argv,"indel")) != NULL ) indel_string = temp; if( (temp = strip_out_assigned_argument(&argc,argv,"init")) != NULL ) startend_string = temp; if( (temp = strip_out_assigned_argument(&argc,argv,"alln")) != NULL ) allN_string = temp; if( (temp = strip_out_assigned_argument(&argc,argv,"null")) != NULL ) null_string = temp; if( (strip_out_boolean_argument(&argc,argv,"dnas")) == TRUE ) use_single_dna = TRUE; if( (strip_out_boolean_argument(&argc,argv,"dnadb")) == TRUE ) use_single_dna = FALSE; if( (strip_out_boolean_argument(&argc,argv,"tfor")) == TRUE ) do_forward_only = TRUE; if( (strip_out_boolean_argument(&argc,argv,"flati")) == TRUE ) flat_insert = TRUE; if( (strip_out_boolean_argument(&argc,argv,"hmmer")) == TRUE ) use_tsm = TRUE; if( (strip_out_boolean_argument(&argc,argv,"pfam2")) == TRUE ) use_pfam1 = TRUE; if( (strip_out_boolean_argument(&argc,argv,"pfam")) == TRUE ) use_pfam2 = TRUE; if( (strip_out_boolean_argument(&argc,argv,"protein")) == TRUE ) use_single_pro = TRUE; if( (strip_out_boolean_argument(&argc,argv,"prodb")) == TRUE ) use_db_pro = TRUE; if( (temp = strip_out_assigned_argument(&argc,argv,"hname")) != NULL ) hmm_name = temp; if( (strip_out_boolean_argument(&argc,argv,"nohis")) != FALSE ) show_histogram = FALSE; if( (strip_out_boolean_argument(&argc,argv,"pretty")) != FALSE ) show_pretty = TRUE; if( (strip_out_boolean_argument(&argc,argv,"pep")) != FALSE ) show_pep = TRUE; if( (strip_out_boolean_argument(&argc,argv,"mul")) != FALSE ) make_anchored_aln = TRUE; if( (strip_out_boolean_argument(&argc,argv,"para")) != FALSE ) show_para = TRUE; if( (strip_out_boolean_argument(&argc,argv,"sum")) != FALSE ) show_match_sum = TRUE; if( (strip_out_boolean_argument(&argc,argv,"alb")) != FALSE ) show_AlnBlock = TRUE; if( (strip_out_boolean_argument(&argc,argv,"pal")) != FALSE ) show_PackAln = TRUE; if( (temp = strip_out_assigned_argument(&argc,argv,"divide")) != NULL ) divide_str = temp; if( (temp = strip_out_assigned_argument(&argc,argv,"block")) != NULL ) main_block_str = temp; if( (temp = strip_out_assigned_argument(&argc,argv,"report")) != NULL ) report_str = temp; dbsi = new_DBSearchImpl_from_argv(&argc,argv); dpri = new_DPRunImpl_from_argv(&argc,argv); strip_out_remaining_options_with_warning(&argc,argv); if( argc != 3 ) { warn("Wrong number of arguments (expect 2)!\n"); if( argc > 1 ){ warn("Arg line looked like (after option processing)"); for(i=1;i<argc;i++) { fprintf(stderr," %s\n",argv[i]); } } show_short_help(); } if( show_pretty == FALSE && show_AlnBlock == FALSE && show_PackAln == FALSE && show_pep == FALSE ) { show_pretty = TRUE; show_para = TRUE; } if( use_db_pro == FALSE && use_single_pro == FALSE && use_tsm == FALSE && use_pfam1 == FALSE && use_pfam2 == FALSE ) { use_single_pro = TRUE; } if( use_single_pro == TRUE || use_tsm == TRUE ) { if( use_single_dna == TRUE ) fatal("one on one search. Shouldn't you use pcwise?"); search_mode = PC_SEARCH_S2DB; } else { if( use_single_dna == TRUE ) search_mode = PC_SEARCH_DB2S; else search_mode = PC_SEARCH_DB2DB; } if( evalue_search_str != NULL && search_mode != PC_SEARCH_S2DB ) { fatal("Trying to set a evalue cutoff on a non evalue based search. you can only use evalues in a protein HMM vs DNA database search (sorry!)"); } if( make_anchored_aln == TRUE && search_mode != PC_SEARCH_S2DB ) { fatal("Trying to make an anchored alignment and not in single search mode"); } if( make_anchored_aln == TRUE) { do_complete_analysis = TRUE; } /* pick up remaining args and do it */ dna_seq_file = argv[2]; protein_file = argv[1]; if( build_objects() == FALSE) fatal("Could not build objects!"); if( build_db_objects() == FALSE) fatal("Could not build database-ready objects!"); show_header(stdout); if( search_db() == FALSE) warn("Could not search database"); show_output(); free_objects(); return 0; }