Skip to Content
Bioinformatics with Python Cookbook - Second Edition
book

Bioinformatics with Python Cookbook - Second Edition

by Tiago Antao
November 2018
Intermediate to advanced
360 pages
9h 36m
English
Packt Publishing
Content preview from Bioinformatics with Python Cookbook - Second Edition

How to do it…

  1. Let's start with the usual imports:
%matplotlib inlinefrom collections import defaultdictimport gzipimport numpy as npimport matplotlib.pylab as plt
  1. Let's load the data that we saved on the first recipe:
num_parents = 8dp_2L = np.load(gzip.open('DP_2L.npy.gz', 'rb'))print(dp_2L.shape)
  1. And let's print median DP for the whole chromosome arm, and a part of it in the middle for all parents:
for i in range(num_parents):    print(np.median(dp_2L[:,i]), np.median(dp_2L[50000:150000,i]))

Interestingly, the median for the whole chromosome sometimes does not hold for that big region in the middle, so let's dig further.

  1. We will print the median DP for 200,000 kbp windows across the chromosome arm. Let's start with the window code: ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Bioinformatics with Python Cookbook

Bioinformatics with Python Cookbook

Tiago Antao

Publisher Resources

ISBN: 9781789344691Supplemental Content