1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
/*===========================================================================
*
* PUBLIC DOMAIN NOTICE
* National Center for Biotechnology Information
*
* This software/database is a "United States Government Work" under the
* terms of the United States Copyright Act. It was written as part of
* the author's official duties as a United States Government employee and
* thus cannot be copyrighted. This software/database is freely available
* to the public for use. The National Library of Medicine and the U.S.
* Government have not placed any restriction on its use or reproduction.
*
* Although all reasonable efforts have been taken to ensure the accuracy
* and reliability of the software and data, the NLM and the U.S.
* Government do not and cannot warrant the performance or results that
* may be obtained by using this software or data. The NLM and the U.S.
* Government disclaim all warranties, express or implied, including
* warranties of performance, merchantability or fitness for any particular
* purpose.
*
* Please cite the author in any work or product based on this material.
*
* ===========================================================================
*
*/
This file contains instructions on running NGS Python example programs.
Once installed, the source code is contained in *.py files. Each source file corresponds to a separate example that demonstrates use of a particular feature of the NGS Python API.
To be run, the examples require python3 installed and in PATH. See 4) below for a way to override.
In order to run Python examples, the NGS package needs to be installed. To install, run the following commands:
cd <path-to-sra-tools>/ngs/ngs-python
python3 setup.py install --user
<path-to-sra-tools> should point to the root of the root directory of the source checkout (not the installation location)
1. Run all
- run "make". This will run all examples with their predefined arguments. The output of all the examples goes to stdout.
2. Run and diff
- run "make run_and_diff". This will execute all the examples with their predefined arguments, run them, capture the output in a temporary file, and then use "diff" to compare the actual output against a file containing the expected output (./expected.txt). Any discrepancies will be displayed. If the actual output matches the expected, there will be a message "NGS Python examples work as expected" at the end of the execution.
3. Run separately
- run "make <example>" where <example> is one of "run_frag", "run_align", "run_align_slice", "run_pileup", "run_ref". This will run the selected example with some predefined arguments.
- In order to run an individual example with custom arguments, do so using Python from the command line, e.g.
python3 AlignTest ERR225922 10000 2
- When run without arguments, the examples will output a very short description of the required parameters.
4. Alternative Python Interpreter
- By default, the makefile invokes Python as "python3".
- To change that, specify makefile variable PYTHON to point to an alternative path to the Python interpreter, e.g. "make PYTHON=/usr/bin/python"
- Note that the examples will not work using versions of Python older than 3.6.
|