Computer Programming for Biologists Oct 30 th – Dec 11 th, 2014 Karsten Hokamp  Fill out.

Slides:



Advertisements
Similar presentations
Lab III – Linux at UMBC.
Advertisements

Linux commands exercise 1. What do you need, if you try to these at home? You need to download and install Ubuntu Linux from the Internet – DVD is need.
Linux, it's not Windows A short introduction to the sub-department's computer systems Gareth Thomas.
Linux Orientation Computer Systems Lab Computer Sciences Department Room 2350.
CS Lecture 03 Outline Sed and awk from previous lecture Writing simple bash script Assignment 1 discussion 1CS 311 Operating SystemsLecture 03.
Linux+ Guide to Linux Certification, Second Edition
1ex.1 Perl Programming for Biology Exercise 1 The Bioinformatics Unit G.S. Wise Faculty of Life Science Tel Aviv University, Israel March 2009 Eyal Privman.
CSE 303 Lecture 2 Introduction to bash shell
Guide To UNIX Using Linux Third Edition
CS1020: Intro Workshop. Topics CS1020Intro Workshop Login to UNIX operating system 2. …………………………………… 3. …………………………………… 4. …………………………………… 5. ……………………………………
Guide To UNIX Using Linux Third Edition
Basic Unix Dr Tim Cutts Team Leader Systems Support Group Infrastructure Management Team.
Introduction to R Statistical Software Anthony (Tony) R. Olsen USEPA ORD NHEERL Western Ecology Division Corvallis, OR (541)
1 SEEM3460 Tutorial Unix Introduction. 2 Introduction What is Unix? An operation system (OS), similar to Windows, MacOS X Why learn Unix? Greatest Software.
Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.
Computer Programming for Biologists Class 2 Oct 31 st, 2014 Karsten Hokamp
COMP1070/2002/lec4/H.Melikian COMP1070 Lecture #5  Files and directories in UNIX  Various types of files  File attributes  Notion of pathname  Commands.
A First Program Using C#
Guide To UNIX Using Linux Fourth Edition
1 THE UNIX FILE SYSTEM By Chokechai Chuensukanant ID COSC 513 Operating System.
Unix Primer. Unix Shell The shell is a command programming language that provides an interface to the UNIX operating system. The shell is a “regular”
Chapter 9 Part II Linux Command Line Access to Linux Authenticated login using a Linux account is required to access a Linux system. The Linux prompt will.
Welcome to Linux & Shell Scripting Small Group How to learn how to Code Workshop small-group/
Introduction to Shell Script Programming
Introduction to Perl Practical Extraction and Report Language or Pathologically Eclectic Rubbish Lister or …
Unix Basics Chapter 4.
UNIX and Shell Programming (06CS36) Unit 1 Continued… Shrinivas R. Mangalwede Department of Computer Science and Engineering K.L.S. Gogte Institute of.
1 N305 C Programming. 2 Objectives for the Lab ä Learn problem solving strategies ä Achieve intermediate knowledge of C Programming Language ä Gain experience.
CPSC 217 T03 Week I Part #1: Unix and HELLO WORLD Hubert (Sathaporn) Hu.
1 System Administration Introduction to Scripting, Perl Session 3 – Sat 10 Nov 2007 References:  chapter 1, The Unix Programming Environment, Kernighan.
Guide to Programming with Python Chapter One Getting Started: The Game Over Program.
Introduction to Perl Yupu Liang cbio at MSKCC
Introduction to UNIX Road Map: 1. UNIX Structure 2. Components of UNIX 3. Process Structure 4. Shell & Utility Programs 5. Using Files & Directories 6.
CS4710 Why Progam?. Why learn to program? Utility of programming skills: understand tools modify tools create your own automate repetitive tasks automate.
Welcome to CS323 Operating System lab 1 TA: Nouf Al-Harbi NoufNaief.net.
Shell Advanced Features. Module 8 Shell Advanced Features ♦ Introduction In Linux systems, the shells are often referred to as command line interfaces.
Introduction To UNIX. FAQReferencesSummaryInfo Resources Introduction Learning Objectives Log on User Interface Commands List of Commands Useful Info.
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: whereis, which, whoami, finger, passwd, cal, date Working with Files: cat, more, less.
Writing Scripts Hadi Otrok COEN 346.
Lesson 3-Touring Utilities and System Features. Overview Employing fundamental utilities. Linux terminal sessions. Managing input and output. Using special.
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 2a – A Unix Command Sampler (Courtesy of David Notkin, CSE 303)
Linux Commands C151 Multi-User Operating Systems.
File and Folder CLI Commands 12/24/ Agenda Overview of OS functions and the SHELL Internal v External Commands Command History Making & Modifying.
Trinity College Dublin, The University of Dublin GE3M25: Computer Programming for Biologists Python Karsten Hokamp, PhD Genetics TCD, 03/11/2015.
CS 245 – Part 1 Using Operating Systems and Networks for Programmers Jiang Guo Dept. of Computer Science California State University Los Angeles.
PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Workshop III - Part A Shell Commands Professional Training.
More Unix Naomi Altman. Directories Directory = folder mkdir - makes a new directory rmdir - removes an empty directory cd mydirectory - moves you into.
UNIX filesystem CS 2204 Class meeting 2 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright
Linux+ Guide to Linux Certification, Second Edition Chapter 4 Exploring Linux Filesystems.
A Brief Overview of Unix Brandon Bohrer. Topics What is Unix? – Quick introduction Documentation – Where to get it, how to use it Text Editors – Know.
General Computer Science for Engineers CISC 106 Lecture 03 James Atlas Computer and Information Sciences 6/15/2009.
 CSC 215 : Procedural Programming with C C Compilers.
Development Environment
CS1010: Intro Workshop.
LINUX FOR BEGINNERS Because everyone needs Fundamentals
Linux 101 Training Module Linux Basics.
Andy Wang Object Oriented Programming in C++ COP 3330
Linux/Unix - Download Ubuntu Linux :
The Command Prompt Commands are the way to “do things” in Unix
Introduction to Programming the WWW I
9 Linux on the Desktop.
CSE 374 Programming Concepts & Tools
LINUX FOR BEGINNERS Because everyone needs Fundamentals
CSE 390a Lecture 1 introduction to Linux/Unix environment
Web Programming Essentials:
CSE 390a Lecture 1 introduction to Linux/Unix environment
introduction to Linux/Unix environment
January 26th, 2004 Class Meeting 2
Introduction to Python
Presentation transcript:

Computer Programming for Biologists Oct 30 th – Dec 11 th, 2014 Karsten Hokamp  Fill out survey, please!

Computer Programming for Biologists Classes: Lectures interspersed with excercises and practicals Exam: 2-hour exam during last double lecture (11 th Dec) Organisation

Class I: Overview and Motivation  What is computer programming?  Why do we need computer programming?  How do we program computers? Questions

Class I: Overview and Motivation Write shell scripts Write programs Write one-liners Automate tasks What is and what is not computer programming? x ing x Web browsing x Run programs

Class I: Overview and Motivation Increase of data led to greater need for computational methods  Informatics (computer science) + Biology = Bioinformatics also: Computational Biology The greater context: Bioinformatics

Class I: Overview and Motivation  Automate tasks  Modify existing programs  Combine programs  Increase control  New ‘laboratory’ skill Why do we need computer programming?

Class I: Overview and Motivation  Scientific research  Efficiency  Not only for biological data  Data (re-)formatting and extraction  File organization, backups, etc. Use of programming

Class I: Overview and Motivation  Pick a programming language  Learn the basics  Start writing programs  Practice and improve How do we program computers?

Practical! Example programming with Scratch

Class I: Overview and Motivation Programming languages (examples) Faster development, slower execution Slower development, faster execution InterpretedCompiled Perl Python Ruby Scratch C C++ Java Swift

 Quick development cycle  Easy to learn  Wide-spread use  Great for text processing  Many bioinformatics extensions Class I: Overview and Motivation Advantages of Perl

 Access through console or terminal  Use of keyboard instead of mouse Class I: Overview and Motivation The command line shell prompt

Next Unix Basics

Unix File Hierarchy bin root (/) etc data Users lib sbin sw tmp usr var

User-related folders bin root (/) etc data Users lib sbin sw tmp usr var core programs home directories user programs and packages temporary storage space

Home directories bin root (/) etc data Users lib sbin sw tmp usr var user2 user1 user3 user4

Login location bin root (/) etc data Users lib sbin sw tmp usr var user2 user1 user3 user4 user2 $ prompt

Print working directory (pwd) bin root (/) etc data Users lib sbin sw tmp usr var user2 user1 user3 user4 command user2 $pwd

Print working directory (pwd) bin root (/) etc data Users lib sbin sw tmp usr var user2 user1 user3 user4 user2 $ output: full path pwd user2 $ /home/user2 user2 $pwd /Users/user2 separator

change to new location in file hierarchy user2 $cd Desktop user2 $ pwd /Users/user2/Desktop Change directory bin root (/) etc data Users lib sbin sw tmp usr var user2 user1 user3 user4 Desktop Documents command argument

Change directories bin root (/) etc data Users lib sbin sw tmp usr var user2 user1 user3 user4 Deskto p Documents go to previous directorycd - go to upper directorycd.. go to home directorycd

Path specifications bin root (/) etc data Users lib sbin sw tmp usr var user2 user1 user3 user4 Desktop Documents absolute/Users/user2/Desktop ~/Desktop relative../Documents

Create new directory bin root (/) etc data Users lib sbin sw tmp usr var user2 user1 user3 user4 user2 $ pwd user2$/home/user2 user2 $ mkdir class1 user2 $mkdir class1 user2 $mkdir ‘test dir’ Desktop

Create new directory bin root (/) etc data Users lib sbin sw tmp usr var user2 user1 user3 user4 Two new directories (or folders) created class1 test dir Desktop

Special directories bin root (/) etc data Users lib sbin sw tmp usr var user2 user1 user3 user4 upper directory.. (two dots) home directory~ (tilde) current directory. (single dot) class1 test dir Desktop

Other commands move or rename file or directorymv create a directorymkdir remove empty directoryrmdir remove filerm listing of directory (defaults to current directory) ls change directory (defaults to home directory) cd

Find more information! man ls ls –h ls –help ls --help Manual pages for Unix tools: EMBnet Quick Guides: A Quick Guide to UNIX A Quick Guide to PERL A Quick Guide to PERL Regular Expressions

Practical! A few exercises to get you familiar with the command line and the Unix environment…. Go to: and click on the ‘UNIX’ topic. I hear and I forget. I see and I remember. I do and I understand. Confucius, Chinese philosopher & reformer (551 BC BC )

# My first Perl program # define the message $text = "Hello World!\n"; # print message to screen print $text; exit; Class I: First Program Perl example

# My first Perl program # define the message $text = "Hello World!\n"; # print message to screen print $text; exit; Class I: First Program Perl example comments variableassignmentstringspecial character built-in function Statements end with semicolon!

 Save script to a file (e.g. hello.pl)  Pass on to interpreter: $ perl hello.pl Hello World! $ Class I: First Program Running the script

 Shell calls interpreter (perl)  Passes on code (script)  Syntax check  Translation into operational code  Execution Class I: First Program Perl flow

What to do when things go wrong, e.g.  Take a good look at the error message  Check syntax Class I: First Program Perl errors syntax error at hello.pl line 7, near "print" Execution of hello.pl aborted due to compilation errors.

Practical! A few exercises to get you started with writing and running Perl scripts …. Go to: and click on the ‘Editor’ topic.

Perl on a Windows PC Perl Installations a)CygWin ( Unix environment for Windows, includes Perl b)ActiveState Perl  any version 5.x c) Strawberry Perl: ( Perl Source and Binaries:

Computer Programming for Biologists References James Tisdall, Beginning Perl for Bioinformatics, O’Reilly Free online books: R.L. Schwartz, Learning Perl, O’Reilly

Next week: A short online quiz Introduction of the course project More Perl