WLF 448: Fish & Wildlife Population Ecology
Lab Notes 6, Fall 2004

In-class Exercise #6 (Lab 6):

Program CAPTURE

Scenario

Edwards and Eberhardt (1967) reported the results of a live-trapping study on a penned population of 135 cottontail rabbits. The wild cottontails were captured and placed in a 40-acre rabbit-proof enclosure. After allowing 4 days for the rabbits to adjust to their new surroundings, livetrapping was conducted for 18 consecutive days. The raw data are located in a file named rabbit.cap. We are going to use program 2CAPTURE to create an input file named captur#.inp. We will use this input file and program CAPTURE to estimate population size, calculate confidence intervals, and perform tests of closure and equal-catchability assumptions.

Copy files from class directory to your personal directory:

Data files (*.cap) and input files (*.inp)

  1. Use a text editor to view the raw data file named rabbit.cap. Note the format of the data (columns, spacing, binary code) - this is known as X matrix format.

  2. View the file peromysc.cap; these data are in X-Y reduced format (i.e., the data include information on x-y coordinates (trap location) of each capture for each animal).

  3. View the file microtus.inp . These data also are in X-Y reduced format; however, notice the "input" file contains command lines that will be operated on by program CAPTURE.

We will use program 2CAPTURE to convert rabbit.cap to an input file that contains command lines..

Program 2CAPTURE

  1. Start program 2CAPTURE by double clicking on the 2capture file name in your newly created 'capture' directory.  The main menu will appear, with a button-bar at the top of the screen.

  2. Select Title from the button-bar menu and enter "Rabbit Data <your name>" when prompted for a title. Hit 'enter' and then hit 'Y' to accept the title you typed or 'N' to change it.  Be sure to put your name in the title.

  3. Use right, left, up, and down arrows to move between the menus.  Select Read . Another menu list will appear.

  4. Select Occasions. This refers to the number of trapping occasions. Note: press F1 for information on a menu item. How many trapping occasions were there in this example?  Hit 'enter'. Hit 'Y' or 'N' to continue.

  5. Because data for this example do not include information on capture by trap coordinate (X-Y data), we cannot select Summary statistics.

  6. Select Input Type . Select X matrix from the list.

  7. The program will ask if you want to read the matrix from a file? Type 'Y' and then hit 'enter'

  8. The program will then ask you for the name of the input file. Type rabbit.cap and then hit 'enter'.

  9. It will ask if you would like to see the input data? Type Y for yes (notice the column number and range of the data). Exit the view screen by typing "x" (see prompt at bottom of screen).

  10. The program will then ask for the file format. This refers to the column numbers and type of data in those columns (see item 9 above). Enter the following: (T15, A3, 3X, 18F1.0). This tells the program: (1) skip to column 15 (i.e., T15), (2) there is an alpha-numeric identification in columns 15-17 (i.e., A3), (3) the next 3 columns are blank (i.e., 3X), (4) capture data consist of 1 character or number, begin in column 21, and continue for 18 columns (corresponding to trap day, i.e., 18F1.0)). Note: parentheses around the file format are required! Hit 'enter' and either 'Y' or 'N' to continue.

  11. Return to the main menu (use the escape key).

Setting the Analysis Options

  1. Select Testing.

  2. Select Model Selection (notice that it inserts a "task command" into the input file)..

  3. Do not select Occasions at this time. Note: this option is used if you want to restrict the analysis to specific trapping occasions, e.g., trap days 1-5 (versus 1-18).

  4. Select Closure Test. This option requests a test of the closure assumption. Type N for no occasions.

  5. Do not select Density. Note: this option is only available if trapping data include x-y coordinates (i.e., location of traps in a grid).

  6. Return to the main menu and select Estimation. This tells program CAPTURE what analysis options to use.

  7. Select Abundance.

  8. Do not select Occasions (not applicable in this case - we are using all trapping occasions)

  9. Select Estimators.

  10. Select Appropriate (this option tells program CAPTURE to select and use the most appropriate model to estimate abundance). Note: you may select >1 estimator. However, to keep things simple, choose "appropriate" to let the program select the model to use for estimation.

  11. Return to the main screen (press Esc until you are back at the main screen).

  12. You should see the selections you have chosen being added to the output window at the bottom of the 2CAPTURE window.  You are building the input format that is required for CAPTURE to run your file.

Creating the "input" file and invoking CAPTURE

If everything is okay, select Execute program under Execute.

NOTE: if your computer does not have enough working memory, program CAPTURE cannot be successfully invoked from within 2CAPTURE. You will get an error message to that effect (unable to spawn process press any key). Nevertheless, selecting "execute" will cause 2CAPTURE to create the input file captur#.inp.  You might also find that the capture#.inp file is in your directory, but does not contain your output.  If this is the case then you will need to try running CAPTURE in batch mode as described below.

If you experience the problem just described, exit 2CAPTURE and run CAPTURE in batch mode:

If you were successful in running CAPTURE from within 2CAPTURE, output will be sent to a file named captur#.out. You can browse this file in 2CAPTURE by looking under the Execute menu and choosing 'Browse program output'.  Alternatively, you can open the file in Notepad or Wordpad.

Notes regarding using the Patuxent Wildlife Research Center web site: If you continue to have problems producing output from CAPTURE, follow these instructions for obtaining output from the Patuxent Wildlife Research Center web site.  Before following these steps be sure to read the notes on running CAPTURE on this website in the Lab Notes for Lab 6 under IV-D.  Step 1.  Open your captur1.inp file in Notepad (or another text editor program).  Step 2.  On the second line of your captur1.inp file, remove the text 'FILE='rabbit.cap''.  Step 3.  Insert a line after your 'FORMAT' line and add the text 'read input data' on the line you just inserted.  Press enter.  Step 4.  Open the rabbit.cap file in Notepad.  Select all data lines.  Copy and insert all the data lines into your captur1.inp file immediately after the 'read input data' text line.  Make sure that at the bottom of the data lines, your  TASK lines are present immediately following the last data line.  Step 5.  Save your new input file.  Name it captur1web.inp.  Step 6.  Select all lines from captur1web.inp and paste it into the appropriate window on the Patuxent Wildlife Research Center web site. Step 7.  Click on ' Perform Analysis'. Once you have your results you will have to highlight all the lines in your results and copy and paste them to a new Notepad file.  Be sure to save this file. 

 

 
Note: Alternatively, if you still have not been able to obtain output from CAPTURE, completely delete your CAPTURE directory.  And then go back to the K:\WLF\448\Pre2004\CAPTURE directory and copy all the CAPTURE files again to your zip disk or H: drive.  This will provide you with a clean start to try again.  If you still continue to have problems, be sure to talk to your TA.  

Viewing Output and Interpretation of Results

  1. Use any text editor (e.g., Notepad) to view the output.  

  2. We will discuss interpretation of the output in class.

Microtus.inp: An example with additional analysis options

  1. View microtus.inp (a batch file, complete with data and command lines). Note the following:

  2. Run CAPTURE in batch mode using the input file named microtus.inp, i.e., at the DOS prompt type: capture i=microtus.inp o=microtus.out . Be sure to manuever to the correct directory using the directions under 'Creating the "input" file and invoking CAPTURE' section above.

  3. Alternatively you can follow the steps for running CAPTURE on the web.  See instructions in the Lab Notes for Lab 6 under IV-D.

  4. View the output. Take a look at the additional information provided by the Summary and Density options.

  5. We will discuss interpretation during class.

  Return to Lab Notes



Revised: 01 October 2004