The documentation for the each function in the ComputeMT.py file is below (in alphabetical order):
ComputeMergeTree(leaf_id)
This function computes the merge tree of a particular leaf in horizontal and vertical direction. Args: leaf_id: id of the leaf Returns: MT: dictionary containing the merge tree in horizontal and vertical direction
Source code in ComputeMT.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | |
DataVisualization(leaf_id)
This function visualizes the data in the form of a graph. Args: leaf_id: id of the leaf Returns: none
Source code in ComputeMT.py
82 83 84 85 86 87 88 89 90 91 | |
DownloadDataset(dataset_url)
This function downloads the dataset from the given url and returns a pandas dataframe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset_url |
url of the dataset |
required |
Returns: df: pandas dataframe containing the dataset
Source code in ComputeMT.py
5 6 7 8 9 10 11 12 13 14 15 | |
GetCoordinates(data)
This function extracts the coordinates of the leaf from the given data.
Args:
data: pandas dataframe containing the data of the leaf
Returns:
n_pos: dictionary containing the coordinates of the leaf
Source code in ComputeMT.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | |
GetLeafData(leaf_id)
This function returns a pandas dataframe containing all the data of a particular leaf. It first downloads the dataset from passiflora_aligned.csv and then returns the data of the leaf with the given leaf_id. Args: leaf_id: id of the leaf Returns: leaf: pandas dataframe containing the data of the leaf with the given leaf_id
Source code in ComputeMT.py
19 20 21 22 23 24 25 26 27 28 29 30 | |
LeaftoGraph(coordinate_dict)
This function visualizes the data in the form of a graph. Args: coordinate_dict: dictionary containing the coordinates of the leaf Returns: G: graph
Source code in ComputeMT.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | |
The python file ComputeMT.py can be found here.