MARC: Developing Bioinformatics Programs Alex Ropelewski PSC-NRBSC Bienvenido Vélez UPR Mayaguez Reference: How to Think Like a Computer Scientist: Learning.

Slides:



Advertisements
Similar presentations
Chapter 16 Recursion: Another Control Mechanism. "The Practice of Computing Using Python", Punch & Enbody, Copyright © 2013 Pearson Education, Inc. a.
Advertisements

Lecture 03 – Sequences of data.  At the end of this lecture, students should be able to:  Define and use functions  Import functions from modules 
MARC: Developing Bioinformatics Programs July 2009 Alex Ropelewski PSC-NRBSC Bienvenido Vélez UPR Mayaguez Reference: How to Think Like a Computer Scientist:
1 Essential Computing for Bioinformatics Bienvenido Vélez UPR Mayaguez Lecture 4 High-level Programming with Python Part I: Controlling the flow of your.
Python Programming Chapter 3: Functions Saad Bani Mohammad Department of Computer Science Al al-Bayt University 1 st 2011/2012.
Radians In a circle of radius 1 unit, the angle  subtended at the centre of the circle by the arc of length 1 unit is called 1 radian, written as 1 rad.
3.1 Radian Measure OBJ: Convert degree measure to radian measure Find trig values of angles expressed in radian measure.
Functions.
MARC: Developing Bioinformatics Programs July 2009 Alex Ropelewski PSC-NRBSC Bienvenido Vélez UPR Mayaguez Reference: How to Think Like a Computer Scientist:
 The following material is the result of a curriculum development effort to provide a set of courses to support bioinformatics efforts involving students.
Introduction to Functions Intro to Computer Science CS1510 Dr. Sarah Diesburg.
Introduction to Python 2 Dr. Bernard Chen University of Central Arkansas PyArkansas 2011.
FUNCTIONS. Function call: >>> type(32) The name of the function is type. The expression in parentheses is called the argument of the function. Built-in.
1 CSC 221: Introduction to Programming Fall 2012 Functions & Modules  standard modules: math, random  Python documentation, help  user-defined functions,
COMPE 111 Introduction to Computer Engineering Programming in Python Atılım University
Python – Part 3 Functions 1. Function Calls Function – A named sequence of statements that performs a computation – Name – Sequence of statements “call”
3.1 Radian Measure OBJ: Convert degree measure to radian measure Find trig values of angles expressed in radian measure.
Warm-Up Find the following. 1.) sin 30 ◦ 2.) cos 270 ◦ 3.) cos 135 ◦
 The following material is the result of a curriculum development effort to provide a set of courses to support bioinformatics efforts involving students.
MARC: Developing Bioinformatics Programs July 2009 Alex Ropelewski PSC-NRBSC Bienvenido Vélez UPR Mayaguez Reference: How to Think Like a Computer Scientist:
Functions, Procedures, and Abstraction Dr. José M. Reyes Álamo.
COSC 1306—COMPUTER SCIENCE AND PROGRAMMING PYTHON FUNCTIONS Jehan-François Pâris
Arithmetic Expressions Russell Taylor NC Computing Software Application Development.
 The following material is the result of a curriculum development effort to provide a set of courses to support bioinformatics efforts involving students.
And because we are dealing with the unit circle here, we can say that for this special case, Remember:
Python – Part 3 Functions 1. Getting help Start the Python interpreter and type help() to start the online help utility. Or you can type help(print) to.
Arc Length Start with the formula for radian measure … … and multiply both sides by r to get … Arc length = radius times angle measure in radians.
Copyright © 2011 Pearson, Inc. 4.1 Angles and Their Measures.
MARC: Developing Bioinformatics Programs July 2009 Alex Ropelewski PSC-NRBSC Bienvenido Vélez UPR Mayaguez 1 Essential Computing for Bioinformatics Lecture.
 The following material is the result of a curriculum development effort to provide a set of courses to support bioinformatics efforts involving students.
Radian and Degree Measure. Radian Measure A radian is the measure of a central angle that intercepts an arc length equal to the radius of the circle Radians.
Python Functions : chapter 3
Guide to Programming with Python Chapter Six Functions: The Tic-Tac-Toe Game.
Week 7 : String and photo processing. Today’s Tasks  Practice list and string  Convert Decimal to any radix base number  Between Binary and Hexadecimal.
1 Essential Computing for Bioinformatics Bienvenido Vélez UPR Mayaguez Lecture 3 High-level Programming with Python Part III: Files and Directories Reference:
Bienvenido Vélez UPR Mayaguez Reference: How to Think Like a Computer Scientist: Learning with Python 1 Introduction to Python programming for Bioinformatics.
Review of Angles. Acute Angle – Angle less than 90 degrees Right Angle – Angle that is exactly 90 degrees.
Section 4.1. Radian and Degree Measure The angles in Quadrant I are between 0 and 90 degrees. The angles in Quadrant II are between 90 and 180 degrees.
Alex Ropelewski Pittsburgh Supercomputing Center National Resource for Biomedical Supercomputing Bienvenido Vélez
MARC: Developing Bioinformatics Programs Alex Ropelewski PSC-NRBSC Bienvenido Vélez UPR Mayaguez Reference: How to Think Like a Computer Scientist: Learning.
MARC: Developing Bioinformatics Programs June 2012 Alex Ropelewski PSC-NRBSC Bienvenido Vélez UPR Mayaguez Reference: How to Think Like a Computer Scientist:
Alex Ropelewski PSC-NRBSC Bienvenido Vélez UPR Mayaguez Using Molecular Biology to Teach Computer Science High-level Programming with Python Finding Patterns.
CS 115 Lecture 5 Math library; building a project Taken from notes by Dr. Neil Moore.
High-level Programming with Python Expressions and Variables Alex Ropelewski PSC-NRBSC Bienvenido Vélez UPR Mayaguez Reference: How to Think Like a Computer.
MARC: Developing Bioinformatics Programs Alex Ropelewski PSC-NRBSC Bienvenido Vélez UPR Mayaguez Reference: How to Think Like a Computer Scientist: Learning.
Radian Measure. What is to be learned What a radian is How to convert between radians and degrees.
EQ: How do you convert from degrees to radians and from radians to degrees? Demonstrated in writing in performance task (Unit 5 Task 2). WARM UP Create.
Lesson 13.2 Define General Angles and Use Radian Measure.
MARC: Developing Bioinformatics Programs June 2012 Alex Ropelewski PSC-NRBSC Bienvenido Vélez UPR Mayaguez Reference: How to Think Like a Computer Scientist:
Using Molecular Biology to Teach Computer Science
Math Class Your favorite class!.
Using Molecular Biology to Teach Computer Science
Intro to Computer Science CS1510 Dr. Sarah Diesburg
This part of the unit is really about equivalence:
Introduction to Trigonometry
Essential Computing for Bioinformatics
Essential BioPython Retrieving Sequences from the Web
Examples Radians & Degrees (part 2)
Copyright © 2017, 2013, 2009 Pearson Education, Inc.
All pupils can use radian measure in a variety of situations
Radian Measure of a Central Angle
Things to Remember! , 5.5, 5.6 Review.
Functions, Procedures, and Abstraction
Section 4.1: Angles and Their Measures
Angles and Their Measures
6.1 Angles and Radian Measure
13-3 – Radian Measures.
( , ) ( , ) ( , ) ( , ) ( , ) ( , ) ( , ) ( , ) ( , ) ( , ) ( , )
Functions, Procedures, and Abstraction
Python Creating a calculator.
Presentation transcript:

MARC: Developing Bioinformatics Programs Alex Ropelewski PSC-NRBSC Bienvenido Vélez UPR Mayaguez Reference: How to Think Like a Computer Scientist: Learning with Python 1 Essential Computing for Bioinformatics High-level Programming with Python Using Functions as Building Blocks

Built-in Functions These materials were developed with funding from the US National Institutes of Health grant #2T36 GM to the Pittsburgh Supercomputing Center 2 >>> import math >>> decibel = math.log10 (17.0) >>> angle = 1.5 >>> height = math.sin(angle) >>> degrees = 45 >>> angle = degrees * 2 * math.pi / >>> math.sin(angle) To convert from degrees to radians, divide by 360 and multiply by 2*pi Can you avoid having to write the formula to convert degrees to radians every time?

Defining Your Own Functions These materials were developed with funding from the US National Institutes of Health grant #2T36 GM to the Pittsburgh Supercomputing Center 3 def ( ): import math def radians(degrees): result = degrees * 2 * math.pi / return(result) >>> def radians(degrees):... result=degrees * 2 * math.pi / return(result)... >>> radians(45) >>> radians(180)

Monolithic Code These materials were developed with funding from the US National Institutes of Health grant #2T36 GM to the Pittsburgh Supercomputing Center 4 >>> from string import * >>> cds="atgagtgaacgtctgagcattaccccgctggggccgtatatc” >>> gc=float(count(cds, 'g') + count(cds, 'c'))/ len(cds) >>> print gc >>>

These materials were developed with funding from the US National Institutes of Health grant #2T36 GM to the Pittsburgh Supercomputing Center 5 Function Design Guidelines Should have a single well defined 'contract' – E.g. Return the gc-value of a sequence Contract should be easy to understand and remember Should be as general as possible Should be as efficient as possible Should not mix calculations with I/O

These materials were developed with funding from the US National Institutes of Health grant #2T36 GM to the Pittsburgh Supercomputing Center 6 Why Functions? Powerful mechanism for creating building blocks Code reuse Modularity Abstraction (i.e. hide (or forget) irrelevant detail)