1 / 8

Command line parsing Morten Nielsen BioSys, DTU

Command line parsing Morten Nielsen BioSys, DTU. Example. Blast command-line options. blastpgp - blastpgp 2.2.18 arguments: -d Database [String] default = nr -i Query File (not needed if restarting from scoremat) [File In] Optional default = stdin

harva
Download Presentation

Command line parsing Morten Nielsen BioSys, DTU

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Command line parsingMorten NielsenBioSys, DTU

  2. Example. Blast command-line options blastpgp - blastpgp 2.2.18 arguments: -d Database [String] default = nr -i Query File (not needed if restarting from scoremat) [File In] Optional default = stdin -A Multiple Hits window size [Integer] default = 40 -f Threshold for extending hits [Integer] default = 11 -e Expectation value (E) [Real] default = 10.0 -m alignment view options: ....

  3. How is command-line done in C? /* M.Nielsen July 2008, mniel@cbs.dtu.dk */ #include <stdio.h> main( int argc, char *argv[] ) { printf( "Hello World\n" ); }

  4. What are: int argc, char *argv[]? fasta_align -m BLOSUM50 -gf 5 -gn 1 1PLC._.fsa 1PLB._.fsa Argc: Number of argument. Here 9 First argument is program name Argv: Parameter names argv[0] = fasta_align_db argv[1] = -m fasta_align_db -m BLOSUM50 -gf 5 -gn 1 1PLC._.fsa 1PLB._.fsa argv[0] argv[1] argv[2] argv[6] argv[7] argv[8] argv[4] argv[3] argv[5]

  5. Example (The parser! ) fasta_align -m BLOSUM62 1PLC._.fsa 1PLB._.fsa float p_gapf; float p_gapn; int p_minall; FILENAME p_blmat; int p_verbose; PARAM param[] = { "-gf", VFLOAT p_gapf, "penalty for first gap", "11", "-gn", VFLOAT p_gapn, "penalty for next gap", "1", "-mal", VINT p_minall, "Minimum alignment lenght", "3", "-m", VFNAME p_blmat, "Alignment matrix", "BLOSUM50", "-v", VSWITCH p_verbose, "Verbose mode", "0", 0 }; p_blmat = “BLOSUM50” p_gapf = 11 p_gapn = 1 p_minall = 3 p_verbose = 0

  6. Example (The parser! ) fasta_align -m BLOSUM50 -gf 5 -gn 1 1PLC._.fsa 1PLB._.fsa float p_gapf; float p_gapn; int p_minall; FILENAME p_blmat; int p_verbose; PARAM param[] = { "-gf", VFLOAT p_gapf, "penalty for first gap", "11", "-gn", VFLOAT p_gapn, "penalty for next gap", "1", "-mal", VINT p_minall, "Minimum alignment lenght", "3", "-m", VFNAME p_blmat, "Alignment matrix", "BLOSUM50", "-v", VSWITCH p_verbose, "Verbose mode", "0", 0 }; p_blmat = “BLOSUM50” p_gapf = 5 p_gapn = 1 p_minall = 3 p_verbose = 0

  7. After - pparse(&argc, &argv, param, 2, "fsa1 fsa2"); fasta_align 1PLC._.fsa 1PLB._.fsa argv[0] argv[1] argv[2] argc = 3 Example (main(int argc, char *argv[]) ) Before fasta_align -m BLOSUM50 -gf 5 -gn 1 1PLC._.fsa 1PLB._.fsa argv[0] argv[1] argv[2] argv[6] argv[7] argv[8] argv[4] argv[3] argv[5] argc = 9

  8. Example (main(int argc, char *argv[]) ) fasta_align 1PLC._.fsa 1PLB._.fsa argv[0] argv[1] argv[2] q_fsa = fsalist_read( argv[1] ) ): db_fsa = fsalist_read( argv[2] );

More Related