compare
ensembl.io.genomio.genome_stats.compare
¶
Tool set to compare genome statistic between NCBI datasets and Ensembl's core databases.
compare_annotation(ncbi, core)
¶
Extracts the annotation statistics and returns the comparison between both sources.
Annotation statistics compared
- protein_coding
- pseudogene (all pseudogene biotypes)
- other (number of misc_RNA)
- total
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ncbi
|
Dict[str, Any]
|
NCBI dataset annotation statistics. |
required |
core
|
Dict[str, Any]
|
Core database annotation statistics. |
required |
Returns:
Type | Description |
---|---|
Dict[str, Dict]
|
The common statistics with their value and the statistics with different value, including NCBI' |
Dict[str, Dict]
|
and core database's values as well as their difference ( |
Source code in src/python/ensembl/io/genomio/genome_stats/compare.py
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
|
compare_assembly(ncbi, core)
¶
Extracts the assembly statistics and returns the comparison between both sources.
The assembly statistics compared are the number of: organella, chromosomes, scaffolds and contigs. The last one is only included if NCBI's assembly is contig level.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ncbi
|
Dict[str, Any]
|
NCBI dataset assembly statistics. |
required |
core
|
Dict[str, Any]
|
Core database assembly statistics. |
required |
Returns:
Type | Description |
---|---|
Dict[str, Dict]
|
The common statistics with their value and the statistics with different value, including NCBI' |
Dict[str, Dict]
|
and core database's values as well as their difference ( |
Source code in src/python/ensembl/io/genomio/genome_stats/compare.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 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 122 |
|
compare_stats(ncbi, core)
¶
Compares the genome statistics between an NCBI dataset and a core database.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ncbi
|
Dict[str, Any]
|
NCBI dataset genome statistics. |
required |
core
|
Dict[str, Any]
|
Core database genome statistics. |
required |
Returns:
Type | Description |
---|---|
Dict[str, Dict]
|
The common statistics with their value and the statistics with different value, including NCBI' |
Dict[str, Dict]
|
and core database's values as well as their difference ( |
Dict[str, Dict]
|
assembly and annotation (if present in one of the sources) under "assembly_diff" and |
Dict[str, Dict]
|
"annotation_diff" keys, respectively. |
Source code in src/python/ensembl/io/genomio/genome_stats/compare.py
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 |
|
compare_stats_files(ncbi_file, core_file)
¶
Compares the genome statistics between an NCBI dataset and a core database.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ncbi_file
|
PathLike
|
NCBI dataset genome statistics JSON file. |
required |
core_file
|
PathLike
|
Core database genome statistics JSON file. |
required |
Returns:
Type | Description |
---|---|
Dict[str, Dict]
|
The common statistics with their value and the statistics with different value, including NCBI' |
Dict[str, Dict]
|
and core database's values as well as their difference ( |
Dict[str, Dict]
|
assembly and annotation (if present in one of the sources) under "assembly_diff" and |
Dict[str, Dict]
|
"annotation_diff" keys, respectively. |
Source code in src/python/ensembl/io/genomio/genome_stats/compare.py
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 |
|
main()
¶
Main script entry-point.
Source code in src/python/ensembl/io/genomio/genome_stats/compare.py
219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 |
|
stats_dict_cmp(ncbi, core)
¶
Compares both dictionaries and returns the similar and different elements between both.
The method assumes both dictionaries have the same set of keys. A key would be considered the same if its value in both dictionaries is the same, but will only be included in the returned dictionary if that value is different than 0.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ncbi
|
Dict[str, int]
|
NCBI dataset statistics in key-value pairs. |
required |
core
|
Dict[str, int]
|
Core database statistics in key-value pairs. |
required |
Returns:
Type | Description |
---|---|
Dict[str, Dict]
|
A dictionary with 2 keys: |
Dict[str, Dict]
|
|
Dict[str, Dict]
|
|
Source code in src/python/ensembl/io/genomio/genome_stats/compare.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
|