Genome Revolution: COMPSCI 004G 2.1 Bioinformatics Vocabulary l Processing, analyzing, experimenting with data  Where does the data come from?  How do.

Slides:



Advertisements
Similar presentations
Programming Languages and Paradigms
Advertisements

1 C++ Syntax and Semantics The Development Process.
JAVA BASICS SYNTAX, ERRORS, AND DEBUGGING. OBJECTIVES FOR THIS UNIT Upon completion of this unit, you should be able to: Explain the Java virtual machine.
Lab#1 (14/3/1431h) Introduction To java programming cs425
Client Side Programming Using Java Applet Outcomes: You will be expected to know: – Java Applets and HTML file; –bytecode and platform independent programs;
Outline Java program structure Basic program elements
Concept of Computer Programming November 2, 2011.
Introducing Java.
© The McGraw-Hill Companies, 2006 Chapter 1 The first step.
Week 4-5 Java Programming. Loops What is a loop? Loop is code that repeats itself a certain number of times There are two types of loops: For loop Used.
1 Chapter 5: Names, Bindings and Scopes Lionel Williams Jr. and Victoria Yan CSci 210, Advanced Software Paradigms September 26, 2010.
Genome Revolution: COMPSCI 004G 3.1 What is a program? What is code? l Instructions in a language a computer executes  Languages have different characteristics,
Java Language and SW Dev’t
Introduction CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
Gary MarsdenSlide 1University of Cape Town Principles of programming language design Gary Marsden Semester 2 – 2001.
Intro to Programming and JavaScript. What is Programming? Programming is the activity of creating a set of detailed instructions (Program) that when carried.
More with Methods (parameters, reference vs. value, array processing) Corresponds with Chapters 5 and 6.
Programming in Java Unit 2. Class and variable declaration A class is best thought of as a template from which objects are created. You can create many.
Introduction CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
Compsci 101.2, Fall PFTT (plan for this Thursday) l What is a Python program?  In the context of what we do in Compsci 101  In a neuroscience.
Advanced Programming Collage of Information Technology University of Palestine, Gaza Prepared by: Mahmoud Rafeek Alfarra Lecture 2: Major Concepts of Programming.
The Java Programming Language
JAVA BASICS: Variables and References SYNTAX, ERRORS, AND DEBUGGING.
Classes CS 21a: Introduction to Computing I First Semester,
Hello.java Program Output 1 public class Hello { 2 public static void main( String [] args ) 3 { 4 System.out.println( “Hello!" ); 5 } // end method main.
 JAVA Compilation and Interpretation  JAVA Platform Independence  Building First JAVA Program  Escapes Sequences  Display text with printf  Data.
Chapter 1 Object Orientation: Objects and Classes.
CS61B L02 Using Objects (1)Garcia / Yelick Fall 2003 © UCB Kathy Yelick Handout for today: These lecture notes Computer Science 61B Lecture 2 – Using Objects.
What does a computer program look like: a general overview.
Elements of a Java Program Bina Ramamurthy SUNY at Buffalo.
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 6: Object-Oriented Programming.
More About Objects and Methods Chapter 5. Outline Programming with Methods Static Methods and Static Variables Designing Methods Overloading Constructors.
Compsci 6/101, Spring More on Python, Tools, Compsci 101 l APTs, Assignments, Tools  APT: Algorithmic Problem-solving and Testing  How to get.
Genome Revolution: COMPSCI 006G 2.1 Control in Java and Programming l The computer executes your program one statement at a time, from top to bottom within.
© 2004 Pearson Addison-Wesley. All rights reserved ComS 207: Programming I Instructor: Alexander Stoytchev
A Computer Science Tapestry 2.1 Writing and Understanding C++ l Writing programs in any language requires understanding the syntax and semantics of the.
A Computer Science Tapestry 2.1 Writing and Understanding C++ l There are language independent skills in programming (C++, Java, …) l However, writing.
BEGINNING PROGRAMMING.  Literally – giving instructions to a computer so that it does what you want  Practically – using a programming language (such.
Compsci 06/101, Fall Vocabulary l What's the Spanish word for 'boy'? 'eat'?  How do you know? l What about the Turkish equivalents?  How do.
CS101: Introduction to Computer Science Slides adapted from Sedgewick and Wayne Copyright © Your First Java.
Variables and Functions ROBOTC Software © 2012 Project Lead The Way, Inc.Principles of Engineering.
Introduction CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
Lecture1 Instructor: Amal Hussain ALshardy. Introduce students to the basics of writing software programs including variables, types, arrays, control.
JAVA Programming (Session 2) “When you are willing to make sacrifices for a great cause, you will never be alone.” Instructor: รัฐภูมิ เถื่อนถนอม
Programming for Interactivity Professor Bill Tomlinson Tuesday & Wednesday 6:00-7:50pm Fall 2005.
CPS What's in Compsci 100? l Understanding tradeoffs: reasoning, analyzing, describing…  Algorithms  Data Structures  Programming  Design l.
Chapter 1: Preliminaries Lecture # 2. Chapter 1: Preliminaries Reasons for Studying Concepts of Programming Languages Programming Domains Language Evaluation.
© 2011 Pearson Education, publishing as Addison-Wesley Chapter 1: Computer Systems Presentation slides for Java Software Solutions for AP* Computer Science.
Terms: Software  Set of instructions  aka programs  Operating System:  Special software whose job it is to translateinstructions into hardware instructions.
SESSION 1 Introduction in Java. Objectives Introduce classes and objects Starting with Java Introduce JDK Writing a simple Java program Using comments.
1 Problem Solving  The purpose of writing a program is to solve a problem  The general steps in problem solving are: Understand the problem Dissect the.
Java: Base Types All information has a type or class designation
Information and Computer Sciences University of Hawaii, Manoa
The need for Programming Languages
Working with Java.
Java: Base Types All information has a type or class designation
Chapter No. : 1 Introduction to Java.
Introduction CSE 1310 – Introduction to Computers and Programming
CS Programming I Jim Williams, PhD.
Subroutines Idea: useful code can be saved and re-used, with different data values Example: Our function to find the largest element of an array might.
Lesson 2 Programming constructs – Algorithms – Scratch – Variables Intro.
Variables ICS2O.
Chapter 1: Computer Systems
Units with – James tedder
Focus of the Course Object-Oriented Software Development
Classes CS 21a: Introduction to Computing I
CMPT 120 Lecture 3 - Introduction to Computing Science – Programming language, Variables, Strings, Lists and Modules.
Instructor: Alexander Stoytchev
Java String Class String is a class
Writing and Understanding C++
Presentation transcript:

Genome Revolution: COMPSCI 004G 2.1 Bioinformatics Vocabulary l Processing, analyzing, experimenting with data  Where does the data come from?  How do we get it?  What does it mean?  What do we do with it? l From nucleotide to protein to gene  Identification is important  Annotation is important

Genome Revolution: COMPSCI 004G 2.2 What does DNA (data) look like? l TGAAC v ACTTG  Which direction is right? l What is a base-pair?  nucleotide? l What is a protein, how coded?  Identification? l What is an amino acid?  Codon? Coding? l Why are proteins important?  Finding? Using?…

Genome Revolution: COMPSCI 004G 2.3 How do we get CGATC into software?

Genome Revolution: COMPSCI 004G 2.4 From Shotgun to Gene l Comparing two approaches  HGP: human genome project  Celera Genomics l Why was there a race? Is the race over?  Who owns the data?  What public good does the data serve? l Should scientists be concerned about public policy?  Was the Manhattan project like the HGP?

Genome Revolution: COMPSCI 004G 2.5 What is a program? What is code? l Instructions in a language a computer executes  Languages have different characteristics, strengths, weaknesses  Scheme, BASIC, C++, Fortran, Java, Perl, PHP, … l Computer executes one instruction at a time  Memory and state of machine change  Execute the next instruction  Repeat  Stop, run out of memory, pull plug, …

Genome Revolution: COMPSCI 004G 2.6 From browser to genome analysis l Netscape, first widely distributed browser  Who wrote it?  What operating systems did it run on?  What does it mean for a program to run? l When you execute a Google query what happens?  Where does code run?  How do you see the results? Search at NCBI, jimwatsonsequence, …  Where does the code execute?

Genome Revolution: COMPSCI 004G 2.7 Writing a program l Create the program using a computer language  Design, test, document, maintain, … l Test and debug the program  Does the program do what you want?  How do you know what the program does?  How do you fix it?  What skills are needed?

Genome Revolution: COMPSCI 004G 2.8 More on understanding programs l You write code in Java, or Perl, or C++ or php or …  The code must run/execute somewhere  You must understand what it does (how?) l In your mind and on paper simulate/understand computer’s execution of your code  What you wrote, not what you meant  How do you make a drawing?

Genome Revolution: COMPSCI 004G 2.9 Creating a Program l Specify the problem  remove ambiguities  identify constraints l Develop algorithms, design classes, design software architecture l Implement program  revisit design  test, code, debug  revisit design l Documentation, testing, maintenance of program l From ideas to electrons

Genome Revolution: COMPSCI 004G 2.10 Writing and Understanding Java l Language independent skills in programming  What is a loop, how do you design a program?  What is an array, how do you access files? l However, writing programs in any language requires understanding the syntax and semantics of the programming language  Syntax is similar to rules of spelling and grammar: i before e except after c Two spaces after a period, then use a capital letter

Genome Revolution: COMPSCI 004G 2.11 Syntax and Semantics l Semantics is what a program (or English sentence) means  You ain’t nothing but a hound dog.  La chienne de ma tante est sur votre tete. l At first it seems like the syntax is hard to master, but the semantics are much harder  Natural languages are more forgiving than programming languages.

Genome Revolution: COMPSCI 004G 2.12 Toward an Understanding of Java l Traditional first program, doesn’t convey power of computing but it illustrates basic components of a simple program public class SayHello { // traditional first program public static void main(String[] args) { System.out.println("Hello World!"); } l This program must be edited/typed, compiled and executed

Genome Revolution: COMPSCI 004G 2.13 How Things Work: PrintLots.java public class PrintLots { // … public void once(){ twice(); } public static void main(String[] args){ PrintLots printer = new PrintLots(); printer.once(); }

Genome Revolution: COMPSCI 004G 2.14 Java Vocabulary l Variable, object, identifier, method, call  Name of something: object or method  The car starts, the dog barks, I speak l Invoke or call method: method lives in object (or in a class)  An object is an instance of a class  My car is a Volvo 850, yours is a BMW …  My car starts, yours stops: v850.start();

Genome Revolution: COMPSCI 004G 2.15 Methods/Functions can return values l What does the square root function do?  When called with parameters of 4, 6.2, -1 l What does the method getGcount() return? public class DNAstuff { public int getGcount(String dna) { int total = 0; for(int k=0; k < dna.length(); k++){ if (dna.charAt(k) == 'g'){ total = total + 1; } return total; }

Genome Revolution: COMPSCI 004G 2.16 Lydia Kavraki l Awards  Grace Murray Hopper  Brilliant 10 "I like to work on problems that will generally improve the quality of our life," What's the thing you love most about science? “Working with students and interacting with people from diverse intellectual backgrounds. Discovery and the challenge of solving a tough problem, especially when it can really affect the quality of our lives. I find the whole process energizing.”

Genome Revolution: COMPSCI 004G 2.17 John Kemeny ( ) Invented BASIC, assistant to Einstein, Professor and President of Dartmouth " If you have a large number of unrelated ideas, you have to get quite a distance away from them to get a view of all of them, and this is the role of abstraction." "...it is the greatest achievement of a teacher to enable his students to surpass him."

Genome Revolution: COMPSCI 004G 2.18 Anatomy of for-loop String s = new String("AGTCCG"); String rs = new String(""); for(int k=0; k < 3; k++){ rs = rs + s.charAt(k); } l Initialization happens once l Loop test evaluated  If true body executes  If false skip after loop l After loop body, increment executed and test re-evaluated l What should be true about test? l What about body? l What about together?

Genome Revolution: COMPSCI 004G 2.19 Program Style l People who use your program don’t read your code  You’ll write programs to match user needs l People who maintain or modify your program do read code  Must be readable, understandable without you next door  Use a consistent programming style, adhere to conventions l Identifiers are names of functions, parameters, (variables, classes, …)  Sequence of letters, numbers, underscore __ characters  Cannot begin with a number (we won’t begin with __)  big_head vs. BigHead, we’ll use AlTeRnAtInG format  Make identifiers meaningful, not droll and witty

Genome Revolution: COMPSCI 004G 2.20 Equality of values and objects int x = 3*12; if (x == 36) {is-executed} String s = new String("genetic"); String t = s.substring(0,4); if (t == "gene") {not executed} if (t.equals("gene")) {is-executed} l Primitive types are boxes l Object types are labels on boxes  If we don't call new there's no box for the label  No box is called null, it means no object referred to or referenced by variable/pointer/reference

Genome Revolution: COMPSCI 004G 2.21 s t Objects and values l Primitive variables are boxes  think memory location with value l Object variables are labels that are put on boxes String s = new String("genome"); String t = new String("genome"); if (s == t) {they label the same box} if (s.equals(t)) {contents of boxes the same} What's in the boxes? "genome" is in the boxes

Genome Revolution: COMPSCI 004G 2.22 Objects, values, classes l For primitive types: int, char, double, boolean  Variables have names and are themselves boxes (metaphorically)  Two int variables assigned 17 are equal with == l For object types: String, Sequence, others  Variables have names and are labels for boxes  If no box assigned, created, then label applied to null  Can assign label to existing box (via another label)  Can create new box using new l Object types are references or pointers or labels to storage

Genome Revolution: COMPSCI 004G 2.23 Don Knuth (Art of Programming) “My feeling is that when we prepare a program, it can be like composing poetry or music; as Andrei Ershov has said, programming can give us both intellectual and emotional satisfaction, because it is a real achievement to master complexity and to establish a system of consistent rules.” “We have seen that computer programming is an art, because it applies accumulated knowledge to the world, because it requires skill and ingenuity, and especially because it produces objects of beauty.”

Genome Revolution: COMPSCI 004G 2.24 Ada Lovelace, l Daughter of Byron, advocate of work of Charles Babbage, designer of early “computer” (the Analytical Engine)  Made Babbage’s work accessible “ It would weave algebraic patterns the way the Jacquard loom weaved patterns in textiles ” l Tutored in mathematics by Augustus de Morgan l Marched around the billiard table playing the violin l Ada is a notable programming language