Presentation is loading. Please wait.

Presentation is loading. Please wait.

Command line parsing Morten Nielsen BioSys, DTU. Example. Blast command-line options blastpgp - blastpgp 2.2.18 arguments: -d Database [String] default.

Similar presentations


Presentation on theme: "Command line parsing Morten Nielsen BioSys, DTU. Example. Blast command-line options blastpgp - blastpgp 2.2.18 arguments: -d Database [String] default."— Presentation transcript:

1 Command line parsing Morten Nielsen BioSys, 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 main( int argc, char *argv[] ) { printf( "Hello World\n" ); }

4 What are: int argc, char *argv[]? fasta_align_db -m BLOSUM50 -gf 5 -gn 1 1PLC._.fsa 1PLB._.fsa argv[0]argv[1] argv[3] argv[2] argv[4] argv[5] argv[7]argv[6]argv[8] 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

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

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


Download ppt "Command line parsing Morten Nielsen BioSys, DTU. Example. Blast command-line options blastpgp - blastpgp 2.2.18 arguments: -d Database [String] default."

Similar presentations


Ads by Google