This notebook just illustrates the basics of using bendIt on the command line in this environment.
The notebook in which active sessions start with here is meant to illustrate a realistic pipeline using bendIt
in conjunction with the Jupyter environment. That is meant to give a taste of what is possible by having the command line version of bendIt
alongside Jupyter environemnt while providng a basis for adapting your own pipelines. However, you may be familiar with bendIt on the command line already and wondering how to use it in Jupyter in the browser. This is meant to help with that. Plus, it could be useful for those looking to understand why I insist adding in taking advatage in Jupyter makes things better because in this example we'll keep use of things beyond the command line bendIt
minimal.
If you haven't used one of these notebooks before, they're basically web pages in which you can write, edit, and run live code. They're meant to encourage experimentation, so don't feel nervous. Just try running a few cells and see what happens!.
Some tips:
!bendIt --help
******************************************************************************** Usage: bendIt [options] To run the program gnuplot have to be installed The program will generate two output files: a text file used to run gnuplot and the resulting image bendIt options: -h, --help Display this usage information. -s, --seq File in FASTA with the sequence -o, --output Output file (Text file used to create the gnuplot script) -S, --Scale Scale to be used (values: Consensus OR DNaseI OR Nucleosome) Default: Consensus -c, --cwindows Curvature window size (Default: 31) -b, --bwindows Bendability/G+C content/Complexity window size (Default: 31) -t, --type Plot type (values: 1D OR 2D) Default: 1D -1, --smooth1 Smooth1 (values: none, simple, cubic, bezier) Default: none -2, --smooth2 Smooth2 (values: none, simple, cubic, bezier) Default: none -g, --complexity Complexity (values: G (G+C content), B (Bendability), C (Complexity)) Default: G --xmin X min --xmax X max --ymin Y min --ymax Y max --y2min Y2 min --y2max Y2 max ******************************************************************************** Roberto Vera Alvarez (e-mail: Roberto.Vera@icgeb.org) ********************************************************************************
Note that in order execute a command on the command line, we added an exclamation point in front of the command so that the contents of the Jupyter notebook cell are run in a shell process. If this were being used in the terminal here bendIt --help
would suffice.
(And other options exist for specifying to run in the shell such as the use of %%bash
on the first line of a cell to send all contents to the shell.)
The authors provided a test
directory with a FASTA file that can be used as input, and they also included an example output from running that test for comparing to generated output. Because the command line version makes a couple of files, we'll use the next cell to print the contents of the current working directory to monitor that progress.
(Note: The shell command ls
is one of a handful of special shell commands supported in Jupyter notebooks without needing an exclamation point in front of it, and indeed output renders with a richer feature st, such as directories being highlighted with colors, when just ls
is used as opposed to !ls
.)
ls
apt.txt bendit-index.ipynb README.md basic_bendit_commandline.ipynb demo_sample_set.fa requirements.txt bendit/ index.ipynb bendIt_analysis.ipy postBuild*
As an example of using bendIt
via the command line, using that input a minimal example that leaves all other settings as the default is run on the next cell. From the USAGE block above, you'll note that all that is needed is to specify the input file and a name of an output file to write. We'll provide the path to the provided FASTA file, t.fasta
in a sub-directory.
!bendIt -s bendit/test/t.fasta -o test_output
bend.it @ ICGEB Trieste, (c) 2015, R. Vera & S. Pongor This is a result for your query sequence "CP002684.1" (2380 bp) You requested a tabulated output of G+C content and Predicted curvature Parameters: Profile: Consensus Predicted curvature window size: 31 Bendability window size: 31 =================================================== Column 1 = Position Column 2 = Sequence Column 3 = Predicted curvature Column 4 = G+C content --------------------------------------------------- Ranges: Nucleotide: Automatic G+C content: Automatic Predicted curvature: Automatic Running gnuplot
To most easily see it ran, check the contents of the directory again by running the following cell:
ls
apt.txt bendit-index.ipynb README.md basic_bendit_commandline.ipynb demo_sample_set.fa requirements.txt bendit/ index.ipynb test_output bendIt_analysis.ipy postBuild* test_output.png
Note the addition of test_output
and test_output.png
to the files that had been listed in the directory when ls
was previously run.
Example the generated plot test_output.png
. (Normally, I'd suggest running the following code to do that, but becasue it relies on Python/Jupyter and I am trying to keep their use to a minimum for contrast, I leave that to reader to try if desired. It is also possible using the markdown ![](test_output.png)
to view the plot right here in the notebook.)
from IPython.display import Image
Image("test_output.png")
I leave it an as exercise for the reader to compare test_output
to the file text_out
in bendit/test
subdirectory.
I suggest next checking out the more realistic example of using bendIt here if you haven't yet.
Enjoy.