Genome Sciences 373 Genome Informatics Quiz Section 4 April 21, 2015.

Slides:



Advertisements
Similar presentations
PYTHON FRUITFUL FUNCTIONS CHAPTER 6 FROM THINK PYTHON HOW TO THINK LIKE A COMPUTER SCIENTIST.
Advertisements

CMSC 104, Version 9/011 Arithmetic Operators Topics Arithmetic Operators Operator Precedence Evaluating Arithmetic Expressions In-class Project Incremental.
Managing Your Learners In this guide you will learn how to: Add classes to the Manage Your Learners page Add learners to the Manage Your Learners page.
Sequence comparison: Introduction and motivation Genome 559: Introduction to Statistical and Computational Genomics Prof. James H. Thomas.
Genome Sciences 373 Genome Informatics Quiz Section 5 April 28, 2015.
Genome Sciences 373 Genome Informatics Quiz Section 3 April 14, 2015.
S. Maarschalkerweerd & A. Tjhang1 Probability Theory and Basic Alignment of String Sequences Chapter
CS 106 Introduction to Computer Science I 02 / 28 / 2007 Instructor: Michael Eckmann.
1.9 Methods academy.zariba.com 1. Lecture Content 1.What is a method? Why use methods? 2.Void Methods and methods with parameters 3.Methods which return.
Genome Sciences 373 Genome Informatics Quiz Section 2 April 7, 2015.
Developing Pairwise Sequence Alignment Algorithms Dr. Nancy Warter-Perez May 10, 2005.
Please open your laptops, log in to the MyMathLab course web site, and open Daily Quiz 16. IMPORTANT NOTE: If you have time left out of your five minutes.
Sequence comparison: Local alignment
If you did the extra credit assignment, please turn in your worksheets now. No late submissions will be accepted. Your score on this worksheet will be.
Genome Sciences 373 Genome Informatics Quiz Section 9 May
Please open your laptops, log in to the MyMathLab course web site, and open Quiz 2.6/9.1. IMPORTANT NOTE: If you have time left after you finish the problems.
Genome Sciences 373 Genome Informatics Quiz Section 5 April 28, 2015.
Motif search and discovery Prof. William Stafford Noble Department of Genome Sciences Department of Computer Science and Engineering University of Washington.
Please open your laptops and pull up Quiz 7.1. If you have any time left after finishing the quiz problems, CHECK YOUR FACTORING before you submit the.
Sequence comparison: Local alignment Genome 559: Introduction to Statistical and Computational Genomics Prof. William Stafford Noble.
Bioiformatics I Fall Dynamic programming algorithm: pairwise comparisons.
Traceback and local alignment Prof. William Stafford Noble Department of Genome Sciences Department of Computer Science and Engineering University of Washington.
Section 8.1/8.2 Matrix Solutions to Linear Systems Inconsistent and Dependent Systems.
Nonvisual Arrays and Recursion by Chris Brown under Prof. Susan Rodger Duke University June 2012.
Python Programming Chapter 6: Iteration Saad Bani Mohammad Department of Computer Science Al al-Bayt University 1 st 2011/2012.
Alignment methods April 26, 2011 Return Quiz 1 today Return homework #4 today. Next homework due Tues, May 3 Learning objectives- Understand the Smith-Waterman.
Scoring Matrices April 23, 2009 Learning objectives- 1) Last word on Global Alignment 2) Understand how the Smith-Waterman algorithm can be applied to.
Arithmetic Operators Topics Arithmetic Operators Operator Precedence
Please CLOSE YOUR LAPTOPS, and turn off and put away your cell phones, and get out your note- taking materials.
Oct 15, 2007Sprenkle - CS1111 Objectives Creating your own functions.
Q and A for Sections 2.9, 4.1 Victor Norman CS106 Fall 2015.
Functions. Built-in functions You’ve used several functions already >>> len("ATGGTCA")‏ 7 >>> abs(-6)‏ 6 >>> float("3.1415")‏ >>>
Ch. 10 For Statement Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2012.
CMSC 104, Version 8/061L10ArithmeticOps.ppt Arithmetic Operators Topics Arithmetic Operators Operator Precedence Evaluating Arithmetic Expressions In-class.
1 Printing in Python Every program needs to do some output This is usually to the screen (shell window) Later we’ll see graphics windows and external files.
HW4: sites that look like transcription start sites Nucleotide histogram Background frequency Count matrix for translation start sites (-10 to 10) Frequency.
Please CLOSE YOUR LAPTOPS, and turn off and put away your cell phones, and get out your note- taking materials.
Debugging and Printing George Mason University. Today’s topics Review of Chapter 3: Printing and Debugging Go over examples and questions debugging in.
Thinking about programming Intro to Computer Science CS1510 Dr. Sarah Diesburg.
Logical Operators.  Quiz  Let's look at the schedule  Logical Operators 2.
This is what we want to produce Import sketch dimensions Label angles Set the scale Add linear dimensions.
Answer these quick fire questions on your mini whiteboards.
Q and A for Sections 2.9, 4.1 Victor Norman CS106 Fall 2015.
Start the Quiz Show the answer Check the answer Time’s up! Timer
♣Multiplying Decimals♣
© Mark E. Damon - All Rights Reserved Add © All rights Reserved Your Name Topic of Game.
Math operations 9/19/16.
Pairwise sequence comparison
WELCOME TO HANDS-ON MATHS
Introduction to Programming
Algorithmic complexity: Speed of algorithms
For loops Genome 559: Introduction to Statistical and Computational Genomics Prof. William Stafford Noble.
(optional - but then again, all of these are optional)
(optional - but then again, all of these are optional)‏
Sequence comparison: Dynamic programming
Arithmetic Operators Topics Arithmetic Operators Operator Precedence
Arithmetic Operators Topics Arithmetic Operators Operator Precedence
For loops Genome 559: Introduction to Statistical and Computational Genomics Prof. William Stafford Noble Notes for 2010: I skipped slide 10. This is.
Functions and Procedures
Teaching London Computing
Introduction to Python: Day Three
Introduction to Programming
Algorithmic complexity: Speed of algorithms
Notes about Homework #4 Professor Hugh C. Lauer CS-1004 — Introduction to Programming for Non-Majors (Slides include materials from Python Programming:
LONG MULTIPLICATION is just multiplying two numbers.
Algorithmic complexity: Speed of algorithms
Mrs. Dhillon’s Classroom An Introduction to Multiplication Algorithms
Introduction to Programming
Python Creating a calculator.
Lecture 6 - Recursion.
Presentation transcript:

Genome Sciences 373 Genome Informatics Quiz Section 4 April 21, 2015

Topics today Questions about homework Smith-Waterman algorithm: local alignment Reading files in python Functions in python

Smith-Waterman alignment Local alignment means: –We don’t have to end at the bottom right –We don’t have to end at the top left Best alignment may only be a single pair of nucleotides!

S-W: what to check when finished All cells with positive numbers should have arrows pointing in –(how did I get here?) …but not necessarily pointing out Calculate the alignment score by hand and double-check your work

ACGT A4-20 C4 0 G4 T4 Let’s align two sequences: CGTTA & GACGT substitution matrix gap penalty -3, linear Note: they don’t have to be the same length!

CGTTA 0 G A C G T

CGTTA G 0 A 0 C 0 G 0 T 0

CGTTA G 00 A 0 C 0 G 0 T 0

CGTTA G 004 A 0 C 0 G 0 T 0

CGTTA G A C G T

CGTTA G A C G T

CGTTA G A C G T

CGTTA G A C G T

CGTTA G A C G T

CGTTA G A C G T

CGTTA G A C G T X

Best local alignment is: CGT

S-W: what to check when finished All cells with positive numbers should have arrows pointing in – (how did I get here?) …but not necessarily pointing out Calculate the alignment score by hand and double-check your work

Best local alignment is: CGT Calculate the score ACGT A4-20 C4 0 G4 T4 substitution matrix gap penalty -3, linear

CGCTA G A C G T Here we make a small change to one of the sequences

CGCTA G A C G T Note that our score drops and then goes up again!

align TGCATT and GGCA using Smith-Waterman local alignment Practice problem

align TGCATT and GGCA using Smith-Waterman local alignment Practice problem Answer : GCA with score = 9

my_filename = sys.argv[1] my_open_file= open(my_filename, “r”) # read just the first line my_first_line = my_open_file.readline() # now I can read another line my_second_line = my_open_file.readline() my_third_line = my_open_file.readline() Reading files: several options Example code to read just one line:

my_filename = sys.argv[1] my_open_file= open(my_filename, “r”) # read all of my file at once. # note: if your file is really big (like, say, >1Gb) # then you do NOT want to do this! my_entire_file = my_open_file.read() # split it into a list of strings my_lines = my_entire_file.split(“\n”) for my_line in my_lines: do_something() Reading files: several options Example code to read it all at once:

my_filename = sys.argv[1] my_open_file= open(my_filename, “r”) num_lines = 0 for my_line in my_open_file: my_line = my_line.strip() # chop off the “\n” at the end do_something() num_lines += 1 print “I found %d lines” % num_lines # alternative way for my_line in my_open_file.readlines(): my_line = my_line.strip() # chop off the “\n” at the end do_something() Reading files: several options Example code to read all lines, one at a time:

Functions in Python: a brief overview You’ve already seen several functions in python: int(argument)convert argument to an integer, return the integer float(argument)convert argument to a float, return the float len(argument)calculate the length of argument, return the length

Functions in Python: a brief overview Functions are: reusable pieces of code, that take zero or more arguments, perform some actions, and return one or more values

Functions in Python: a brief overview Functions are: reusable pieces of code, that take zero or more arguments, perform some actions, and return one or more values function “sum” takes arguments a, b adds a and b returns sum conceptually

Functions in Python: a brief overview Functions are: reusable pieces of code, that take zero or more arguments, perform some actions, and return one or more values function “sum” takes arguments a, b adds a and b returns sum conceptually def sum(a, b): total = a + b return total # later in the program my_sum = add(2, 5) # my_sum is now 7 in python…

Functions in Python: a brief overview Functions are: reusable pieces of code, that take zero or more arguments, perform some actions, and return one or more values def sum(a, b): total = a + b return total # later in the program my_sum = add(2, 5) print total # this won’t work! in python… stuff that happens in here is invisible outside of the function

In-class example: Write a function to calculate the factorial of an integer