From 85ad45d1a467f8497eb3f07ac9b949706cd3c051 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nelly=20S=C3=A9lem?= Date: Sat, 6 Apr 2024 11:58:29 -0600 Subject: [PATCH] Update 03-horizontalGeneTransfer-TDA.md --- _episodes/03-horizontalGeneTransfer-TDA.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/_episodes/03-horizontalGeneTransfer-TDA.md b/_episodes/03-horizontalGeneTransfer-TDA.md index 779f452..bcffa0f 100644 --- a/_episodes/03-horizontalGeneTransfer-TDA.md +++ b/_episodes/03-horizontalGeneTransfer-TDA.md @@ -50,7 +50,7 @@ to import some libraries, then to define functions, and finally to call them to > To learn more about applications of TDA in genomics, consult the Rabadan book [Topological Data Analysis for Genomics](https://www.amazon.com.mx/Topological-Data-Analysis-Genomics-Evolution/dp/1107159547) {: .callout} -### Library +### Importing Libraries To begin, we will import the necessary packages. ~~~ import numpy as np @@ -67,8 +67,12 @@ import plotly.graph_objects as go import plotly.io as pio ~~~ {: .language-python} -### **Fuctions** -These functions calculate a Hamming distance matrix from an array where the columns are genes and the rows are genomes. + +### Defining Fuctions +The function `calculate_hamming_matrix` calculates a Hamming distance +matrix from an array where the columns are genes and the rows are genomes. +The hamming distance counts how many differences are in two strings. +We have created several hamming distance functions in the episode functions. ~~~ # Let's assume that "population" is a numpy ndarray with your genomes as rows. def calculate_hamming_matrix(population):