Introduction to Topological Data Analysis


Figure 1

Example

Figure 2

Example Simplicial Complex

Figure 3

Example

Figure 4

Exercise 1 > > In this figure, How many 0-simplices(vertices), 1-simplices(edges), and 2-simplices(triangles) does each one of the simplicial complexes have? > > ## Solution > >
> > | | Figure a | Figure b |
> > |:———–:|:————:|:————:|
> > | \(0-simplex\) | 9 | 11 |
> > | \(1-simplex\) | 11 | 12 |
> > | \(2-simplex\) | 2 | 2 |
> > > {: .solution} {: .challenge}


Figure 5

Example Filtration

Figure 6

Exercise 1 > > What are the \(\beta_0\) and \(\beta_1\) of these simplicial complexes in the image?. > > Hint: Remember that a painted triangle (color rose in this case) represents a 2-simplex, while an uncolored triangle represents a missing triangle that forms a 1-hole. > > ## Solution
> >
> > | | Figure A | Figure B |
> > |:———:|:————:|:————:|
> > | \(\beta_0\) | 1 | 3 |
> > | \(\beta_1\) | 1 | 2 |
> >
> {: .solution} {: .challenge}


Figure 7

Example Filtration

Figure 8

Example Barcode Diagram

Figure 9

Example Persistence Diagram

Computational Tools for TDA


Figure 1

Persistence Diagram

Figure 2

Persistence Diagram

Figure 3

Exercise 1 Filtration > Perform persistent homology and plot the persistence diagram and barcode. > > ## Solution
> > Step 1: Create a SimplexTree with gd.SimplexTree(). > > ~~~ >> st = gd.SimplexTree()
>> ~~~ >> {: .language-python}
>> Step 2: Insert vertices at time 0 using st.insert() > > ~~~ >> #insert 0-simplex (the vertex), >> st.insert([0]) >> st.insert([1]) >> st.insert([2]) >> st.insert([3]) >> st.insert([4]) >> ~~~ >> {: .language-python}
>> Step 3: Insert the remaining simplices by setting the filtration time using st.insert([0, 1], filtration=). > > ~~~ >> #insert 1-simplex level filtration 1 >> st.insert([0, 2], filtration=1) >> st.insert([3, 4], filtration=1) >> #insert 1-simplex level filtration 2 >> st.insert([0, 1], filtration=2) >> #insert 1-simplex level filtration 3 >> st.insert([2, 1], filtration=3) >> #insert 1-simplex level filtration 4 >> st.insert([2, 1,0], filtration=4) >> ~~~ >> {: .language-python}
>> Step 4: Perform persistent homology using st.persistence(). > > ~~~ >># Compute the persistence diagram >> persistence_diagram = st.persistence() >> ~~~ >> {: .language-python}
>> Step 5: Plot the persistence diagram. > > ~~~ >># plot the persistence diagram >> gd.plot_persistence_diagram(persistence_diagram,legend=True) >> ~~~ >> {: .language-python}
>> Step 6: Plot the barcode. > > ~~~ >> gd.plot_persistence_barcode(persistence_diagram,legend=True) >> ~~~ >> {: .language-python}
>> Step 7: Get this output
>> >> Persistence Diagram >>
> {: .solution} {: .challenge}


Figure 4

>> Persistence Diagram >>

Figure 5

Plot Circles

Figure 6

Persistence diagram

Figure 7

Bard Code

Figure 8

Plot Spiral

Figure 9

Persistence diagram

Figure 10

Bard Code

Figure 11

Exercise 2 Torus

Figure 12

Bard Code

Detecting horizontal gene transfer


Figure 1

Dendogram population_esc

Figure 2

Bacode population_esc

Figure 3

Persistence diagram population_esc

Figure 4

Dendogram population with hgt

Figure 5

Bacode population with hgt

Figure 6

Persistence diagram population with hgt

Figure 7

Persistence diagram population with hgt

Figure 8


Bacode population with hgt

Figure 9

Bacode population with hgt

Persistence Simplices gives rise to Gene Families


Figure 1

Persistence barcode for mini genomes

Other Resources