HaploReg, RegulomeDB and more on Python programming

Slides:



Advertisements
Similar presentations
compilers and interpreters
Advertisements

Topics in Python Blackjack & TKinter
Python for Science Shane Grigsby. What is python? Why python? Interpreted, object oriented language Free and open source Focus is on readability Fast.
SCIP Optimization Suite
A Crash Course Python. Python? Isn’t that a snake? Yes, but it is also a...
LECTURE 1 CMSC 201. Overview Goal: Problem solving and algorithm development. Learn to program in Python. Algorithm - a set of unambiguous and ordered.
Jill Goryca, Richard Hill American Control Conference June 17, 2013.
Introduction to Python. Python is a high-level programming language Open source and community driven “Batteries Included” – a standard distribution includes.
1 Programming for Engineers in Python Autumn Lecture 5: Object Oriented Programming.
 Introduction  Algorithm  Framework  Future work  Demo.
1 Outline 7.1 Introduction 7.2 Implementing a Time Abstract Data Type with a Class 7.3 Special Attributes 7.4Controlling Access to Attributes 7.4.1Get.
By. What advantages has it? The Reasons for Choosing Python  Python is free  It is object-oriented  It is interpreted  It is operating-system independent.
Prof. R. Willingale Department of Physics and Astronomy 2nd Year C+R 2 nd Year C and R Workshop Part of module PA2930 – 2.5 credits Venue: Computer terminal.
CS1101: Programming Methodology Aaron Tan.
Methods in Computational Linguistics II Queens College Lecture 5: List Comprehensions.
Introduction to Python Lecture 1. CS 484 – Artificial Intelligence2 Big Picture Language Features Python is interpreted Not compiled Object-oriented language.
Methods in Computational Linguistics II Queens College Lecture 7: Structuring Things.
Introduction to Python John Reiser May 5 th, 2010.
An Introduction to Visual Basic
Introduction to Python Basics of the Language. Install Python Find the most recent distribution for your computer at:
Introduction to MCMC and BUGS. Computational problems More parameters -> even more parameter combinations Exact computation and grid approximation become.
CIT 590 Intro to Programming Last lecture on Python.
CHAPTER FOUR COMPUTER SOFTWARE.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley STARTING OUT WITH Python Python First Edition by Tony Gaddis Chapter 6 Value-Returning.
H3D API Training  Part 3.1: Python – Quick overview.
Scientific Computing with NumPy & SciPy NumPy Installation and Documentation  Not much on the home page—don’t buy the guide, it’s.
60 Questions (review for final exam) CSC 161: The Art of Programming Prof. Henry Kautz 12/7/
Ch 1. A Python Q&A Session Spring Why do people use Python? Software quality Developer productivity Program portability Support libraries Component.
For. for loop The for loop in Python is more like a foreach iterative-type loop in a shell scripting language than a traditional for conditional loop.
MATLAB Harri Saarnisaari, Part of Simulations and Tools for Telecommunication Course.
PyTrilinos: a Python Interface to Selected Trilinos Packages Bill Spotz Trilinos Users Group Meeting November 2, 2004.
Built-in Data Structures in Python An Introduction.
Getting Started with Python: Constructs and Pitfalls Sean Deitz Advanced Programming Seminar September 13, 2013.
C463 / B551 Artificial Intelligence Dana Vrajitoru Python.
Guide to Linux Installation and Administration, 2e1 Chapter 11 Using Advanced Administration Techniques.
Documentation Costs Avoided using Python and other Open Standards Andrew Jonathan Fine Operating Systems Software Organization Engines, Systems, and Services.
Introduction Copyright © Software Carpentry 2010 This work is licensed under the Creative Commons Attribution License See
1 Programming for Engineers in Python Autumn Lecture 6: More Object Oriented Programming.
Programming for GCSE 1.0 Beginning with Python T eaching L ondon C omputing Margaret Derrington KCL Easter 2014.
Python Basics Tom LeFebvre. Sept , 2002Python Basics2 Python Language Very High-Level Language Scripting Language (no compiling) Simple syntax Easy.
Getting Started with SIDL using the ANL SIDL Environment (ASE) ANL SIDL Team MCS Division, ANL April 2003 The ANL SIDL compilers are based on the Scientific.
 Programming - the process of creating computer programs.
Guide to Programming with Python Chapter Five Lists and dictionaries (data structure); The Hangman Game.
Higher Computing Software Development -So Far- 5/10/10.
Practical Kinetics Exercise 0: Getting Started Objectives: 1.Install Python and IPython Notebook 2.print “Hello World!”
Getting ready. Why C? Design Features – Efficiency (C programs tend to be compact and to run quickly.) – Portability (C programs written on one system.
Introduction to Programming Oliver Hawkins. BACKGROUND TO PROGRAMMING LANGUAGES Introduction to Programming.
PROGRAMMING USING PYTHON LANGUAGE ASSIGNMENT 1. INSTALLATION OF RASPBERRY NOOB First prepare the SD card provided in the kit by loading an Operating System.
What’s a Computer?. The Basics A computer is a machine that manipulates data based on a list of instructions called a program.
PYTHON PROGRAMMING. WHAT IS PYTHON?  Python is a high-level language.  Interpreted  Object oriented (use of classes and objects)  Standard library.
Machine Language Computer languages cannot be directly interpreted by the computer – they are not in binary. All commands need to be translated into binary.
Python – It's great By J J M Kilner. Introduction to Python.
CMSC201 Computer Science I for Majors Lecture 25 – Classes
Why don’t programmers have to program in machine code?
CST 1101 Problem Solving Using Computers
MET4750 Techniques for Earth System Modeling
CIRC Winter Boot Camp 2017 Baowei Liu
Python Programming Challenge
Basic 1960s It was designed to emphasize ease of use. Became widespread on microcomputers It is relatively simple. Will make it easier for people with.
COMP280:Introduction to Software Development Week 10, Lecture 28
Data Analysis using Python-I
Do you know this browser?...
Introduction to Python programming
PROGRAMMING What is it?.
National Central University, Taiwan
Introduction to Computer Science
Discussion Section Week 9
Calculate 81 ÷ 3 = 27 3 x 3 x 3 3 x 3 x 3 x 3 ÷ 3 = This could be written as
EN Software Carpentry Python – A Crash Course Esoteric Sections Compiled Languages.
Presentation transcript:

HaploReg, RegulomeDB and more on Python programming Lin Liu Yang Li

HaploReg retrieves the ENCODE annotation for the selected SNP, as well as other SNPs in LD Using the “Set Options” tab, the user can configure values such as the LD threshold and the population used from 1000 Genomes data used to calculate LD

RegulomeDB

Python programming wrap-up if else for and while loop index: starts from 0, different from R four important data structure: list: a = [1, 2, 3, 4]; a.append(5) tuple: a = (‘cat’, ‘dog’); a[0], a[1] = a[1], a[0] dictionary: a = {‘chr1’:{10254:’G’, 13257:’T’}}; a.keys(); sets: from sets import Set species = Set([‘hs’, ‘mm’, ‘chimp’]) zoos = Set([‘mm’, ‘wolf’, ‘chimp’]) zoos | species zoos & species zoos - species

Some tricky fact: Shallow copy and deep copy List comprehension: Shallow copy: a = [1,2,3]; b = a; b[2] = 4; print(a) Deep copy: from copy import deepcopy a = [1, 2, 3]; b = deepcopy(a); b[2] = 4; print(a) List comprehension: Like in R: loops are slow slow slow a = [1, 2, 3]; a = [b + 1 for b in a]; print(a)

How to read bam (binary) files in python? import pybedtools How to perform numerical computation in python? import numpy as np Include array and matrix calculation, very useful How to use shell script in python? Get all files in a folder import os os.listdir(“yourdirectory”)

Object oriented programming Class and objects in python class HMM: #constructor #transition_probs[i, j] is the probability of transitioning to state i from state j #emission_probs[i, j] is the probability of emitting emission j while in state i def __init__(self, transition_probs, emission_probs): self._transition_probs = transition_probs self._emission_probs = emission_probs #accessors def emission_dist(self, emission): return self._emission_probs[:, emission] @property def num_states(self): return self._transition_probs.shape[0] def transition_probs(self): return self._transition_probs

Interface with other programming language Rpy: R and python interface cygwin: python and C interface When to use python? Text manipulation Some simple machine learning implementation (like using matlab) Some very well-written package available: PyStan (Bayesian MCMC sampler), matlablib, pybedtools etc

When not to use python: Large scale simulation: most often you cannot get rid of loops Statistical analysis: R is much better and well curated Best strategy: C interface python

Some good reference code for python Check MACS14 python script You can learn how to write a python script into an executable software from MACS14