Introduction à la programmation

49
Introduction à la programmation Pierre Poulain [email protected] 09/2011

description

Introduction à la programmation pour les étudiants de la filière biologie informatique de l'université Paris Diderot - Paris 7

Transcript of Introduction à la programmation

Page 1: Introduction à la programmation

Introduction à la programmation

Pierre Poulain [email protected]

09/2011

Page 2: Introduction à la programmation

Programmer ?

Page 3: Introduction à la programmation

Donner des ordres

Page 4: Introduction à la programmation

Pourquoi ?

Page 5: Introduction à la programmation

Stocker

Page 6: Introduction à la programmation

Trier

Page 7: Introduction à la programmation

Répéter

Page 8: Introduction à la programmation

Exemple

Page 9: Introduction à la programmation

Combien y a-t-il d'alanines dans cette protéine ?

GWGAWILAGAGA

Page 10: Introduction à la programmation

Combien y a-t-il d'alanines dans cette protéine ?

GWGAWILAGAGA 1 2 3 4

Page 11: Introduction à la programmation

Et dans celle-ci ?MRARPRPRPLWATVLALGALAGVGVGGPNICTTRGVSSCQQCLAVSPMCAWCSDEALPLGSPRCDLKENLLKDNCAPESIEFPVSEARVLEDRPLSDKGSGDSSQVTQVSPQRIALRLRPDDSKNFSIQVRQVEDYPVDIYYLMDLSYSMKDDLWSIQNLGTKLATQMRKLTSNLRIGFGAFVDKPVSPYMYISPPEALENPCYDMKTTCLPMFGYKHVLTLTDQVTRFNEEVKKQSVSRNRDAPEGGFDAIMQATVCDEKIGWRNDASHLLVFTTDAKTHIALDGRLAGIVQPNDGQCHVGSDNHYSASTTMDYPSLGLMTEKLSQKNINLIFAVTENVVNLYQNYSELIPGTTVGVLSMDSSNVLQLIVDAYGKIRSKVELEVRDLPEELSLSFNATCLNNEVIPGLKSCMGLKIGDTVSFSIEAKVRGCPQEKEKSFTIKPVGFKDSLIVQVTFDCDCACQAQAEPNSHRCNNGNGTFECGVCRCGPGWLGSQCECSEEDYRPSQQDECSPREGQPVCSQRGECLCGQCVCHSSDFGKITGKYCECDDFSCVRYKGEMCSGHGQCSCGDCLCDSDWTGYYCNCTTRTDTCMSSNGLLCSGRGKCECGSCVCIQPGSYGDTCEKCPTCPDACTFKKECVECKKFDRGALHDENTCNRYCRDEIESVKELKDTGKDAVNCTYKNEDDCVVRFQYYEDSSGKSILYVVEEPECPKGPDILVVLLSVMGAILLIGLAALLIWKLLITIHDRKEFAKFEEERARAKWDTANNPLYKEATSTFTNITYRGT

Glycoprotéine plaquettaire humaine ß3

Page 12: Introduction à la programmation

Un ordinateur

Page 13: Introduction à la programmation

très rapide

Page 14: Introduction à la programmation

beaucoup de mémoire

Page 15: Introduction à la programmation

mais bête

Page 16: Introduction à la programmation

un problème complexe

décomposer

Page 17: Introduction à la programmation

en éléments simples

Page 18: Introduction à la programmation

Algorithme

Page 19: Introduction à la programmation

Pour chaque acide aminé de la séquence,

si l'acide aminé est A

alors on compte une alanine de plus.

Algorithme humain

GWGAWILAGAGA 1 2 3 4

Page 20: Introduction à la programmation

sequence = "GWGAWILAGAGA"nombre_ala = 0

for acide_amine in sequence:if acide_amine == "A":

nombre_ala = nombre_ala + 1

print nombre_ala

Algorithme Python

Page 21: Introduction à la programmation

Autres langages ?

Page 22: Introduction à la programmation

package comptagealanines;public class Main { public static void main(String[] args) {

String sequence = "GWGAWILAGAGA"; int nombre_ala = 0 ;

for (int i = 0 ; i < sequence.length(); i++ ){ if (sequence.charAt( i ) == 'A'){ nombre_ala = nombre_ala + 1; } }

System.out.println(nombre_ala); }}

Java

Page 23: Introduction à la programmation

my @sequence = split('','GWGAWILAGAGA');my $nombre_ala = 0 ;

foreach my $acide_amine (@sequence) { if ($acide_amine eq 'A') { $nombre_ala = $nombre_ala + 1; }}

print "$nombre_ala\n";

Perl

Page 24: Introduction à la programmation

<script>var sequence = "GWGAWILAGAGA";var nombre_ala = 0;

for(i=0; i<sequence.length; i++) { if(sequence[i].toUpperCase() == "A") { nombre_ala = nombre_ala + 1; }}

window.alert("Nombre de A : " + nombre_ala);</script>

Javascript

Page 25: Introduction à la programmation

<?php $sequence = "GWGAWILAGAGA"; $nombre_ala = 0;

for($i=0; $i<strlen($sequence); $i++) { if(strtoupper($sequence[$i]) == "A") { $nombre_ala = $nombre_ala + 1; } } echo "Nombre de A : ".$nombre_ala;?>

PHP

Page 26: Introduction à la programmation

C#using System;using System.Collections.Generic;using System.Linq;using System.Text;

namespace ConsoleApplication1{ class Program { static void Main(string[] args) { string sequence = "GWGAWILAGAGA"; int nombre_ala = 0; for (int i = 0; i < sequence.Length; i++) { if (sequence[i].ToString().ToUpper() == "A") { nombre_ala = nombre_ala + 1; } } Console.WriteLine("Nombre de A : " + nombre_ala.ToString()); } }}

Page 27: Introduction à la programmation

Points communs

Page 28: Introduction à la programmation

1. Variables

Page 29: Introduction à la programmation

2. Tests

Page 30: Introduction à la programmation

3. Boucles

Page 31: Introduction à la programmation

Différences

Page 32: Introduction à la programmation

 ; { } @ $

using public classstatic void

Page 33: Introduction à la programmation

Compilation

C, C++, C#, Fortran

codesource

langagemachine

programmeexécutable

Page 34: Introduction à la programmation

Interprétation (bytecode)

Java, Python, Perl

codesource

bytecode(caché)

Page 35: Introduction à la programmation

Interprétation

Bash, Javascript, PHP

code source(ligne par ligne)

Page 36: Introduction à la programmation

Illustration bioinfo 1

Page 37: Introduction à la programmation

Ensembldétection de gènes

Page 38: Introduction à la programmation

Illustration bioinfo 2

Page 39: Introduction à la programmation

sHSP

P. Poulain, J.-C. Gelly, and D. Flatters, Detection and Architecture of Small Heat Shock Protein Monomers, PLoS ONE 5: e9990 (2010).

Page 40: Introduction à la programmation

Biologie Informatique @ P7

Unix (bash), R, C L3

Python, C, (R) M1

Python, Java, C, (R) M2

Page 41: Introduction à la programmation

Conclusion

Page 42: Introduction à la programmation

Investissez !

Page 43: Introduction à la programmation

Forgez !

Page 44: Introduction à la programmation

Facilitez-vous la vie !

Page 45: Introduction à la programmation

Amusez-vous !

Page 46: Introduction à la programmation
Page 47: Introduction à la programmation

bio informatique

Page 48: Introduction à la programmation

Crédits graphiquesPPDIGITAL (Flickr)

Katherine Donaldson (Flickr)

Ralphbijker (Flickr)

Olivcris (Flickr)

Nicobunu (Openclipart.org)

VisualPharm (Findicons)

TurboMilk (Findicons)

Wilsoninc (Findicons)

fe2cruz (Flickr)

713 Avenue (Flickr)

K Lee (Wikipedia)

selva (Flickr)

Page 49: Introduction à la programmation

Crédits graphiques (2)Nardino (Flickr) Ennor (Flickr)

AlanHeitz (Flickr)

Foxymoron (Flickr)

JoeShlabotnik (Flickr)

doi:10.1371/journal.pone.0009990.g001

JoshuaDavisPhotography (Flickr)

Dahon (Flickr)

Joe Rollerfan (Flickr)

beeeeeker (Flickr)

Liz Marion (Flickr)