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…

After downloading the data, follow these steps:

  1. First, start with a few imports:
import pickleimport gzipimport randomimport numpy as npimport h5pyimport pandas as pd
  1. Let's get the sample metadata:
samples = pd.read_csv('samples.tsv', sep='\t')print(len(samples))print(samples['cross'].unique())print(samples[samples['cross'] == 'cross-29-2'][['id', 'function']])print(len(samples[samples['cross'] == 'cross-29-2']))print(samples[samples['function'] == 'parent'])

We also print some basic information about the cross we are going to use, and all the parents.

  1. We prepare to deal with chromosome arm 3L based on its HDF5 file:
h5_3L = h5py.File('ag1000g.crosses.phase1.ar3sites.3L.h5', 'r')samples_hdf5 = list(map(lambda sample: sample.decode('utf-8'), ...
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