pcingola / BigDataScript

BigDataScript: Scirpting language for big data
92 stars 21 forks source link

automatic cmd line help suggestions #99

Closed leepc12 closed 9 years ago

leepc12 commented 9 years ago

Automatic command line help is one of the nice features in BDS. I would like to

1) make bool help item show its type

2) sort help items in a specific order (I want to give each item an index) not by alphabetical one. It looks like items are not organized well in an alphabetical order.

$ bds tf_chipseq.bds -h
Picked up _JAVA_OPTIONS: -Xms256M -Xmx512M -XX:ParallelGCThreads=1
Command line options 'tf_chipseq.bds' :
    -bedgraph               : Set it true to create bedgraph (default: false).
    -bigwig                 : Set it true to convert bedgraph to bigwig signal track (default: false).
    -c <string>             : Configuration file path (if not specified, define parameters in command line argument).
    -chrsz <string>         : Path for chrom.sizes file for your sequence files.
    -ctl_fastq1 <string>    : Path for control fastq for replicate 1 (single ended).
    -ctl_fastq1_1 <string>  : Path for control fastq for replicate 1 pair 1 (paired-end).
    -ctl_fastq1_2 <string>  : Path for control fastq for replicate 1 pair 2 (paired-end).
    -ctl_fastq2 <string>    : Path for control fastq for replicate 2 (single ended).
    -ctl_fastq2_1 <string>  : Path for control fastq for replicate 2 pair 1 (paired-end).
    -ctl_fastq2_2 <string>  : Path for control fastq for replicate 2 pair 2 (paired-end).
    -dup_rm                 : Set it true if dupes are removed when aligning (default: true).
    -fastq1 <string>        : Path for input fastq for replicate 1 (single ended).
    -fastq1_1 <string>      : Path for input fastq for replicate 1 pair 1 (paired-end).
    -fastq1_2 <string>      : Path for input fastq for replicate 1 pair 2 (paired-end).
    -fastq2 <string>        : Path for input fastq for replicate 2 (single ended).
    -fastq2_1 <string>      : Path for input fastq for replicate 2 pair 1 (paired-end).
    -fastq2_2 <string>      : Path for input fastq for replicate 2 pair 2 (paired-end).
    -idr_thresh <string>    : IDR thresh (default: 0.02).
    -idx_bwa <string>       : Path for bwa index.
    -mapq_thresh <int>      : MAPQ_THRESH (default: 30).
    -mem <int>              : Default max. memory in MB for all cluster jobs (default: 4G).
    -mod <string>           : Modules separated by ; (example: "bowtie/2.2.4; bwa/0.7.7; picard-tools/1.92").
    -npeak <int>            : Parameter for -npeak in phantompeakqual tool run_spp.R (default: 300000).
    -nreads <int>           : Parameter for NREADS (default. 15000000).
    -nth <int>              : Default number of threads for all cluster jobs (default: 1).
    -nth_bwa <int>          : Number of threads for bwa aln (default: 4).
    -nth_spp <int>          : Number of threads for run_spp.R (default: 4).
    -num_rep <int>          : # of replicates, set it only for qc = true. (default: 1).
    -o <string>             : Output directory. (default: out)
    -param_bwa <string>     : Parameters for bwa align (default: "-q 5 -l 32 -k 2" ).
    -prefix <string>        : Prefix for all outputs.
    -qc                     : Set it true to test-run and stop before peak calling, false: keep going through IDR (default: false).
    -seq <string>           : Dir. for sequence files (for hg19, dir where chr*.fa exist).
    -shcmd <string>         : Shell cmds separated by ;. Env. vars should be written as ${VAR} not as $VAR (example: "export PATH=${PATH}:/usr/test; VAR=test").
    -tmp <string>           : Temporary directory for intermediate files. (default: tmp).
    -umap <string>          : Path for umap (for hg19, path for globalmap_k20tok54).
    -wig                    : Set it true to create wig (default: false).
    -wt <int>               : Default walltime in seconds for all cluster jobs (default: 36000).

3) automatically show help if args.size() == 0?

if ( arg.size() == 0 ) {
   show_help()
   exit(0)
}

4) add header showing information of the script (version, author and so on)

pcingola commented 9 years ago

Hi, sorry for the long delay answering, I was out of town. Did you close this because you no longer think your suggestions are useful/needed? I found them quite interesting and I was planning on implementing them....