Appendix B: Getting Python 3.x On Your Computer

B.1 Get Anaconda Python

  • Although there are several different ways to “get” Python, I am going start by recommending Anaconda Python.
  • Anaconda Python is from a company called Continuum Analytics which specializes in open source Python software and support.
https://www.continuum.io Download Page
https://www.continuum.io Download Page
  • Continuum has easily installable Python packages for Macs, Linux, and Windows.
  • Download the Python 3.x version for your operating system.
  • Choose 32 or 64 bit versions, depending on your computer.
https://www.continuum.io Download Page
https://www.continuum.io Download Page
Once you download the Anaconda installer, Install the .exe.
Benefits Of Anaconda
Anaconda Contains:
Package Title Example(s) / Uses
Biopython FASTA, GenBank & alignment tools
Jupyter / IPython Notebooks Work & immediately see your results!
Spyder An advanced environment for writing Python
Numpy N-dimensional arrays
MatPlotLib Plot & make graphics
Scikit Learn Machine learning tools
Pandas Work with data structures
EVEN Git Save your work!

NOTE: The websites for each package or module or library is a good place to start reading & learning about what each does.

So your alternative is to download all these packages and update them yourself or just USE: Anaconda.

What Makes The Computer Language Python Good?

  1. It is easy use & read because it uses indentation
  2. Runs on Mac, Windows & Linux …
  3. “Interpreted” NOT “Compiled”
  4. Python is interactive, therefore you can see your results right away!
  5. It has many libraries which can help you with databases, math functions, as mentioned above.

B.2 Excellent Learning Resources:

  1. Home of Python
  2. Find Python 3.x Documentation Here
  3. Learn Python
  4. Think-Python
  5. Learn Python the Hard Way # Very good site despite the name.
  6. Codecademy
  7. Dive into Python
  8. Code School
  9. This is course material suggested # Steven Salzberg
  10. Python Scientific Lecture Notes # If you don’t read anything else, read these.
  11. NumPy for Matlab users START here.
  12. Lectures on Scientific Computing # Great Python Jupyter Notebooks.
  13. A Byte of Python # A very good book, at the introductory level.
  14. StackOverflow

B.3 The Very Basics of Programming Strategies

General Steps
  1. Identify the required inputs, such as data or specifications
  2. Make an overall design for the program, including listing all the steps by which the program computes the output.
  3. Decide what will be the output of the program.
  4. Refine the overall design by specifying more detail.
  5. Write the program.
  • Adapted from Beginning Perl for Bioinformatics by James Tisdall, O’Reilly Media, Inc., 2001
Designing a Program

Write pseudocode for a program that computes the GC percentage composition of a DNA sequence:

  1. read DNA sequence from user, dna = open(“dna.txt”)
  2. count the number of C’s in DNA sequence, dna.count(“C”)
  3. count the number of G’s in DNA sequence,dna.count(“G”)
  4. determine the length of the DNA sequence, len(dna)
  5. compute the GC%, g_c_content = \( \frac{(dna.count("C") + dna.count("G"))}{len(dna)} \)
  6. print GC%