pybedtools.helpers.get_chromsizes_from_ucsc¶
-
pybedtools.helpers.
get_chromsizes_from_ucsc
(genome, saveas=None, mysql='mysql', timeout=None)[source]¶ Download chrom size info for genome from UCSC and returns the dictionary.
If you need the file, then specify a filename with saveas (the dictionary will still be returned as well).
If
mysql
is not on your path, specify where to find it with mysql=<path to mysql executable>.timeout is how long to wait for a response; mostly used for testing.
Example usage:
>>> dm3_chromsizes = get_chromsizes_from_ucsc('dm3') >>> for i in sorted(dm3_chromsizes.items()): ... print('{0}: {1}'.format(*i)) chr2L: (0, 23011544) chr2LHet: (0, 368872) chr2R: (0, 21146708) chr2RHet: (0, 3288761) chr3L: (0, 24543557) chr3LHet: (0, 2555491) chr3R: (0, 27905053) chr3RHet: (0, 2517507) chr4: (0, 1351857) chrM: (0, 19517) chrU: (0, 10049037) chrUextra: (0, 29004656) chrX: (0, 22422827) chrXHet: (0, 204112) chrYHet: (0, 347038)