Download presentation
Presentation is loading. Please wait.
Published byPhilip Lambert Modified over 8 years ago
1
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 Conditional Iteration
2
The following material is the result of a curriculum development effort to provide a set of courses to support bioinformatics efforts involving students from the biological sciences, computer science, and mathematics departments. They have been developed as a part of the NIH funded project “Assisting Bioinformatics Efforts at Minority Schools” (2T36 GM008789). The people involved with the curriculum development effort include: Dr. Hugh B. Nicholas, Dr. Troy Wymore, Mr. Alexander Ropelewski and Dr. David Deerfield II, National Resource for Biomedical Supercomputing, Pittsburgh Supercomputing Center, Carnegie Mellon University. Dr. Ricardo González Méndez, University of Puerto Rico Medical Sciences Campus. Dr. Alade Tokuta, North Carolina Central University. Dr. Jaime Seguel and Dr. Bienvenido Vélez, University of Puerto Rico at Mayagüez. Dr. Satish Bhalla, Johnson C. Smith University. Unless otherwise specified, all the information contained within is Copyrighted © by Carnegie Mellon University. Permission is granted for use, modify, and reproduce these materials for teaching purposes. Most recent versions of these presentations can be found at http://marc.psc.edu/http://marc.psc.edu/ Essential Computing for Bioinformatics
3
Iterative Factorial These materials were developed with funding from the US National Institutes of Health grant #2T36 GM008789 to the Pittsburgh Supercomputing Center 3 def iterFact(n): result = 1 while(n>0): result = result * n n = n - 1 return result Not a good example of the proper use of a while statement. Why?
4
These materials were developed with funding from the US National Institutes of Health grant #2T36 GM008789 to the Pittsburgh Supercomputing Center 4 Anatomy of the While Statement 4 while : SYNTAX SEMANTICS Repeat the execution of as long as expression remains true SYNTAX = FORMAT SEMANTICS = MEANING
5
Finding all occurrences of a DNA pattern 5 Write a Python function to print all occurrences of a DNA pattern in a sequence: acgcgcgagt gcg Location = 2 sequence pattern
6
acgcgcgagt Finding all occurrences of a DNA pattern 6 Write a Python function to print all occurrences of a DNA pattern in a sequence: gcg Location = 4 sequence pattern
7
Finding Patterns Within Sequences These materials were developed with funding from the US National Institutes of Health grant #2T36 GM008789 to the Pittsburgh Supercomputing Center 7 from string import * def searchDNAPattern(dna, pattern): 'print all start positions of a pattern string inside a target string' site = find (dna, pattern) while site != -1: print 'pattern %s found at position %d' % (pattern, site) site = find (dna, pattern, site + 1) Example from: Pasteur Institute Bioinformatics Using Python >>> searchPattern("acgcgcgagt","gcg") pattern gcg at position 2 pattern gcg at position 4 >>>
8
Finding Patterns Within Sequences These materials were developed with funding from the US National Institutes of Health grant #2T36 GM008789 to the Pittsburgh Supercomputing Center 8 from string import * def searchDNAPattern(dna, pattern): 'print all start positions of a pattern string inside a target string' site = find (dna, pattern) while site != -1: print 'pattern %s found at position %d' % (pattern, site) site = find (dna, pattern, site + 1) Example from: Pasteur Institute Bioinformatics Using Python while loop is necessary since we do not know how may occurrences of the pattern we will find in a given sequence
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.