Hints for Programming Exercise

Hints for Programming Exercise - The first exercise asks...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
The first exercise asks you to write a program to extract the haplotype information from unknown.ped. This is actually a pretty short program – you can do it in about 15 or 16 lines of code (excluding comments) Some general hints are to look back at programs you have already written for the class as well as any other programs you may have handy (such as my simulate.py ). This exercise is easier if you use the string operation “split”. Split is a builtin function, so you don’t actually need to load the string module to be able to use it. Split is perfect to use when you have a datafile where the different fields are separated by something (called a delimiter) and you know the numbering of what data is in what field. So in the pedigree files the columns are separated by either spaces or tabs, and we know which column hold items like the person number and the genotype data. The simple format for using split is: s.split(separator) where s is the string you want to split and separator is the string you want to consider as the
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/04/2011 for the course GENETICS 302 taught by Professor Hey during the Spring '11 term at Rutgers.

Page1 / 2

Hints for Programming Exercise - The first exercise asks...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online