py2ls 0.2.4.4__tar.gz → 0.2.4.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (229) hide show
  1. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/PKG-INFO +1 -1
  2. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/bio.py +444 -16
  3. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/ips.py +3 -3
  4. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/plot.py +42 -9
  5. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/pyproject.toml +1 -1
  6. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/README.md +0 -0
  7. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.DS_Store +0 -0
  8. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/COMMIT_EDITMSG +0 -0
  9. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/FETCH_HEAD +0 -0
  10. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/HEAD +0 -0
  11. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/config +0 -0
  12. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/description +0 -0
  13. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/hooks/applypatch-msg.sample +0 -0
  14. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/hooks/commit-msg.sample +0 -0
  15. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/hooks/fsmonitor-watchman.sample +0 -0
  16. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/hooks/post-update.sample +0 -0
  17. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/hooks/pre-applypatch.sample +0 -0
  18. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/hooks/pre-commit.sample +0 -0
  19. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/hooks/pre-merge-commit.sample +0 -0
  20. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/hooks/pre-push.sample +0 -0
  21. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/hooks/pre-rebase.sample +0 -0
  22. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/hooks/pre-receive.sample +0 -0
  23. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/hooks/prepare-commit-msg.sample +0 -0
  24. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/hooks/push-to-checkout.sample +0 -0
  25. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/hooks/update.sample +0 -0
  26. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/index +0 -0
  27. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/info/exclude +0 -0
  28. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/logs/HEAD +0 -0
  29. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/logs/refs/heads/main +0 -0
  30. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/logs/refs/remotes/origin/HEAD +0 -0
  31. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/logs/refs/remotes/origin/main +0 -0
  32. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/01/d5bd8065e6860c0bd23ff9fa57161806a099e1 +0 -0
  33. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/09/08da26de58c114225ad81f484b80bf5d351b34 +0 -0
  34. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/0b/409e1bc918277010f5679b402d1d1dda53e15c +0 -0
  35. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/12/c2808a1b3a4d0892a4154dfba1e2ae3770fa73 +0 -0
  36. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/14/449a0e6ba4ea2f1a73acf63ef91c9c6193f9ed +0 -0
  37. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/15/a8e468aacfcb440e090020f36d0b985d45da23 +0 -0
  38. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/1a/b4585881a6a42889f01aa0cfe25fd5acfaf46f +0 -0
  39. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/1c/3f92adda34344bcbbbf9d409c79855ae2aaea8 +0 -0
  40. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/1c/9314c5f69b9390068a2a8616875d974849d71f +0 -0
  41. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/1d/fe9d9633b24ea560354f4f93d39c6e5f163ea0 +0 -0
  42. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/20/72c28e83f4347959d29f7b3a6c1fc3e4ee6b59 +0 -0
  43. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/24/6b368b986f758630c46dc02b7fa512b53422f7 +0 -0
  44. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/25/b796accd261b9135fd32a2c00785f68edf6c46 +0 -0
  45. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/27/aa6074f652bc6f7078f8647489d9ee8e24f0e2 +0 -0
  46. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/28/c2969d785c1b892c2a96b3f00eba63a59811b3 +0 -0
  47. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/2a/ae95d517d213b660bf4f65a4e0cfae7bb893eb +0 -0
  48. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/2a/fdf45791a26d42ccead35ace76a8f0b2a56561 +0 -0
  49. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/30/a2f8da47ee947811dc8d993f5a06a45de374f4 +0 -0
  50. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/32/fd627b62fad7cf3b2f9e34ab9777126a0987ad +0 -0
  51. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/34/9e31b6a3634cea102ce5588b98c11cc1738605 +0 -0
  52. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/34/b6f3a2ee84f39bed4eee57f2c0e0afb994feb1 +0 -0
  53. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/35/1a5f491ab97eee9d1ee699478d75a8bb5d3dc2 +0 -0
  54. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/36/b4a1b7403abc6c360f8fe2cb656ab945254971 +0 -0
  55. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/36/e56a361f526eafa59c5235a5c990bf288b5f9c +0 -0
  56. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/36/ef43e50009e59db11812c258846d9e38718173 +0 -0
  57. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/39/7ead045fbbcfb17c62019eb18fe21ed05dbee5 +0 -0
  58. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/39/b13be65125556784e44c7a1d9821703c7ab67e +0 -0
  59. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/3b/507acc7f23391644cc0b824b1e79fd2677a362 +0 -0
  60. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/3b/bd972aa7ad680858f8dfbd0f7fcd97756f0d6f +0 -0
  61. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/3c/bbe5f4173d165127b9ad96119f1ec24c306ffc +0 -0
  62. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/3d/9d10d27724657a436c65a6254bfd213d4b3562 +0 -0
  63. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/3f/d6561300938afbb3d11976cf9c8f29549280d9 +0 -0
  64. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/41/dcf4b3bf0460946b2da93776cf9e836d62178f +0 -0
  65. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/43/dbd49b2ee367c5434dd545e3b5795434f2ef0b +0 -0
  66. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/45/b1b6178bacbfc997811a998b5cc60c1ea7fac8 +0 -0
  67. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/47/6cbd5a7c5e35cddef2f8a38bdc4896d403b095 +0 -0
  68. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/48/a88fc5806305d0bb0755ee6801161b79696972 +0 -0
  69. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/4f/7afb40dff2153d857fc85748c2eecb85125042 +0 -0
  70. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/50/08ddfcf53c02e82d7eee2e57c38e5672ef89f6 +0 -0
  71. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/53/e0deb1cb4c2c606bced6e7f9a66b0fda60980d +0 -0
  72. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/56/e4e8b2d5545e0256090f45aa8fc42c5fe067d0 +0 -0
  73. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/57/63d0c52f5c9c69e89d514a1f96034947abe21a +0 -0
  74. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/57/bd1c0199483ab316235b094543b85edec6c35e +0 -0
  75. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/58/20a729045d4dc7e37ccaf8aa8eec126850afe2 +0 -0
  76. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/59/380c4c26bdcd4d9b71ae3e2e35f05b3f26c5ab +0 -0
  77. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/5a/192565abf89c9d765af846ce6d53a92b1ce7ad +0 -0
  78. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/60/f273eb1c412d916fa3f11318a7da7a9911b52a +0 -0
  79. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/61/570cec8c061abe74121f27f5face6c69b98f99 +0 -0
  80. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/62/4488173ed2c8936fa5cea3cf5dd3f26a30b86e +0 -0
  81. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/62/7c81b23b4e56e87b042b650b0103653cc9e34a +0 -0
  82. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/62/d90ccf8cbefdc2e4fd475e7c6f4f76e9fdf801 +0 -0
  83. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/63/100154b27846e8010e55b6bf4b3d7762c14c5f +0 -0
  84. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/64/27a4edff08f93d98f511418423f09f2ab90bcd +0 -0
  85. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/66/6227eeeba24073e63811e89f1449f3d958f183 +0 -0
  86. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/66/c998778721d424bd0aae80602dabbffa93af2e +0 -0
  87. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/68/6df3072c8b025fb18106ed2df505994ad062a9 +0 -0
  88. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/69/13c452ca319f7cbf6a0836dc10a5bb033c84e4 +0 -0
  89. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/6a/52e747a2b349b128d1490d9e896d2323818eb7 +0 -0
  90. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/6b/7fde264d93a7a0986d394c46c7650d0ce2ab92 +0 -0
  91. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/6c/cebb29b7f3f5b0c889f6dadbf9ff066554587d +0 -0
  92. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/6d/c2cdf4a84e538e5d4777486aeff87e42f41799 +0 -0
  93. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/6d/ee29dbdcc84edeeacede105110446f3ccac963 +0 -0
  94. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/71/36b2074a2754be8b58127d82250e5b37e3c373 +0 -0
  95. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/72/245a05b0966011cb381e6b32b0465000e969ab +0 -0
  96. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/72/e4179337639859678ddaecf38b16f33aaec8e1 +0 -0
  97. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/78/063f4c863fc371ec0313303c0a81283b35d9b6 +0 -0
  98. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/78/3d4167bc95c9d2175e0df03ef1c1c880ba75ab +0 -0
  99. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/79/7ae089b2212a937840e215276005ce76881307 +0 -0
  100. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/7e/5956c806b5edc344d46dab599dec337891ba1f +0 -0
  101. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/81/8f26b7bf042269729020cf944fc362d66ba27e +0 -0
  102. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/82/70b319ce4046854fbe7dc41054b6c2d112dab2 +0 -0
  103. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/84/59071b722a255b774a80b27746033f8141ab39 +0 -0
  104. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/85/aee46f478e9afdb84d50a05242c53b04ed2e21 +0 -0
  105. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/86/e288b46f8fe179907e4413f665aeb5053fddb1 +0 -0
  106. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/87/ef1fc3f7f1ddc4d0ab9b3e65381ce9f3388621 +0 -0
  107. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/8b/84f56978e1de8f2ae82abce5f8b3e182d365cd +0 -0
  108. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/8e/55a7d2b96184030211f20c9b9af201eefcac82 +0 -0
  109. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/91/c69ad88fe0ba94aa7859fb5f7edac5e6f1a3f7 +0 -0
  110. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/94/74152b4b463d70ae5ad07f0c658be3e296026b +0 -0
  111. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/94/f7dbe88e80c4205a901b71eb8f181974376bba +0 -0
  112. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/97/1aef09ea939f46b60b9646f8d524c78a9220f4 +0 -0
  113. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/9b/ec5ee2236ee2d5532c36bfd132e23c58fdb69c +0 -0
  114. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/9d/0df52899fe95279059286d9c0ec42287edc168 +0 -0
  115. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/a1/5389729850729fc7bd78a54f26fce77f30be12 +0 -0
  116. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/a1/906da89d1174f74867800c74c43af36253bd5e +0 -0
  117. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/a4/63fdd23e5efd713db8a71f316f3a1c7bd60916 +0 -0
  118. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/a5/ec8f74642fbba27f7ea78c53b372ae0c7dedce +0 -0
  119. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/a7/3e13eafee65c5b8d73ad2d3ea46d0eee82f0d3 +0 -0
  120. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/b0/56be4be89ba6b76949dd641df45bb7036050c8 +0 -0
  121. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/b0/9cd7856d58590578ee1a4f3ad45d1310a97f87 +0 -0
  122. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/b2/18e6a0f0f1c4df8cdefa9852058348abc713b7 +0 -0
  123. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/b3/4f7f271c6d6105e35a6556ffda71d03afe8c96 +0 -0
  124. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/b3/69579064bde9de9a19d114fc33e4e48cc8c0e4 +0 -0
  125. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/b5/61831c7dce8ea51e7ee6b6fa35745f14d8242d +0 -0
  126. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/b7/2c9e75ab7d0afe594664650aa8f6c772f5ac64 +0 -0
  127. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/bb/81ccc0513f18fc160b54a82861e9a80d23f4f6 +0 -0
  128. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/bb/934eb33bc1a8b85630bf680caffd99560c1b8f +0 -0
  129. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/bf/67907e337021ebff434e02b19b30a741c144af +0 -0
  130. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/bf/b54d65922ce1dfda1aaa014913a54e7172d0bc +0 -0
  131. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/c1/20fc812b9ad311c34a3608512d6a9d976bb48e +0 -0
  132. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/c1/397c6ed72c4e20ef6b9ab83163e9a6baba5b45 +0 -0
  133. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/c4/cba65f1163661999ee4b8ed23342b63bc1300c +0 -0
  134. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/c6/7f17e5707313600efcb85e9a3fedea35dba591 +0 -0
  135. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/c6/f32aced880bd165a251cb52b26b0c1107e2141 +0 -0
  136. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/cc/45df1d317a2eb63ff1ff3a5f3b4a9f98fd92b5 +0 -0
  137. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/cd/822b3574a88ebdd1ed82fd6983f37e626d52b4 +0 -0
  138. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/cf/0c0d9c6fb09473aaeb7f7e2edbd770c3f2ef3d +0 -0
  139. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/d2/992df305f4b56a466a2f221aeb182ddd20f418 +0 -0
  140. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/d6/39e8af592cd75a318d8affddd1bcc70c2095f2 +0 -0
  141. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/d6/9ab1c4aadf279936dd778e8346ba60f74705b6 +0 -0
  142. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/d8/4688b54c0040a30976b3a6540bc47adf7ce680 +0 -0
  143. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/d9/005f2cc7fc4e65f14ed5518276007c08cf2fd0 +0 -0
  144. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/d9/c2403fd166ce791b4e9d0c6792ed8342c71fcd +0 -0
  145. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/d9/dfa5aee51e92a541b707e8e7baea6f06deff98 +0 -0
  146. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/db/141dbaa93594df2a8156182f361ee4db829359 +0 -0
  147. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/db/3f2cd643292057936230b95cf7ec3046affe11 +0 -0
  148. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/db/ffa8ea7bda721d0cee7b9e4ce5b2ef927733ff +0 -0
  149. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/dc/c2bdbafb3296e09d9ee4955cfa55d275825f94 +0 -0
  150. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/dc/cdbd4266765d840be2ae35ab1752a0fa312c16 +0 -0
  151. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/dd/87fb5f606fe380d81e6fe3a2c98f9f99e3e09b +0 -0
  152. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/de/214c626ac2dd2685bfaa0bc0fc20f528d014d7 +0 -0
  153. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/df/e0770424b2a19faf507a501ebfc23be8f54e7b +0 -0
  154. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/e2/f2f8f4c25e62a297fc55f36acc6b01cfbab76f +0 -0
  155. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/e3/1356f90ea6dd0577b5e0b40b206319adcbf085 +0 -0
  156. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/e3/5a4dafc50850cacac7bf76c56db2715cbda2c4 +0 -0
  157. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/e4/6c715352db9fe3c887a635f1916df4ca1f4ff9 +0 -0
  158. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/e5/0580a0bd1e1b3d29f834382b80fceb61d5cf0c +0 -0
  159. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/e9/391ffe371f1cc43b42ef09b705d9c767c2e14f +0 -0
  160. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/ea/3a18cc75e53792744ef754e05d3f4481768c13 +0 -0
  161. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/ec/40fd8bf8e4c342534a9fc020289e402ba6bc9d +0 -0
  162. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/ec/d980279432b13f0374b90ca439a6329cdece0f +0 -0
  163. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/ee/cee64eacaff022dcdc509c0c2b1da492f21060 +0 -0
  164. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/f1/e50757fddc28b445545dc7e2759b54cdd0f42e +0 -0
  165. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/f4/b64d3107b39e3ad6f540c6607004ea34e6c024 +0 -0
  166. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/f4/ba7f815b886797b73fede071d86e0c134d2bc7 +0 -0
  167. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/f5/61c3c1bf1c9ea9c9d1f556a7be2869f71f3bdf +0 -0
  168. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/f6/44a8ff56fa035105fc517cbb1ac46c3d8e349a +0 -0
  169. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/f7/c98ba5c2f903e603b1f5e63d49fbc8a43815cc +0 -0
  170. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/f9/045a08e96eb76848fc4d68e3e3e687cca39a2d +0 -0
  171. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/fa/147e6bb78a2e8db241d231295fd7f1ed061af8 +0 -0
  172. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/objects/fc/292e793ecfd42240ac43be407023bd731fa9e7 +0 -0
  173. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/refs/heads/main +0 -0
  174. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/refs/remotes/origin/HEAD +0 -0
  175. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.git/refs/remotes/origin/main +0 -0
  176. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.gitattributes +0 -0
  177. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/.gitignore +0 -0
  178. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/LICENSE +0 -0
  179. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/README.md +0 -0
  180. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/__init__.py +0 -0
  181. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/batman.py +0 -0
  182. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/brain_atlas.py +0 -0
  183. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/chat.py +0 -0
  184. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/correlators.py +0 -0
  185. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/data/.DS_Store +0 -0
  186. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/data/db2ls_sql_chtsht.json +0 -0
  187. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/data/docs_links.json +0 -0
  188. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/data/email/email_html_template.html +0 -0
  189. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/data/lang_code_iso639.json +0 -0
  190. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/data/mygenes_fields_241022.txt +0 -0
  191. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/data/sns_info.json +0 -0
  192. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/data/styles/example/style1.pdf +0 -0
  193. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/data/styles/example/style2.pdf +0 -0
  194. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/data/styles/example/style3.pdf +0 -0
  195. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/data/styles/example/style4.pdf +0 -0
  196. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/data/styles/example/style5.pdf +0 -0
  197. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/data/styles/example/style6.pdf +0 -0
  198. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/data/styles/example/style7.pdf +0 -0
  199. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/data/styles/example/style8.pdf +0 -0
  200. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/data/styles/example/style9.pdf +0 -0
  201. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/data/styles/style1.json +0 -0
  202. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/data/styles/style10.json +0 -0
  203. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/data/styles/style11.json +0 -0
  204. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/data/styles/style12.json +0 -0
  205. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/data/styles/style2.json +0 -0
  206. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/data/styles/style3.json +0 -0
  207. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/data/styles/style4.json +0 -0
  208. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/data/styles/style5.json +0 -0
  209. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/data/styles/style6.json +0 -0
  210. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/data/styles/style7.json +0 -0
  211. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/data/styles/style8.json +0 -0
  212. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/data/styles/style9.json +0 -0
  213. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/data/usages_pd copy.json +0 -0
  214. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/data/usages_pd.json +0 -0
  215. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/data/usages_sns.json +0 -0
  216. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/db2ls.py +0 -0
  217. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/doc.py +0 -0
  218. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/export_requirements.py +0 -0
  219. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/fetch_update.py +0 -0
  220. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/freqanalysis.py +0 -0
  221. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/ich2ls.py +0 -0
  222. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/ml2ls.py +0 -0
  223. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/netfinder.py +0 -0
  224. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/ocr.py +0 -0
  225. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/setuptools-70.1.0-py3-none-any.whl +0 -0
  226. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/sleep_events_detectors.py +0 -0
  227. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/stats.py +0 -0
  228. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/translator.py +0 -0
  229. {py2ls-0.2.4.4 → py2ls-0.2.4.5}/py2ls/wb_detector.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: py2ls
3
- Version: 0.2.4.4
3
+ Version: 0.2.4.5
4
4
  Summary: py(thon)2(too)ls
5
5
  Author: Jianfeng
6
6
  Author-email: Jianfeng.Liu0413@gmail.com
@@ -324,7 +324,7 @@ def find_condition(data:pd.DataFrame, columns=["characteristics_ch1","title"]):
324
324
  # 详细看看每个信息的有哪些类, 其中有数字的, 要去除
325
325
  for col in columns:
326
326
  print(f"{"="*10} {col} {"="*10}")
327
- display(ips.flatten([ips.ssplit(i, by="numer")[0] for i in data[col]]))
327
+ display(ips.flatten([ips.ssplit(i, by="numer")[0] for i in data[col]],verbose=False))
328
328
 
329
329
  def add_condition(
330
330
  data: pd.DataFrame,
@@ -581,7 +581,7 @@ def batch_effect(
581
581
  return df_corrected
582
582
 
583
583
  def get_common_genes(elment1, elment2):
584
- common_genes=ips.shared(elment1, elment2)
584
+ common_genes=ips.shared(elment1, elment2,verbose=False)
585
585
  return common_genes
586
586
 
587
587
  def counts2expression(
@@ -667,7 +667,7 @@ def counts2expression(
667
667
 
668
668
  length.index=length.index.astype(str).str.strip()
669
669
  counts.columns = counts.columns.astype(str).str.strip()
670
- shared_genes=ips.shared(length.index, counts.columns)
670
+ shared_genes=ips.shared(length.index, counts.columns,verbose=False)
671
671
  length=length.loc[shared_genes]
672
672
  counts=counts.loc[:,shared_genes]
673
673
  columns_org = counts.columns.tolist()
@@ -842,6 +842,7 @@ def scope_genes(gene_list: list, scopes:str=None, fields: str = "symbol", specie
842
842
 
843
843
  def get_enrichr(gene_symbol_list,
844
844
  gene_sets:str,
845
+ download:bool = False,
845
846
  species='Human',
846
847
  dir_save="./",
847
848
  plot_=False,
@@ -854,6 +855,7 @@ def get_enrichr(gene_symbol_list,
854
855
  title=None,# 'KEGG'
855
856
  cutoff=0.05,
856
857
  cmap="coolwarm",
858
+ size=5,
857
859
  **kwargs):
858
860
  """
859
861
  Note: Enrichr uses a list of Entrez gene symbols as input.
@@ -878,16 +880,22 @@ def get_enrichr(gene_symbol_list,
878
880
  lib_support_names = gp.get_library_name()
879
881
  # correct input gene_set name
880
882
  gene_sets_name=ips.strcmp(gene_sets,lib_support_names)[0]
883
+
881
884
  # download it
882
- gene_sets = gp.get_library(name=gene_sets_name, organism=species)
883
- print(f"gene_sets get ready: {gene_sets_name}")
885
+ if download:
886
+ gene_sets = gp.get_library(name=gene_sets_name, organism=species)
887
+ else:
888
+ gene_sets = gene_sets_name # 避免重复下载
889
+ print(f"\ngene_sets get ready: {gene_sets_name}")
884
890
 
885
891
  # gene symbols are uppercase
886
892
  gene_symbol_list=[str(i).upper() for i in gene_symbol_list]
887
893
 
888
894
  # # check how shared genes
889
- if check_shared:
890
- shared_genes=ips.shared(ips.flatten(gene_symbol_list,verbose=False), ips.flatten(gene_sets,verbose=False))
895
+ if check_shared and isinstance(gene_sets, dict):
896
+ shared_genes=ips.shared(ips.flatten(gene_symbol_list,verbose=False),
897
+ ips.flatten(gene_sets,verbose=False),
898
+ verbose=False)
891
899
 
892
900
  #! enrichr
893
901
  try:
@@ -903,13 +911,13 @@ def get_enrichr(gene_symbol_list,
903
911
  return None
904
912
 
905
913
  results_df = enr.results
906
- print(f"got enrichr reslutls; shape: {results_df.shape}")
914
+ print(f"got enrichr reslutls; shape: {results_df.shape}\n")
907
915
  results_df["-log10(Adjusted P-value)"] = -np.log10(results_df["Adjusted P-value"])
908
916
  results_df.sort_values("-log10(Adjusted P-value)", inplace=True, ascending=False)
909
917
 
910
918
  if plot_:
911
919
  if palette is None:
912
- palette=plot.get_color(n_top, cmap="coolwarm")[::-1]
920
+ palette=plot.get_color(n_top, cmap=cmap)[::-1]
913
921
  #! barplot
914
922
  if n_top<5:
915
923
  height_=4
@@ -921,11 +929,12 @@ def get_enrichr(gene_symbol_list,
921
929
  height_=7
922
930
  elif 15<=n_top<20:
923
931
  height_=8
924
- elif 25<=n_top<30:
932
+ elif 20<=n_top<30:
925
933
  height_=9
926
934
  else:
927
935
  height_=int(n_top/3)
928
- plt.figure(figsize=[5, height_])
936
+ plt.figure(figsize=[10, height_])
937
+
929
938
  ax1=plot.plotxy(
930
939
  data=results_df.head(n_top),
931
940
  kind="barplot",
@@ -935,18 +944,17 @@ def get_enrichr(gene_symbol_list,
935
944
  palette=palette,
936
945
  legend=None,
937
946
  )
947
+ plot.figsets(ax=ax1, **kws_figsets)
938
948
  if dir_save:
939
949
  ips.figsave(f"{dir_save} enr_barplot.pdf")
940
- plot.figsets(ax=ax1, **kws_figsets)
941
950
  plt.show()
942
951
 
943
952
  #! dotplot
944
953
  cutoff_curr = cutoff
945
954
  step=0.05
946
955
  cutoff_stop = 0.5
947
- while cutoff_curr <=cutoff_stop:
956
+ while cutoff_curr <= cutoff_stop:
948
957
  try:
949
- print(kws_figsets)
950
958
  if cutoff_curr!=cutoff:
951
959
  plt.clf()
952
960
  ax2 = gp.dotplot(enr.res2d,
@@ -957,7 +965,8 @@ def get_enrichr(gene_symbol_list,
957
965
  cmap=cmap,
958
966
  cutoff=cutoff_curr,
959
967
  top_term=n_top,
960
- figsize=[6, height_])
968
+ size=size,
969
+ figsize=[10, height_])
961
970
  if len(ax2.collections)>=n_top:
962
971
  print(f"cutoff={cutoff_curr} done! ")
963
972
  break
@@ -975,6 +984,420 @@ def get_enrichr(gene_symbol_list,
975
984
 
976
985
  return results_df
977
986
 
987
+ def plot_enrichr(results_df,
988
+ kind="bar",# 'barplot', 'dotplot'
989
+ cutoff=0.05,
990
+ show_ring=False,
991
+ xticklabels_rot=0,
992
+ title=None,# 'KEGG'
993
+ cmap="coolwarm",
994
+ n_top=10,
995
+ size=5,
996
+ ax=None,
997
+ **kwargs):
998
+ kws_figsets = {}
999
+ for k_arg, v_arg in kwargs.items():
1000
+ if "figset" in k_arg:
1001
+ kws_figsets = v_arg
1002
+ kwargs.pop(k_arg, None)
1003
+ break
1004
+ if isinstance(cmap,str):
1005
+ palette = plot.get_color(n_top, cmap=cmap)[::-1]
1006
+ elif isinstance(cmap,list):
1007
+ palette=cmap
1008
+
1009
+ if n_top<5:
1010
+ height_=4
1011
+ elif 5<=n_top<10:
1012
+ height_=5
1013
+ elif 5<=n_top<10:
1014
+ height_=6
1015
+ elif 10<=n_top<15:
1016
+ height_=7
1017
+ elif 15<=n_top<20:
1018
+ height_=8
1019
+ elif 20<=n_top<30:
1020
+ height_=9
1021
+ else:
1022
+ height_=int(n_top/3)
1023
+ if ax is None:
1024
+ _,ax=plt.subplots(1,1,figsize=[10, height_])
1025
+ #! barplot
1026
+ if 'bar' in kind.lower():
1027
+ ax=plot.plotxy(
1028
+ data=results_df.head(n_top),
1029
+ kind="barplot",
1030
+ x="-log10(Adjusted P-value)",
1031
+ y="Term",
1032
+ hue="Term",
1033
+ palette=palette,
1034
+ legend=None,
1035
+ )
1036
+ plot.figsets(ax=ax, **kws_figsets)
1037
+ return ax,results_df
1038
+ #! dotplot
1039
+ elif 'dot' in kind.lower():
1040
+ #! dotplot
1041
+ cutoff_curr = cutoff
1042
+ step=0.05
1043
+ cutoff_stop = 0.5
1044
+ while cutoff_curr <= cutoff_stop:
1045
+ try:
1046
+ if cutoff_curr!=cutoff:
1047
+ plt.clf()
1048
+ ax = gp.dotplot(results_df,
1049
+ column="Adjusted P-value",
1050
+ show_ring=show_ring,
1051
+ xticklabels_rot=xticklabels_rot,
1052
+ title=title,
1053
+ cmap=cmap,
1054
+ cutoff=cutoff_curr,
1055
+ top_term=n_top,
1056
+ size=size,
1057
+ figsize=[10, height_])
1058
+ if len(ax.collections)>=n_top:
1059
+ print(f"cutoff={cutoff_curr} done! ")
1060
+ break
1061
+ if cutoff_curr==cutoff_stop:
1062
+ break
1063
+ cutoff_curr+=step
1064
+ except Exception as e:
1065
+ cutoff_curr+=step
1066
+ print(f"Warning: trying cutoff={cutoff_curr}, cutoff={cutoff_curr-step} failed: {e} ")
1067
+ plot.figsets(ax=ax, **kws_figsets)
1068
+ return ax,results_df
1069
+ #! barplot with counts
1070
+ elif 'count' in kind.lower():
1071
+ # 从overlap中提取出个数
1072
+ results_df["count"] = results_df["Overlap"].apply(
1073
+ lambda x: int(x.split("/")[0]) if isinstance(x, str) else x)
1074
+ df_=results_df.sort_values(by="count", ascending=False)
1075
+ ax=plot.plotxy(
1076
+ data=df_.head(n_top),
1077
+ kind="barplot",
1078
+ x="count",
1079
+ y="Term",
1080
+ hue="Term",
1081
+ palette=palette,
1082
+ legend=None,
1083
+ ax=ax
1084
+ )
1085
+
1086
+ plot.figsets(ax=ax, **kws_figsets)
1087
+ return ax,df_
1088
+
1089
+ def plot_bp_cc_mf(
1090
+ deg_gene_list,
1091
+ gene_sets=[
1092
+ "GO_Biological_Process_2023",
1093
+ "GO_Cellular_Component_2023",
1094
+ "GO_Molecular_Function_2023",
1095
+ ],
1096
+ species="human",
1097
+ n_top=10,
1098
+ plot_=True,
1099
+ ax=None,
1100
+ palette=plot.get_color(3),
1101
+ ** kwargs,
1102
+ ):
1103
+
1104
+ def res_enrichr_2_count(res_enrichr, n_top=10):
1105
+ """把enrich resulst 提取出count,并排序"""
1106
+ res_enrichr["Count"] = res_enrichr["Overlap"].apply(
1107
+ lambda x: int(x.split("/")[0]) if isinstance(x, str) else x
1108
+ )
1109
+ res_enrichr.sort_values(by="Count", ascending=False, inplace=True)
1110
+
1111
+ return res_enrichr.head(n_top)#[["Term", "Count"]]
1112
+
1113
+ res_enrichr_BP = get_enrichr(
1114
+ deg_gene_list, gene_sets[0], species=species, plot_=False
1115
+ )
1116
+ res_enrichr_CC = get_enrichr(
1117
+ deg_gene_list, gene_sets[1], species=species, plot_=False
1118
+ )
1119
+ res_enrichr_MF = get_enrichr(
1120
+ deg_gene_list, gene_sets[2], species=species, plot_=False
1121
+ )
1122
+
1123
+ df_BP = res_enrichr_2_count(res_enrichr_BP, n_top=n_top)
1124
+ df_BP["Ontology"] = ["BP"] * n_top
1125
+
1126
+ df_CC = res_enrichr_2_count(res_enrichr_CC, n_top=n_top)
1127
+ df_CC["Ontology"] = ["CC"] * n_top
1128
+
1129
+ df_MF = res_enrichr_2_count(res_enrichr_MF, n_top=n_top)
1130
+ df_MF["Ontology"] = ["MF"] * n_top
1131
+
1132
+ # 合并
1133
+ df2plot = pd.concat([df_BP, df_CC, df_MF])
1134
+ n_top=n_top*3
1135
+ if n_top < 5:
1136
+ height_ = 4
1137
+ elif 5 <= n_top < 10:
1138
+ height_ = 5
1139
+ elif 10 <= n_top < 15:
1140
+ height_ = 6
1141
+ elif 15 <= n_top < 20:
1142
+ height_ = 7
1143
+ elif 20 <= n_top < 30:
1144
+ height_ = 8
1145
+ elif 30 <= n_top < 40:
1146
+ height_ = int(n_top / 4)
1147
+ else:
1148
+ height_ = int(n_top / 5)
1149
+ if ax is None:
1150
+ _,ax=plt.subplots(1,1,figsize=[10, height_])
1151
+ # 作图
1152
+ if df2plot["Term"].tolist()[0].endswith(")"):
1153
+ df2plot["Term"] = df2plot["Term"].apply(lambda x: x.split("(")[0][:-1])
1154
+ if plot_:
1155
+ ax = plot.plotxy(
1156
+ data=df2plot,
1157
+ x="Count",
1158
+ y="Term",
1159
+ hue="Ontology",
1160
+ kind="bar",
1161
+ palette=palette,
1162
+ ax=ax,
1163
+ **kwargs
1164
+ )
1165
+ return ax, df2plot
1166
+
1167
+ def get_library_name():
1168
+ return gp.get_library_name()
1169
+
1170
+ def get_gsva(
1171
+ data_gene_samples: pd.DataFrame, # index(gene),columns(samples)
1172
+ gene_sets: str,
1173
+ species:str="Human",
1174
+ dir_save:str="./",
1175
+ plot_:bool=False,
1176
+ n_top:int=30,
1177
+ check_shared:bool=True,
1178
+ cmap="coolwarm",
1179
+ min_size=1,
1180
+ max_size=1000,
1181
+ kcdf="Gaussian",# 'Gaussian' for continuous data
1182
+ method='gsva',
1183
+ seed=1,
1184
+ **kwargs,
1185
+ ):
1186
+ kws_figsets = {}
1187
+ for k_arg, v_arg in kwargs.items():
1188
+ if "figset" in k_arg:
1189
+ kws_figsets = v_arg
1190
+ kwargs.pop(k_arg, None)
1191
+ break
1192
+ species_org = species
1193
+ # organism (str) – Select one from { ‘Human’, ‘Mouse’, ‘Yeast’, ‘Fly’, ‘Fish’, ‘Worm’ }
1194
+ organisms = ["Human", "Mouse", "Yeast", "Fly", "Fish", "Worm"]
1195
+ species = ips.strcmp(species, organisms)[0]
1196
+ if species_org.lower() != species.lower():
1197
+ print(f"species was corrected to {species}, becasue only support {organisms}")
1198
+ if os.path.isfile(gene_sets):
1199
+ gene_sets_name = os.path.basename(gene_sets)
1200
+ gene_sets = ips.fload(gene_sets)
1201
+ else:
1202
+ lib_support_names = gp.get_library_name()
1203
+ # correct input gene_set name
1204
+ gene_sets_name = ips.strcmp(gene_sets, lib_support_names)[0]
1205
+ # download it
1206
+ gene_sets = gp.get_library(name=gene_sets_name, organism=species)
1207
+ print(f"gene_sets get ready: {gene_sets_name}")
1208
+
1209
+ # gene symbols are uppercase
1210
+ gene_symbol_list = [str(i).upper() for i in data_gene_samples.index]
1211
+ data_gene_samples.index=gene_symbol_list
1212
+ # display(data_gene_samples.head(3))
1213
+ # # check how shared genes
1214
+ if check_shared:
1215
+ ips.shared(
1216
+ ips.flatten(gene_symbol_list, verbose=False),
1217
+ ips.flatten(gene_sets, verbose=False),
1218
+ verbose=False
1219
+ )
1220
+ gsva_results = gp.gsva(
1221
+ data=data_gene_samples, # matrix should have genes as rows and samples as columns
1222
+ gene_sets=gene_sets,
1223
+ outdir=None,
1224
+ kcdf=kcdf, # 'Gaussian' for continuous data
1225
+ min_size=min_size,
1226
+ method=method,
1227
+ max_size=max_size,
1228
+ verbose=True,
1229
+ seed=seed,
1230
+ # no_plot=False,
1231
+ )
1232
+ gsva_res = gsva_results.res2d.copy()
1233
+ gsva_res["ES_abs"] = gsva_res["ES"].apply(np.abs)
1234
+ gsva_res = gsva_res.sort_values(by="ES_abs", ascending=False)
1235
+ gsva_res = (
1236
+ gsva_res.drop_duplicates(subset="Term").drop(columns="ES_abs")
1237
+ # .iloc[:80, :]
1238
+ .reset_index(drop=True)
1239
+ )
1240
+ gsva_res = gsva_res.sort_values(by="ES", ascending=False)
1241
+ if plot_:
1242
+ if gsva_res.shape[0]>=2*n_top:
1243
+ gsva_res_plot=pd.concat([gsva_res.head(n_top),gsva_res.tail(n_top)])
1244
+ else:
1245
+ gsva_res_plot = gsva_res
1246
+ if isinstance(cmap,str):
1247
+ palette = plot.get_color(n_top*2, cmap=cmap)[::-1]
1248
+ elif isinstance(cmap,list):
1249
+ if len(cmap)==2:
1250
+ palette = [cmap[0]]*n_top+[cmap[1]]*n_top
1251
+ else:
1252
+ palette=cmap
1253
+ # ! barplot
1254
+ if n_top < 5:
1255
+ height_ = 3
1256
+ elif 5 <= n_top < 10:
1257
+ height_ = 4
1258
+ elif 10 <= n_top < 15:
1259
+ height_ = 5
1260
+ elif 15 <= n_top < 20:
1261
+ height_ = 6
1262
+ elif 20 <= n_top < 30:
1263
+ height_ = 7
1264
+ elif 30 <= n_top < 40:
1265
+ height_ = int(n_top / 3.5)
1266
+ else:
1267
+ height_ = int(n_top / 3)
1268
+ plt.figure(figsize=[10, height_])
1269
+ ax2 = plot.plotxy(
1270
+ data=gsva_res_plot,
1271
+ x="ES",
1272
+ y="Term",
1273
+ hue="Term",
1274
+ palette=palette,
1275
+ kind=["bar"],
1276
+ figsets=dict(yticklabel=[], ticksloc="b", boxloc="b", ylabel=None),
1277
+ )
1278
+ # 改变labels的位置
1279
+ for i, bar in enumerate(ax2.patches):
1280
+ term = gsva_res_plot.iloc[i]["Term"]
1281
+ es_value = gsva_res_plot.iloc[i]["ES"]
1282
+
1283
+ # Positive ES values: Align y-labels to the left
1284
+ if es_value > 0:
1285
+ ax2.annotate(
1286
+ term,
1287
+ xy=(0, bar.get_y() + bar.get_height() / 2),
1288
+ xytext=(-5, 0), # Move to the left
1289
+ textcoords="offset points",
1290
+ ha="right",
1291
+ va="center", # Align labels to the right
1292
+ fontsize=10,
1293
+ color="black",
1294
+ )
1295
+ # Negative ES values: Align y-labels to the right
1296
+ else:
1297
+ ax2.annotate(
1298
+ term,
1299
+ xy=(0, bar.get_y() + bar.get_height() / 2),
1300
+ xytext=(5, 0), # Move to the right
1301
+ textcoords="offset points",
1302
+ ha="left",
1303
+ va="center", # Align labels to the left
1304
+ fontsize=10,
1305
+ color="black",
1306
+ )
1307
+ plot.figsets(ax=ax2, **kws_figsets)
1308
+ if dir_save:
1309
+ ips.figsave(dir_save + f"GSVA_{gene_sets_name}.pdf")
1310
+ plt.show()
1311
+ return gsva_res.reset_index(drop=True)
1312
+
1313
+ def plot_gsva(gsva_res, # output from bio.get_gsva()
1314
+ n_top=10,
1315
+ ax=None,
1316
+ x="ES",
1317
+ y="Term",
1318
+ hue="Term",
1319
+ cmap="coolwarm",
1320
+ **kwargs
1321
+ ):
1322
+ kws_figsets = {}
1323
+ for k_arg, v_arg in kwargs.items():
1324
+ if "figset" in k_arg:
1325
+ kws_figsets = v_arg
1326
+ kwargs.pop(k_arg, None)
1327
+ break
1328
+ # ! barplot
1329
+ if n_top < 5:
1330
+ height_ = 4
1331
+ elif 5 <= n_top < 10:
1332
+ height_ = 5
1333
+ elif 10 <= n_top < 15:
1334
+ height_ = 6
1335
+ elif 15 <= n_top < 20:
1336
+ height_ = 7
1337
+ elif 20 <= n_top < 30:
1338
+ height_ = 8
1339
+ elif 30 <= n_top < 40:
1340
+ height_ = int(n_top / 3.5)
1341
+ else:
1342
+ height_ = int(n_top / 3)
1343
+ if ax is None:
1344
+ _,ax=plt.subplots(1,1,figsize=[10, height_])
1345
+ gsva_res = gsva_res.sort_values(by=x, ascending=False)
1346
+
1347
+ if gsva_res.shape[0]>=2*n_top:
1348
+ gsva_res_plot=pd.concat([gsva_res.head(n_top),gsva_res.tail(n_top)])
1349
+ else:
1350
+ gsva_res_plot = gsva_res
1351
+ if isinstance(cmap,str):
1352
+ palette = plot.get_color(n_top*2, cmap=cmap)[::-1]
1353
+ elif isinstance(cmap,list):
1354
+ if len(cmap)==2:
1355
+ palette = [cmap[0]]*n_top+[cmap[1]]*n_top
1356
+ else:
1357
+ palette=cmap
1358
+
1359
+ ax = plot.plotxy(
1360
+ ax=ax,
1361
+ data=gsva_res_plot,
1362
+ x=x,
1363
+ y=y,
1364
+ hue=hue,
1365
+ palette=palette,
1366
+ kind=["bar"],
1367
+ figsets=dict(yticklabel=[], ticksloc="b", boxloc="b", ylabel=None),
1368
+ )
1369
+ # 改变labels的位置
1370
+ for i, bar in enumerate(ax.patches):
1371
+ term = gsva_res_plot.iloc[i]["Term"]
1372
+ es_value = gsva_res_plot.iloc[i]["ES"]
1373
+
1374
+ # Positive ES values: Align y-labels to the left
1375
+ if es_value > 0:
1376
+ ax.annotate(
1377
+ term,
1378
+ xy=(0, bar.get_y() + bar.get_height() / 2),
1379
+ xytext=(-5, 0), # Move to the left
1380
+ textcoords="offset points",
1381
+ ha="right",
1382
+ va="center", # Align labels to the right
1383
+ fontsize=10,
1384
+ color="black",
1385
+ )
1386
+ # Negative ES values: Align y-labels to the right
1387
+ else:
1388
+ ax.annotate(
1389
+ term,
1390
+ xy=(0, bar.get_y() + bar.get_height() / 2),
1391
+ xytext=(5, 0), # Move to the right
1392
+ textcoords="offset points",
1393
+ ha="left",
1394
+ va="center", # Align labels to the left
1395
+ fontsize=10,
1396
+ color="black",
1397
+ )
1398
+ plot.figsets(ax=ax, **kws_figsets)
1399
+ return ax
1400
+
978
1401
 
979
1402
  #! https://string-db.org/help/api/
980
1403
 
@@ -1296,7 +1719,12 @@ def plot_ppi(
1296
1719
  )
1297
1720
  plot.figsets(ax=ax,**kws_figsets)
1298
1721
  ax.axis("off")
1299
- net.write_html(dir_save)
1722
+ if dir_save:
1723
+ if not os.path.basename(dir_save):
1724
+ dir_save="_.html"
1725
+ net.write_html(dir_save)
1726
+ nx.write_graphml(G, dir_save.replace(".html",".graphml")) # Export to GraphML
1727
+ print(f"could be edited in Cytoscape \n{dir_save.replace(".html",".graphml")}")
1300
1728
  return G,ax
1301
1729
 
1302
1730
 
@@ -554,14 +554,14 @@ def shared(*args, strict=True, n_shared=2, verbose=True):
554
554
  # Get elements that appear in at least n_shared lists
555
555
  shared_elements = [item for item, count in element_count.items() if count >= n_shared]
556
556
 
557
- shared_elements = flatten(shared_elements)
557
+ shared_elements = flatten(shared_elements, verbose=verbose)
558
558
  if verbose:
559
559
  elements2show = shared_elements if len(shared_elements)<10 else shared_elements[:5]
560
560
  print(f"{' '*2}{len(shared_elements)} elements shared: {' '*2}{elements2show}")
561
561
  print("********* checking shared elements *********")
562
562
  return shared_elements
563
563
 
564
- def flatten(nested: Any, unique_list=True,verbose=True):
564
+ def flatten(nested: Any, unique_list=True, verbose=True):
565
565
  """
566
566
  Recursively flattens a nested structure (lists, tuples, dictionaries, sets) into a single list.
567
567
  Parameters:
@@ -2840,7 +2840,7 @@ def listdir(
2840
2840
  # print(result)
2841
2841
  # df=listdir("/", contains='sss',sort_by='name',ascending=False)
2842
2842
  # print(df.fname.to_list(),"\n",df.fpath.to_list())
2843
- def list_func(lib_name, opt="call"):
2843
+ def listfunc(lib_name, opt="call"):
2844
2844
  if opt == "call":
2845
2845
  funcs = [func for func in dir(lib_name) if callable(getattr(lib_name, func))]
2846
2846
  else:
@@ -2220,6 +2220,9 @@ def figsets(*args, **kwargs):
2220
2220
  legend = ax.get_legend()
2221
2221
  if legend is not None:
2222
2222
  legend.remove()
2223
+ if any(['colorbar' in key.lower(),'cbar' in key.lower()]) and "loc" in key.lower():
2224
+ cbar = ax.collections[0].colorbar # Access the colorbar from the plot
2225
+ cbar.ax.set_position(value) # [left, bottom, width, height] [0.475, 0.15, 0.04, 0.25]
2223
2226
 
2224
2227
  for arg in args:
2225
2228
  if isinstance(arg, matplotlib.axes._axes.Axes):
@@ -2708,15 +2711,45 @@ def adjust_spines(ax=None, spines=["left", "bottom"], distance=2):
2708
2711
  # And then plot the data:
2709
2712
 
2710
2713
 
2711
- def add_colorbar(im, width=None, pad=None, **kwargs):
2712
- # usage: add_colorbar(im, width=0.01, pad=0.005, label="PSD (dB)", shrink=0.8)
2713
- l, b, w, h = im.axes.get_position().bounds # get boundaries
2714
- width = width or 0.1 * w # get width of the colorbar
2715
- pad = pad or width # get pad between im and cbar
2716
- fig = im.axes.figure # get figure of image
2717
- cax = fig.add_axes([l + w + pad, b, width, h]) # define cbar Axes
2718
- return fig.colorbar(im, cax=cax, **kwargs) # draw cbar
2714
+ # def add_colorbar(im, width=None, pad=None, **kwargs):
2715
+ # # usage: add_colorbar(im, width=0.01, pad=0.005, label="PSD (dB)", shrink=0.8)
2716
+ # l, b, w, h = im.axes.get_position().bounds # get boundaries
2717
+ # width = width or 0.1 * w # get width of the colorbar
2718
+ # pad = pad or width # get pad between im and cbar
2719
+ # fig = im.axes.figure # get figure of image
2720
+ # cax = fig.add_axes([l + w + pad, b, width, h]) # define cbar Axes
2721
+ # return fig.colorbar(im, cax=cax, **kwargs) # draw cbar
2722
+
2723
+ def add_colorbar(im,
2724
+ cmap="viridis",
2725
+ vmin=-1,
2726
+ vmax=1,
2727
+ orientation='vertical',
2728
+ width_ratio=0.05,
2729
+ pad_ratio=0.02,
2730
+ shrink=1.0,
2731
+ **kwargs):
2732
+ import matplotlib as mpl
2733
+ if all([cmap, vmin, vmax]):
2734
+ norm = mpl.colors.Normalize(vmin=vmin, vmax=vmax)
2735
+ else:
2736
+ norm=False
2737
+ sm = plt.cm.ScalarMappable(cmap=cmap, norm=norm)
2738
+ sm.set_array([])
2739
+ l, b, w, h = im.axes.get_position().bounds # position: left, bottom, width, height
2740
+ if orientation == 'vertical':
2741
+ width = width_ratio * w
2742
+ pad = pad_ratio * w
2743
+ cax = im.figure.add_axes([l + w + pad, b, width, h * shrink]) # Right of the image
2744
+ else:
2745
+ height = width_ratio * h
2746
+ pad = pad_ratio * h
2747
+ cax = im.figure.add_axes([l, b - height - pad, w * shrink, height]) # Below the image
2748
+ cbar=im.figure.colorbar(sm, cax=cax, orientation=orientation, **kwargs)
2749
+ return cbar
2719
2750
 
2751
+ # Usage:
2752
+ # add_colorbar(im, width_ratio=0.03, pad_ratio=0.01, orientation='horizontal', label="PSD (dB)")
2720
2753
 
2721
2754
  def generate_xticks_with_gap(x_len, hue_len):
2722
2755
  """
@@ -3129,7 +3162,7 @@ def plotxy(
3129
3162
  kws_count = kwargs.pop("kws_count", kwargs)
3130
3163
  if not kws_count.get("hue",None):
3131
3164
  kws_count.pop("palette",None)
3132
- ax = sns.countplot(data=data, x=x, ax=ax, **kws_count)
3165
+ ax = sns.countplot(data=data, x=x,y=y, ax=ax, **kws_count)
3133
3166
  elif k == "regplot":
3134
3167
  kws_reg = kwargs.pop("kws_reg", kwargs)
3135
3168
  ax = sns.regplot(data=data, x=x, y=y, ax=ax, **kws_reg)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "py2ls"
3
- version = "0.2.4.4"
3
+ version = "0.2.4.5"
4
4
  description = "py(thon)2(too)ls"
5
5
  authors = ["Jianfeng <Jianfeng.Liu0413@gmail.com>"]
6
6
  readme = "README.md"
File without changes
File without changes
File without changes
File without changes
File without changes