|
32 | 32 | "mpl.rcParams['figure.dpi'] = 80\n", |
33 | 33 | "mpl.rcParams['savefig.dpi']=300\n", |
34 | 34 | "import pickle\n", |
35 | | - "# sys.path.append(os.path.expanduser(\"~/Projects/Github/PyComplexHeatmap\"))\n", |
| 35 | + "sys.path.append(os.path.expanduser(\"~/Projects/Github/PyComplexHeatmap\"))\n", |
36 | 36 | "from PyComplexHeatmap import (\n", |
37 | 37 | " ClusterMapPlotter,DotClustermapPlotter,HeatmapAnnotation,anno_simple,anno_scatterplot,anno_lineplot,anno_barplot,\n", |
38 | 38 | " anno_label,anno_boxplot,anno_img,\n", |
|
701 | 701 | "execution_count": 6, |
702 | 702 | "id": "70924974-bcda-4a49-9552-01cf38312a52", |
703 | 703 | "metadata": {}, |
704 | | - "outputs": [], |
705 | | - "source": [ |
706 | | - "# # download image to local\n", |
707 | | - "# import requests\n", |
708 | | - "# img_dir='images'\n", |
709 | | - "# if not os.path.exists(img_dir):\n", |
710 | | - "# os.mkdir(img_dir)\n", |
711 | | - "# for url in df_row.Logo.tolist():\n", |
712 | | - "# img_data = requests.get(url).content\n", |
713 | | - "# file=os.path.basename(url)\n", |
714 | | - "# with open(os.path.join(img_dir,file), 'wb') as handler:\n", |
715 | | - "# handler.write(img_data)" |
716 | | - ] |
717 | | - }, |
718 | | - { |
719 | | - "cell_type": "code", |
720 | | - "execution_count": 7, |
721 | | - "id": "3ffb2fa2-b1b6-4211-999f-c6978bbdf15a", |
722 | | - "metadata": {}, |
723 | 704 | "outputs": [ |
724 | 705 | { |
725 | 706 | "data": { |
|
767 | 748 | " <td>0.767527</td>\n", |
768 | 749 | " <td>-0.149461</td>\n", |
769 | 750 | " <td>ASC|Nfia</td>\n", |
770 | | - " <td>images/jaspar__MA0670.1.png</td>\n", |
| 751 | + " <td>https://motifcollections.aertslab.org/v10nr_cl...</td>\n", |
771 | 752 | " </tr>\n", |
772 | 753 | " <tr>\n", |
773 | 754 | " <th>Tcf4</th>\n", |
|
776 | 757 | " <td>0.508175</td>\n", |
777 | 758 | " <td>-0.282496</td>\n", |
778 | 759 | " <td>CGE-Vip|Tcf4</td>\n", |
779 | | - " <td>images/tfdimers__MD00119.png</td>\n", |
| 760 | + " <td>https://motifcollections.aertslab.org/v10nr_cl...</td>\n", |
780 | 761 | " </tr>\n", |
781 | 762 | " <tr>\n", |
782 | 763 | " <th>Erg</th>\n", |
|
785 | 766 | " <td>0.857981</td>\n", |
786 | 767 | " <td>-0.114057</td>\n", |
787 | 768 | " <td>EC|Erg</td>\n", |
788 | | - " <td>images/metacluster_135.7.png</td>\n", |
| 769 | + " <td>https://motifcollections.aertslab.org/v10nr_cl...</td>\n", |
789 | 770 | " </tr>\n", |
790 | 771 | " <tr>\n", |
791 | 772 | " <th>Fli1</th>\n", |
|
794 | 775 | " <td>0.747177</td>\n", |
795 | 776 | " <td>-0.171242</td>\n", |
796 | 777 | " <td>EC|Fli1</td>\n", |
797 | | - " <td>images/metacluster_135.7.png</td>\n", |
| 778 | + " <td>https://motifcollections.aertslab.org/v10nr_cl...</td>\n", |
798 | 779 | " </tr>\n", |
799 | 780 | " <tr>\n", |
800 | 781 | " <th>Zbtb43</th>\n", |
|
803 | 784 | " <td>0.784200</td>\n", |
804 | 785 | " <td>-0.144034</td>\n", |
805 | 786 | " <td>Exc|Zbtb43</td>\n", |
806 | | - " <td>images/metacluster_131.8.png</td>\n", |
| 787 | + " <td>https://motifcollections.aertslab.org/v10nr_cl...</td>\n", |
807 | 788 | " </tr>\n", |
808 | 789 | " <tr>\n", |
809 | 790 | " <th>Mef2c</th>\n", |
|
812 | 793 | " <td>0.680693</td>\n", |
813 | 794 | " <td>-0.177612</td>\n", |
814 | 795 | " <td>IT-L6|Mef2c</td>\n", |
815 | | - " <td>images/transfac_pro__M04846.png</td>\n", |
| 796 | + " <td>https://motifcollections.aertslab.org/v10nr_cl...</td>\n", |
816 | 797 | " </tr>\n", |
817 | 798 | " <tr>\n", |
818 | 799 | " <th>Spi1</th>\n", |
|
821 | 802 | " <td>0.736412</td>\n", |
822 | 803 | " <td>-0.185941</td>\n", |
823 | 804 | " <td>MGC|Spi1</td>\n", |
824 | | - " <td>images/metacluster_167.5.png</td>\n", |
| 805 | + " <td>https://motifcollections.aertslab.org/v10nr_cl...</td>\n", |
825 | 806 | " </tr>\n", |
826 | 807 | " <tr>\n", |
827 | 808 | " <th>Hdx</th>\n", |
|
830 | 811 | " <td>0.852639</td>\n", |
831 | 812 | " <td>-0.120034</td>\n", |
832 | 813 | " <td>MGC|Hdx</td>\n", |
833 | | - " <td>images/tfdimers__MD00488.png</td>\n", |
| 814 | + " <td>https://motifcollections.aertslab.org/v10nr_cl...</td>\n", |
834 | 815 | " </tr>\n", |
835 | 816 | " <tr>\n", |
836 | 817 | " <th>Bach1</th>\n", |
|
839 | 820 | " <td>0.855795</td>\n", |
840 | 821 | " <td>-0.100834</td>\n", |
841 | 822 | " <td>MGE-Pvalb|Bach1</td>\n", |
842 | | - " <td>images/jaspar__MA1633.2.png</td>\n", |
| 823 | + " <td>https://motifcollections.aertslab.org/v10nr_cl...</td>\n", |
843 | 824 | " </tr>\n", |
844 | 825 | " <tr>\n", |
845 | 826 | " <th>Sox10</th>\n", |
|
848 | 829 | " <td>0.280051</td>\n", |
849 | 830 | " <td>-0.354296</td>\n", |
850 | 831 | " <td>ODC|Sox10</td>\n", |
851 | | - " <td>images/metacluster_4.1.png</td>\n", |
| 832 | + " <td>https://motifcollections.aertslab.org/v10nr_cl...</td>\n", |
852 | 833 | " </tr>\n", |
853 | 834 | " <tr>\n", |
854 | 835 | " <th>Sox8</th>\n", |
|
857 | 838 | " <td>0.361547</td>\n", |
858 | 839 | " <td>-0.215307</td>\n", |
859 | 840 | " <td>ODC|Sox8</td>\n", |
860 | | - " <td>images/metacluster_4.1.png</td>\n", |
| 841 | + " <td>https://motifcollections.aertslab.org/v10nr_cl...</td>\n", |
861 | 842 | " </tr>\n", |
862 | 843 | " <tr>\n", |
863 | 844 | " <th>Emx1</th>\n", |
|
866 | 847 | " <td>0.655946</td>\n", |
867 | 848 | " <td>-0.114102</td>\n", |
868 | 849 | " <td>P|Emx1</td>\n", |
869 | | - " <td>images/metacluster_164.1.png</td>\n", |
| 850 | + " <td>https://motifcollections.aertslab.org/v10nr_cl...</td>\n", |
870 | 851 | " </tr>\n", |
871 | 852 | " <tr>\n", |
872 | 853 | " <th>Lhx2</th>\n", |
|
875 | 856 | " <td>0.623909</td>\n", |
876 | 857 | " <td>-0.101292</td>\n", |
877 | 858 | " <td>P|Lhx2</td>\n", |
878 | | - " <td>images/metacluster_164.1.png</td>\n", |
| 859 | + " <td>https://motifcollections.aertslab.org/v10nr_cl...</td>\n", |
879 | 860 | " </tr>\n", |
880 | 861 | " <tr>\n", |
881 | 862 | " <th>Lhx3</th>\n", |
|
884 | 865 | " <td>0.550733</td>\n", |
885 | 866 | " <td>-0.109488</td>\n", |
886 | 867 | " <td>P|Lhx3</td>\n", |
887 | | - " <td>images/metacluster_9.26.png</td>\n", |
| 868 | + " <td>https://motifcollections.aertslab.org/v10nr_cl...</td>\n", |
888 | 869 | " </tr>\n", |
889 | 870 | " <tr>\n", |
890 | 871 | " <th>Pou5f1</th>\n", |
|
893 | 874 | " <td>0.800837</td>\n", |
894 | 875 | " <td>-0.124454</td>\n", |
895 | 876 | " <td>P|Pou5f1</td>\n", |
896 | | - " <td>images/taipale_cyt_meth__POU5F1_NYTAATTATGCGNR...</td>\n", |
| 877 | + " <td>https://motifcollections.aertslab.org/v10nr_cl...</td>\n", |
897 | 878 | " </tr>\n", |
898 | 879 | " <tr>\n", |
899 | 880 | " <th>Barhl1</th>\n", |
|
902 | 883 | " <td>0.469806</td>\n", |
903 | 884 | " <td>-0.116628</td>\n", |
904 | 885 | " <td>P|Barhl1</td>\n", |
905 | | - " <td>images/metacluster_124.2.png</td>\n", |
| 886 | + " <td>https://motifcollections.aertslab.org/v10nr_cl...</td>\n", |
906 | 887 | " </tr>\n", |
907 | 888 | " <tr>\n", |
908 | 889 | " <th>Emx2</th>\n", |
|
911 | 892 | " <td>0.522485</td>\n", |
912 | 893 | " <td>-0.105113</td>\n", |
913 | 894 | " <td>P|Emx2</td>\n", |
914 | | - " <td>images/metacluster_164.1.png</td>\n", |
| 895 | + " <td>https://motifcollections.aertslab.org/v10nr_cl...</td>\n", |
915 | 896 | " </tr>\n", |
916 | 897 | " <tr>\n", |
917 | 898 | " <th>Hnf1b</th>\n", |
|
920 | 901 | " <td>0.793915</td>\n", |
921 | 902 | " <td>-0.115062</td>\n", |
922 | 903 | " <td>PC|Hnf1b</td>\n", |
923 | | - " <td>images/tfdimers__MD00345.png</td>\n", |
| 904 | + " <td>https://motifcollections.aertslab.org/v10nr_cl...</td>\n", |
924 | 905 | " </tr>\n", |
925 | 906 | " <tr>\n", |
926 | 907 | " <th>Ebf4</th>\n", |
|
929 | 910 | " <td>0.797483</td>\n", |
930 | 911 | " <td>-0.125697</td>\n", |
931 | 912 | " <td>PC|Ebf4</td>\n", |
932 | | - " <td>images/metacluster_172.20.png</td>\n", |
| 913 | + " <td>https://motifcollections.aertslab.org/v10nr_cl...</td>\n", |
933 | 914 | " </tr>\n", |
934 | 915 | " <tr>\n", |
935 | 916 | " <th>Ebf1</th>\n", |
|
938 | 919 | " <td>0.821295</td>\n", |
939 | 920 | " <td>-0.125705</td>\n", |
940 | 921 | " <td>PC|Ebf1</td>\n", |
941 | | - " <td>images/metacluster_172.20.png</td>\n", |
| 922 | + " <td>https://motifcollections.aertslab.org/v10nr_cl...</td>\n", |
942 | 923 | " </tr>\n", |
943 | 924 | " <tr>\n", |
944 | 925 | " <th>Ovol2</th>\n", |
|
947 | 928 | " <td>0.775894</td>\n", |
948 | 929 | " <td>-0.119117</td>\n", |
949 | 930 | " <td>PC|Ovol2</td>\n", |
950 | | - " <td>images/tfdimers__MD00481.png</td>\n", |
| 931 | + " <td>https://motifcollections.aertslab.org/v10nr_cl...</td>\n", |
951 | 932 | " </tr>\n", |
952 | 933 | " <tr>\n", |
953 | 934 | " <th>Ikzf2</th>\n", |
|
956 | 937 | " <td>0.830263</td>\n", |
957 | 938 | " <td>-0.130275</td>\n", |
958 | 939 | " <td>PC|Ikzf2</td>\n", |
959 | | - " <td>images/tfdimers__MD00008.png</td>\n", |
| 940 | + " <td>https://motifcollections.aertslab.org/v10nr_cl...</td>\n", |
960 | 941 | " </tr>\n", |
961 | 942 | " </tbody>\n", |
962 | 943 | "</table>\n", |
|
990 | 971 | "\n", |
991 | 972 | " Logo \n", |
992 | 973 | "Gene \n", |
993 | | - "Nfia images/jaspar__MA0670.1.png \n", |
994 | | - "Tcf4 images/tfdimers__MD00119.png \n", |
995 | | - "Erg images/metacluster_135.7.png \n", |
996 | | - "Fli1 images/metacluster_135.7.png \n", |
997 | | - "Zbtb43 images/metacluster_131.8.png \n", |
998 | | - "Mef2c images/transfac_pro__M04846.png \n", |
999 | | - "Spi1 images/metacluster_167.5.png \n", |
1000 | | - "Hdx images/tfdimers__MD00488.png \n", |
1001 | | - "Bach1 images/jaspar__MA1633.2.png \n", |
1002 | | - "Sox10 images/metacluster_4.1.png \n", |
1003 | | - "Sox8 images/metacluster_4.1.png \n", |
1004 | | - "Emx1 images/metacluster_164.1.png \n", |
1005 | | - "Lhx2 images/metacluster_164.1.png \n", |
1006 | | - "Lhx3 images/metacluster_9.26.png \n", |
1007 | | - "Pou5f1 images/taipale_cyt_meth__POU5F1_NYTAATTATGCGNR... \n", |
1008 | | - "Barhl1 images/metacluster_124.2.png \n", |
1009 | | - "Emx2 images/metacluster_164.1.png \n", |
1010 | | - "Hnf1b images/tfdimers__MD00345.png \n", |
1011 | | - "Ebf4 images/metacluster_172.20.png \n", |
1012 | | - "Ebf1 images/metacluster_172.20.png \n", |
1013 | | - "Ovol2 images/tfdimers__MD00481.png \n", |
1014 | | - "Ikzf2 images/tfdimers__MD00008.png " |
| 974 | + "Nfia https://motifcollections.aertslab.org/v10nr_cl... \n", |
| 975 | + "Tcf4 https://motifcollections.aertslab.org/v10nr_cl... \n", |
| 976 | + "Erg https://motifcollections.aertslab.org/v10nr_cl... \n", |
| 977 | + "Fli1 https://motifcollections.aertslab.org/v10nr_cl... \n", |
| 978 | + "Zbtb43 https://motifcollections.aertslab.org/v10nr_cl... \n", |
| 979 | + "Mef2c https://motifcollections.aertslab.org/v10nr_cl... \n", |
| 980 | + "Spi1 https://motifcollections.aertslab.org/v10nr_cl... \n", |
| 981 | + "Hdx https://motifcollections.aertslab.org/v10nr_cl... \n", |
| 982 | + "Bach1 https://motifcollections.aertslab.org/v10nr_cl... \n", |
| 983 | + "Sox10 https://motifcollections.aertslab.org/v10nr_cl... \n", |
| 984 | + "Sox8 https://motifcollections.aertslab.org/v10nr_cl... \n", |
| 985 | + "Emx1 https://motifcollections.aertslab.org/v10nr_cl... \n", |
| 986 | + "Lhx2 https://motifcollections.aertslab.org/v10nr_cl... \n", |
| 987 | + "Lhx3 https://motifcollections.aertslab.org/v10nr_cl... \n", |
| 988 | + "Pou5f1 https://motifcollections.aertslab.org/v10nr_cl... \n", |
| 989 | + "Barhl1 https://motifcollections.aertslab.org/v10nr_cl... \n", |
| 990 | + "Emx2 https://motifcollections.aertslab.org/v10nr_cl... \n", |
| 991 | + "Hnf1b https://motifcollections.aertslab.org/v10nr_cl... \n", |
| 992 | + "Ebf4 https://motifcollections.aertslab.org/v10nr_cl... \n", |
| 993 | + "Ebf1 https://motifcollections.aertslab.org/v10nr_cl... \n", |
| 994 | + "Ovol2 https://motifcollections.aertslab.org/v10nr_cl... \n", |
| 995 | + "Ikzf2 https://motifcollections.aertslab.org/v10nr_cl... " |
1015 | 996 | ] |
1016 | 997 | }, |
1017 | | - "execution_count": 7, |
| 998 | + "execution_count": 6, |
1018 | 999 | "metadata": {}, |
1019 | 1000 | "output_type": "execute_result" |
1020 | 1001 | } |
1021 | 1002 | ], |
1022 | 1003 | "source": [ |
1023 | | - "img_dir='images'\n", |
1024 | | - "df_row.Logo=df_row.Logo.apply(lambda x:os.path.join(img_dir,os.path.basename(x)))\n", |
| 1004 | + "# # Images could be a url or file path, for example: download image to local\n", |
| 1005 | + "# import requests\n", |
| 1006 | + "# img_dir='images'\n", |
| 1007 | + "# if not os.path.exists(img_dir):\n", |
| 1008 | + "# os.mkdir(img_dir)\n", |
| 1009 | + "# for url in df_row.Logo.tolist():\n", |
| 1010 | + "# img_data = requests.get(url).content\n", |
| 1011 | + "# file=os.path.basename(url)\n", |
| 1012 | + "# with open(os.path.join(img_dir,file), 'wb') as handler:\n", |
| 1013 | + "# handler.write(img_data)\n", |
| 1014 | + "\n", |
| 1015 | + "# img_dir='images'\n", |
| 1016 | + "# df_row.Logo=df_row.Logo.apply(lambda x:os.path.join(img_dir,os.path.basename(x)))\n", |
1025 | 1017 | "df_row" |
1026 | 1018 | ] |
1027 | 1019 | }, |
1028 | 1020 | { |
1029 | 1021 | "cell_type": "code", |
1030 | | - "execution_count": 11, |
| 1022 | + "execution_count": 7, |
1031 | 1023 | "id": "8683f2d4-cea6-445f-ae32-cbfdb835b2ee", |
1032 | 1024 | "metadata": { |
1033 | 1025 | "tags": [] |
|
1110 | 1102 | }, |
1111 | 1103 | { |
1112 | 1104 | "cell_type": "code", |
1113 | | - "execution_count": 12, |
| 1105 | + "execution_count": 8, |
1114 | 1106 | "id": "17c5d0c9-c934-4fa5-ae24-1a5110e7f0a9", |
1115 | 1107 | "metadata": { |
1116 | 1108 | "tags": [] |
|
0 commit comments