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...

Take a look at the following steps:

  1. Let's start with some basic code from the first recipe:
from collections import defaultdict, OrderedDictfrom copy import deepcopyimport simuPOP as spfrom simuPOP import demographynum_loci = 10pop_size = 50num_gens = 101num_pops = 10migs = [0, 0.005, 0.01, 0.02, 0.05, 0.1]init_ops = OrderedDict()pre_ops = OrderedDict()post_ops = OrderedDict()pops = sp.Population([pop_size] * num_pops, loci=[1] * num_loci, infoFields=['migrate_to'])

We will simulate an island model with 10 islands (num_pops). Also, we will introduce a new infoFields, migrate_to, which is necessary to implement migration. We will try out several migration rates (including 0). Also, when we create a population, the population ...

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