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 load the metadata, as follows:
f = open('relationships_w_pops_121708.txt')ind_pop = {}f.readline() # headerfor l in f:    toks = l.rstrip().split('\t')    fam_id = toks[0]    ind_id = toks[1]    pop = toks[-1]    ind_pop['/'.join([fam_id, ind_id])] = popf.close()ind_pop['2469/NA20281'] = ind_pop['2805/NA20281']

In this case, we will add an entry that is consistent with what is available in the PLINK file.

  1. Let's convert the PLINK file into the EIGENSOFT format:
from genomics.popgen.plink.convert import to_eigento_eigen('hapmap10_auto_noofs_ld_12', 'hapmap10_auto_noofs_ld_12')

This uses a function that I have written to convert from PLINK to the EIGENSOFT format. This is mostly text manipulation—not ...

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