Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "MARC: Developing Bioinformatics Programs June 2012 Alex Ropelewski PSC-NRBSC Bienvenido Vélez UPR Mayaguez Reference: How to Think Like a Computer Scientist:"— Presentation transcript:

1 MARC: Developing Bioinformatics Programs June 2012 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 Writing Programs that Make Decisions

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 These materials were developed with funding from the US National Institutes of Health grant #2T36 GM008789 to the Pittsburgh Supercomputing Center 3 Boolean Expressions Expressions that yield True of False values Ways to yield a Boolean value – Boolean constants: True and False – Comparison operators (>, =, <=) – Logical Operators (and, or, not) – Boolean functions – 0 (means False) – Empty string '’ (means False)

4 Example of Boolean Function 4 Write a function called matchDNANucleotide that takes two DNA nucleotides represented as letters from the set {‘a’, ‘c’, ‘g’, ‘t’} and returns true if they are equal. The function should return false otherwise.

5 Example of Boolean Function 5 Write a function called matchDNANucleotide that takes two DNA nucleotides represented as letters from the set {‘a’, ‘c’, ‘g’, ‘t’} and returns true if they are equal. The function should return false otherwise. def matchDNANuceotide(n1, n2): return (n1 == n2) def matchDNANuceotide(n1, n2): if (n1 == n2): return True else: return False OR

6 Example of Boolean Function 6 Modify the previous function matchDNANucleotide to accept unknown nucleotides represented by letter ‘x’. They function should return True if the nucleotides match and false otherwise. An unknown nucleotide should match any other nucleotide.

7 Example of Boolean Function 7 Modify the previous function matchDNANucleotide to accept unknown nucleotides represented by letter ‘x’. They function should return True if the nucleotides match and false otherwise. An unknown nucleotide should match any other nucleotide. def matchDNANuceotide(n1, n2): return (n1 == ’x’ or n2== ’x’ or n1 == n2) def matchDNANuceotide(n1, n2): if (n1 == ’x’ or n2== ’x’ or n1 == n2): return True else: return False OR

8 Complementing Sequences: Utilities DNANucleotides='acgtx' DNAComplements='tgcax’ def isDNANucleotide(nucleotide): 'Returns True when n is a valid DNA nucleotide’ return (type(nucleotide) == type("") and len(nucleotide)==1 and nucleotide.lower() in DNANucleotides) 8 These materials were developed with funding from the US National Institutes of Health grant #2T36 GM008789 to the Pittsburgh Supercomputing Center How can we use this boolean function to improve input validation?


Download ppt "MARC: Developing Bioinformatics Programs June 2012 Alex Ropelewski PSC-NRBSC Bienvenido Vélez UPR Mayaguez Reference: How to Think Like a Computer Scientist:"

Similar presentations


Ads by Google