Skip to content

Files

Latest commit

d31d426 · Apr 11, 2018

History

History
This branch is 76 commits behind csc-training/hpc-python:master.

dna-mutation

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Apr 11, 2018
Apr 11, 2018
Apr 11, 2018

Mutating DNA sequence with NumPy

Create a NumPy character array representing a DNA sequence. Use then advanced indexing and NumPy random module for making random mutations to DNA sequence:

  • Choose N random mutation sites using numpy.random.random_integers() (a single site can selected multiple times)
  • Create N random letters presenting the mutations
  • Use advanced indexing for creating mutated sequence

The end results should be something like:

Original DNA: ATGCTACAGT
Mutated  DNA: AGGCTACAGA

You can start from the provided skeleton code skeleton.py.