AFNI program: apsearch

Output of -help



A program to perform simple approximate string searching. It's primary
purpose is to test string matching for atlas area locations.

  apsearch <-word WORD> <[-file FILE] | [-text TEXT] | [-phelp PROG]> 
           [OPTIONS]

Parameters:
===========
  -word WORD: WORD being sought
  -w WORD: Abbreviated version of -word WORD
  -file FILE: Search for WORD in text file FILE
  -files FILE1 FILE2 ...: Search for WORD in text files FILE1 FILE2 ...
  -text TEXT: Search for WORD in string TEXT
  -stdin: Search for WORD in text from stdin
  -: Same as -stdin
  -phelp PROG: Search for WORD in output of command PROG -help
  -popt PROG: Search for possible options of PROG that match WORD
              Make sure you add the '-' to WORD if you are looking
              for an actual option.
  -all_afni_help: Search for WORD in all afni help files.
                  This option is not all that clever at the moment.
  -all_popts PROG: TRY to guess at all the options for PROG
                  The list of options is not guaranteed to be full
                  or accurate. It is created by parsing the program's
                  -help output for likely candidates. 
                  It is meant to act as an aid in locating
                  certain options.
  -list_popts PROG: Like -all_popts, but preserve unique set of options
                    only, no chunks of help output are preserved.
  -popts_complete_command PROG: Generate a csh command that can be sourced
                                to allow option autocompletion for program
                                PROG.
                          See also option -bash and -update_all_afni_help
  -bash: Use bash format for the complete command. Default is csh/tcsh
         This option MUST PRECEDE option -popts_complete_command
  -ci: Case insensitive search (default)
  -cs: Case sensitive search
  -help: You're looking at it.
  -max_hits MH: Return best MH hits only. Default MH = 3.
                Use -1 to get all results back.
  -m MH: Abbreviated version of -max_hits MH.
  -min_different_hits mDH: Keep outputing hits until you have dDH
                           dissimilar matches. 
                           Default is -1 (no minimum).
  -unique_hits_only: Restrict output to novel hits only.
  -show_score: Show matching word's distance.
  -show_score_detail: That's right.
  -list_all_afni_progs: List all executables in AFNI's bin directory
  -list_all_afni_P_progs: Same as -list_all_afni_progs but with path
  -list_all_afni_readmes: List all README files in AFNI's bin directory
  -list_all_afni_P_readmes: Same as -list_all_afni_readmes but with path
  -list_all_afni_dsets: List all datasets in AFNI's bin directory
  -list_all_afni_P_dsets: Same as -list_all_afni_dsets but with path
  -update_all_afni_help: Build/update -help output under directory:
                     /home/rwcox/.afni/help
                  If older help files differ by little they are deleted
                  Little differences would be the compile date or the
                  version number. See @clean_help_dir code for details.
                  This option also creates autocompletion code for 
                  csh/tcsh and bash shells.
  -recreate_all_afni_help: Like -update_all_afni_help but force receration
                           even if nothing changed in the help
  -afni_help_dir: Print afni help directory location and quit.
  -afni_bin_dir: Print afni's binaries directory location and quit.
  -afni_home_dir: Print afni's home directory and quit.
  -afni_rc_file: Pathname to .afnirc. You'll get one even if none exists.
  -afni_custom_atlas_dir: Print your afni's custom atlas directory 
                          and quit.
  -afni_custom_atlas_file: Print your afni's custom atlas file (if any)
                          and quit.
  -afni_text_editor: Print the name of the GUI editor. Priority goes to 
                     env. variable AFNI_GUI_EDITOR, otherwise afni
                     will try to find something suitable.
  -view_text_file FILE: Open FILE with editor of -afni_text_editor
  -view_readme SOMETHING: Find a readme.SOMETHINGISH and open it
  -apsearch_log_file: Print the name of the logfile that is used to save
                      some results of apsearch's functions. This option
                      is for debugging purposes and is only activated if
                      the environment variable AFNI_LOG_BEST_PROG_OPTION
                      is set to YES.
  -view_prog_help PROG: Open the help file for PROG in a GUI editor.
                        This is like the option -h_view in C programs.
  -web_prog_help PROG: Open the help file for PROG in a web brower.
                       This is like the option -h_web in C programs.
              Use ALL to view the page containing help for all programs.
  -web_class_docs: Open the webpage with latest class pdfs.

  NOTE: The maximum number of results depends on the combination of
        -max_hits, -min_different_hits, and -unique_hits_only. 
        Withoug -unique_hits_only, the output will continue 
        while neither -max_hits or -min_different_hits conditions 
        are met.

  -func_test: Run sample function testing and quit. Debugging only.

Examples:
=========
 1- Search help output of program whereami for the word '-atlas'
        apsearch -ci -phelp whereami -word -atlas
 2- Search all atlas area names for some name (mistakes on purpose)
        whereami -show_atlas_code > all_atlas_area_names.txt
        apsearch -file all_atlas_area_names.txt -word hepp
        apsearch -file all_atlas_area_names.txt -word zipp \
                  -min_different_hits 5 -unique_hits_only 
        apsearch -file all_atlas_area_names.txt -word hipp \
                  -min_different_hits 5 -unique_hits_only 
 3- Debug stupid string matcher:
        apsearch -text 'u:Hippocampus' -word hipp -show_score_detail
        apsearch -text 'u:IPC' -word hipp -show_score_detail
 4- Search help of AFNI programs:
        apsearch -phelp afni -word port
        apsearch -phelp 3dSkullStrip -word hull
        apsearch -phelp afni  -word xt
 5- Suggest a valid option from a program:
        apsearch -popt afni -word xt
        apsearch -popt @ROI_Corr_Mat -word sel
        apsearch -popt @ROI_Corr_Mat -word -sel
 6- Show all(*) options for a program:
        apsearch -all_popts 3dSkullStrip
    (*) see -all_popts in help section
 7- Look for some area named something or other in some atlas:
        whereami -show_atlas_code -atlas DKD_Desai_MPM |\
                                apsearch -stdin -word insola
    If you really screw up the spelling, you should help the search
    program a little as in:
        whereami -show_atlas_code -atlas DKD_Desai_MPM |\
                                sed 's/[-_]/ /g' |\
                                apsearch -stdin -word insolent
 8- Find 10 afni programs with something like 'Surface' in their names:
        apsearch -list_all_afni_progs | \
             apsearch -stdin -word surface -max_hits 10
 9- Open the readme for driving AFNI:
        apsearch -view_readme driv

Global Options:
===============
   -overwrite: Overwrite existing output dataset.
               Equivalent to setting env. AFNI_DECONFLICT=OVERWRITE
   -ok_1D_text: Zero out uncommented text in 1D file.
                Equivalent to setting env. AFNI_1D_ZERO_TEXT=YES
   -Dname=val: Set environment variable 'name' to value 'val'
             For example: -DAFNI_1D_ZERO_TEXT=YES
   -Vname=: Print value of environment variable 'name' to stdout and quit.
            This is more reliable that the shell's env query because it would
            include envs set in .afnirc files and .sumarc files for SUMA
            programs.
             For example: -VAFNI_1D_ZERO_TEXT=
   -all_opts: Try to identify all options for the program from the
              output of its -help option. Some options might be missed
              and others misidentified. Use this output for hints only.
   -h_find WORD: Look for lines in this programs's -help output that match
                 (approximately) WORD.
   -h_view: Open help in text editor. AFNI will try to find a GUI editor
            on your machine. You can control which it should use by
            setting environment variable AFNI_GUI_EDITOR.
   -h_web: Open help in web browser. AFNI will try to find a browser
            on your machine. You can control which it should use by
            setting environment variable AFNI_GUI_EDITOR.
   -skip_afnirc: Do not read the afni resource (like ~/.afnirc) file.
   -pad_to_node NODE: Output a full dset from node 0 to MAX_NODE-1
                   ** Instead of directly setting NODE to an integer you 
                      can set NODE to something like:
                   ld120 (or rd17) which sets NODE to be the maximum 
                      node index on an Icosahedron with -ld 120. See 
                      CreateIcosahedron for details.
                   d:DSET.niml.dset which sets NODE to the maximum node found
                      in dataset DSET.niml.dset.
                   ** This option is for surface-based datasets only.
                      Some programs may not heed it, so check the output if
                      you are not sure.
   -pif SOMETHING: Does absolutely nothing but provide for a convenient
                   way to tag a process and find it in the output of ps -a
   -echo_edu: Echos the entire command line to stdout (without -echo_edu)
              for edification purposes


++ Compile date = May 10 2013


This page auto-generated on Sat May 11 16:35:47 EDT 2013