phbradley / conga

Clonotype Neighbor Graph Analysis
MIT License
80 stars 18 forks source link

TCR/BCR logos misaligned #35

Closed JingwenD closed 2 years ago

JingwenD commented 2 years ago

Hi Philip, I got the problem when I generated the graph_vs_graph_logos with function plotting.make_graph_vs_graph_logos. I have assigned the variable PATH_TO_INKSCAPEin convert_svg_to_png.py. And I switched the fonts in the MONOSPACE_FONT_FAMILY variable .But the TCR/BCR logos still look bad: tmp_hs_pbmc1_graph_vs_graph_logos

Is there solution for this issue? I noticed that the svg figures of TCR/BCR logos aligned perfectly. Maybe I can change the output format of function plotting.make_graph_vs_graph_logos?

And I have the second question about the batch comparison. As in the figure above, I have the bar for the ratio of different 'conditions'. And the green condition always got higher ratio compared to orange condition. I guess it is because I have more cells in green condition. So it is caused by the imbalance of number of cells in different conditions. Am I right? If I am right, can I change it to the relative value in order to avoid the effect of mismatch sample sizes between conditions?

Best,

Jingwen

phbradley commented 2 years ago

Hi Jingwen, Sorry for the delay replying due to holiday travel. Are you still having these issues? Take care, Phil


From: JingwenD @.> Sent: Monday, December 13, 2021 6:34 AM To: phbradley/conga @.> Cc: Subscribed @.***> Subject: [phbradley/conga] TCR/BCR logos misaligned (Issue #35)

Hi Philip, I got the problem when I generated the graph_vs_graph_logos with function plotting.make_graph_vs_graph_logos. I have assigned the variable PATH_TO_INKSCAPE in convert_svg_to_png.py. And I switched the fonts in the MONOSPACE_FONT_FAMILY variable .But the TCR/BCR logos still look bad: [tmp_hs_pbmc1_graph_vs_graph_logos]https://urldefense.proofpoint.com/v2/url?u=https-3A__user-2Dimages.githubusercontent.com_57101529_145829432-2D0e2bb80a-2D7657-2D439f-2Db983-2D736041901387.png&d=DwMCaQ&c=eRAMFD45gAfqt84VtBcfhfEazhEXT91ASHynm_9f1N0&r=OoOdU4GyDM4g0P0UJHufcJpPOVmpY9zfZYFqEZ7QEzw&m=-wYGDtxlbRuva_VMMaJKjnLEMl7AuxrU2PKVQyuWS-W47scZxagUrDgWONsbPZno&s=LjsUGZRUhJJKRjHJ5nmtryPXks1gbmO8b8IoRQBgqFY&e=

Is there solution for this issue? I noticed that the svg figures of TCR/BCR logos aligned perfectly. Maybe I can change the output format of function plotting.make_graph_vs_graph_logos?

And I have the second question about the batch comparison. As in the figure above, I have the bar for the ratio of different 'conditions'. And the green condition always got higher ratio compared to orange condition. I guess it is because I have more cells in green condition. So it is caused by the imbalance of number of cells in different conditions. Am I right? If I am right, can I change it to the relative value in order to avoid the effect of mismatch sample sizes between conditions?

Best,

Jingwen

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_phbradley_conga_issues_35&d=DwMCaQ&c=eRAMFD45gAfqt84VtBcfhfEazhEXT91ASHynm_9f1N0&r=OoOdU4GyDM4g0P0UJHufcJpPOVmpY9zfZYFqEZ7QEzw&m=-wYGDtxlbRuva_VMMaJKjnLEMl7AuxrU2PKVQyuWS-W47scZxagUrDgWONsbPZno&s=IwIk1eZtSbB4W2mgQro58iWr6EvVY5pC4qJUPmcWBBY&e=, or unsubscribehttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_ABBNCH7LG4FAA65HVNLJEYDUQX77JANCNFSM5J6JNNTQ&d=DwMCaQ&c=eRAMFD45gAfqt84VtBcfhfEazhEXT91ASHynm_9f1N0&r=OoOdU4GyDM4g0P0UJHufcJpPOVmpY9zfZYFqEZ7QEzw&m=-wYGDtxlbRuva_VMMaJKjnLEMl7AuxrU2PKVQyuWS-W47scZxagUrDgWONsbPZno&s=ehB-Ye6JdJlwwkbsw1h3oT1Vr_wJRluZnLVsyiqRQ6E&e=. Triage notifications on the go with GitHub Mobile for iOShttps://urldefense.proofpoint.com/v2/url?u=https-3A__apps.apple.com_app_apple-2Dstore_id1477376905-3Fct-3Dnotification-2Demail-26mt-3D8-26pt-3D524675&d=DwMCaQ&c=eRAMFD45gAfqt84VtBcfhfEazhEXT91ASHynm_9f1N0&r=OoOdU4GyDM4g0P0UJHufcJpPOVmpY9zfZYFqEZ7QEzw&m=-wYGDtxlbRuva_VMMaJKjnLEMl7AuxrU2PKVQyuWS-W47scZxagUrDgWONsbPZno&s=j31P1_DhvvAuZUH4UhgQHrYwydULxArWggAa_OZLy0g&e= or Androidhttps://urldefense.proofpoint.com/v2/url?u=https-3A__play.google.com_store_apps_details-3Fid-3Dcom.github.android-26referrer-3Dutm-5Fcampaign-253Dnotification-2Demail-2526utm-5Fmedium-253Demail-2526utm-5Fsource-253Dgithub&d=DwMCaQ&c=eRAMFD45gAfqt84VtBcfhfEazhEXT91ASHynm_9f1N0&r=OoOdU4GyDM4g0P0UJHufcJpPOVmpY9zfZYFqEZ7QEzw&m=-wYGDtxlbRuva_VMMaJKjnLEMl7AuxrU2PKVQyuWS-W47scZxagUrDgWONsbPZno&s=9Y6IA5eSdo_xIqiR2CXgq72oOvN-bI1zq08l92GA3nQ&e=.

JingwenD commented 2 years ago

Hi Philip,

Unfortunately, I failed to solve the above problem: misaligned plots and un-normalized cell counts between batches(conditions).

Do you have any ideal?

Best regards and happy new year!

Jingwen

phbradley commented 2 years ago

Hi Jingwen, Sorry the logos are not plotting correctly! Can you tell me a bit more about your system (mac, linux, etc) and the versions of packages (inkscape, scanpy, etc) you are using. It would be great if we could see which conversion command conga is using, so could you go to this line in the code

https://github.com/phbradley/conga/blob/master/conga/convert_svg_to_png.py#L32

and add a new line that changes the variable verbose to True:

verbose = True​

so it will print out the command it's using for the conversion. Then you could share the logfile and we could see if it is finding inkscape...

As to the cell counts, let me first explain what the bars represent. For each cluster, there are two bars right next to each other, a thicker one on the left and a thinner one on the right. The one on the right shows how the cells in the whole dataset are divided between the two conditions (so it should be the same for all clusters), whereas the bar on the left shows how the cells are distributed between the two conditions in that cluster. So, looking at your plot below, it looks like the orange condition (#1 I'm guessing) is over-represented in most of the clusters, since the left bar has more orange than the right one. The exceptions are (1,8) and (1,4) where the two bars look about the same. Let me know if that makes sense.

Take care, Phil


From: JingwenD @.> Sent: Monday, December 13, 2021 6:34 AM To: phbradley/conga @.> Cc: Subscribed @.***> Subject: [phbradley/conga] TCR/BCR logos misaligned (Issue #35)

Hi Philip, I got the problem when I generated the graph_vs_graph_logos with function plotting.make_graph_vs_graph_logos. I have assigned the variable PATH_TO_INKSCAPE in convert_svg_to_png.py. And I switched the fonts in the MONOSPACE_FONT_FAMILY variable .But the TCR/BCR logos still look bad: [tmp_hs_pbmc1_graph_vs_graph_logos]https://urldefense.proofpoint.com/v2/url?u=https-3A__user-2Dimages.githubusercontent.com_57101529_145829432-2D0e2bb80a-2D7657-2D439f-2Db983-2D736041901387.png&d=DwMCaQ&c=eRAMFD45gAfqt84VtBcfhfEazhEXT91ASHynm_9f1N0&r=OoOdU4GyDM4g0P0UJHufcJpPOVmpY9zfZYFqEZ7QEzw&m=-wYGDtxlbRuva_VMMaJKjnLEMl7AuxrU2PKVQyuWS-W47scZxagUrDgWONsbPZno&s=LjsUGZRUhJJKRjHJ5nmtryPXks1gbmO8b8IoRQBgqFY&e=

Is there solution for this issue? I noticed that the svg figures of TCR/BCR logos aligned perfectly. Maybe I can change the output format of function plotting.make_graph_vs_graph_logos?

And I have the second question about the batch comparison. As in the figure above, I have the bar for the ratio of different 'conditions'. And the green condition always got higher ratio compared to orange condition. I guess it is because I have more cells in green condition. So it is caused by the imbalance of number of cells in different conditions. Am I right? If I am right, can I change it to the relative value in order to avoid the effect of mismatch sample sizes between conditions?

Best,

Jingwen

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_phbradley_conga_issues_35&d=DwMCaQ&c=eRAMFD45gAfqt84VtBcfhfEazhEXT91ASHynm_9f1N0&r=OoOdU4GyDM4g0P0UJHufcJpPOVmpY9zfZYFqEZ7QEzw&m=-wYGDtxlbRuva_VMMaJKjnLEMl7AuxrU2PKVQyuWS-W47scZxagUrDgWONsbPZno&s=IwIk1eZtSbB4W2mgQro58iWr6EvVY5pC4qJUPmcWBBY&e=, or unsubscribehttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_ABBNCH7LG4FAA65HVNLJEYDUQX77JANCNFSM5J6JNNTQ&d=DwMCaQ&c=eRAMFD45gAfqt84VtBcfhfEazhEXT91ASHynm_9f1N0&r=OoOdU4GyDM4g0P0UJHufcJpPOVmpY9zfZYFqEZ7QEzw&m=-wYGDtxlbRuva_VMMaJKjnLEMl7AuxrU2PKVQyuWS-W47scZxagUrDgWONsbPZno&s=ehB-Ye6JdJlwwkbsw1h3oT1Vr_wJRluZnLVsyiqRQ6E&e=. Triage notifications on the go with GitHub Mobile for iOShttps://urldefense.proofpoint.com/v2/url?u=https-3A__apps.apple.com_app_apple-2Dstore_id1477376905-3Fct-3Dnotification-2Demail-26mt-3D8-26pt-3D524675&d=DwMCaQ&c=eRAMFD45gAfqt84VtBcfhfEazhEXT91ASHynm_9f1N0&r=OoOdU4GyDM4g0P0UJHufcJpPOVmpY9zfZYFqEZ7QEzw&m=-wYGDtxlbRuva_VMMaJKjnLEMl7AuxrU2PKVQyuWS-W47scZxagUrDgWONsbPZno&s=j31P1_DhvvAuZUH4UhgQHrYwydULxArWggAa_OZLy0g&e= or Androidhttps://urldefense.proofpoint.com/v2/url?u=https-3A__play.google.com_store_apps_details-3Fid-3Dcom.github.android-26referrer-3Dutm-5Fcampaign-253Dnotification-2Demail-2526utm-5Fmedium-253Demail-2526utm-5Fsource-253Dgithub&d=DwMCaQ&c=eRAMFD45gAfqt84VtBcfhfEazhEXT91ASHynm_9f1N0&r=OoOdU4GyDM4g0P0UJHufcJpPOVmpY9zfZYFqEZ7QEzw&m=-wYGDtxlbRuva_VMMaJKjnLEMl7AuxrU2PKVQyuWS-W47scZxagUrDgWONsbPZno&s=9Y6IA5eSdo_xIqiR2CXgq72oOvN-bI1zq08l92GA3nQ&e=.

JingwenD commented 2 years ago

Hi Philip,

Thanks a lot for the detailed explain for the bars of conditions, now I fully understand what they mean. Confusion solved!

I am trying to figure out the issue when plotting:

I link the inkscape inconvert_svg_to_png.py as this:

PATH_TO_INKSCAPE='/bin/inkscape'
ALT_PATH_TO_INKSCAPE='/Applications/Inkscape.app/Contents/Resources/bin/inkscape'

Here was my plot command:

conga.plotting.make_graph_vs_graph_logos(
    adata,
    outfile_prefix,
    min_cluster_size,
    nbrs_gex,
    nbrs_tcr)

And it was the output after adding the verbose = True​ in L32:

making tcr score table, #features= 35
storing 'test' as categorical
run rank_genes_groups [('none', 7480), ('clp_1_3', 109), ('clp_1_0', 107), ('clp_1_6', 103), ('clp_1_8', 75), ('clp_1_9', 58), ('clp_1_5', 54), ('clp_1_2', 22), ('clp_1_7', 20), ('clp_1_1', 16), ('clp_1_4', 13)]
making cluster logos: 0 10 tmp_hs_pbmc1_graph_vs_graph_logos.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_8_0.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_8_0.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_8_1.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_8_1.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_8_2.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_8_2.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_8_A.svg tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_8_A.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_8_B.svg tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_8_B.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmpsc_1_8.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmpsc_1_8.png
making cluster logos: 1 10 tmp_hs_pbmc1_graph_vs_graph_logos.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_6_0.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_6_0.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_6_1.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_6_1.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_6_2.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_6_2.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_6_A.svg tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_6_A.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_6_B.svg tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_6_B.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmpsc_1_6.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmpsc_1_6.png
making cluster logos: 2 10 tmp_hs_pbmc1_graph_vs_graph_logos.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_4_0.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_4_0.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_4_1.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_4_1.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_4_2.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_4_2.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_4_A.svg tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_4_A.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_4_B.svg tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_4_B.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmpsc_1_4.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmpsc_1_4.png
making cluster logos: 3 10 tmp_hs_pbmc1_graph_vs_graph_logos.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_0_0.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_0_0.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_0_1.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_0_1.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_0_2.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_0_2.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_0_A.svg tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_0_A.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_0_B.svg tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_0_B.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmpsc_1_0.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmpsc_1_0.png
making cluster logos: 4 10 tmp_hs_pbmc1_graph_vs_graph_logos.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_7_0.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_7_0.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_7_1.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_7_1.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_7_2.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_7_2.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_7_A.svg tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_7_A.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_7_B.svg tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_7_B.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmpsc_1_7.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmpsc_1_7.png
making cluster logos: 5 10 tmp_hs_pbmc1_graph_vs_graph_logos.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_5_0.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_5_0.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_5_1.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_5_1.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_5_2.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_5_2.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_5_A.svg tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_5_A.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_5_B.svg tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_5_B.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmpsc_1_5.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmpsc_1_5.png
making cluster logos: 6 10 tmp_hs_pbmc1_graph_vs_graph_logos.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_1_0.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_1_0.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_1_1.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_1_1.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_1_2.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_1_2.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_1_A.svg tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_1_A.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_1_B.svg tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_1_B.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmpsc_1_1.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmpsc_1_1.png
making cluster logos: 7 10 tmp_hs_pbmc1_graph_vs_graph_logos.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_3_0.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_3_0.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_3_1.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_3_1.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_3_2.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_3_2.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_3_A.svg tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_3_A.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_3_B.svg tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_3_B.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmpsc_1_3.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmpsc_1_3.png
making cluster logos: 8 10 tmp_hs_pbmc1_graph_vs_graph_logos.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_9_0.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_9_0.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_9_1.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_9_1.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_9_2.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_9_2.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_9_A.svg tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_9_A.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_9_B.svg tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_9_B.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmpsc_1_9.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmpsc_1_9.png
making cluster logos: 9 10 tmp_hs_pbmc1_graph_vs_graph_logos.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_2_0.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_2_0.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_2_1.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_2_1.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_2_2.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_2_2.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_2_A.svg tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_2_A.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_2_B.svg tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_2_B.png
convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmpsc_1_2.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmpsc_1_2.png
making: tmp_hs_pbmc1_graph_vs_graph_logos.png
writing help message to file: tmp_hs_pbmc1_graph_vs_graph_logos.png_README.txt

It seems no error was reported?

Best,

Jingwen

phbradley commented 2 years ago

Hi Jingwen,

Thanks for checking that! It looks like conga is finding the command line program "convert" and using that instead of inkscape. So it must be that "convert" is doing a bad job converting the svg images to png images for some reason.

If you don't mind changing the code around a little more, you could try forcing it to skip the "convert" program by doing the following:

At this line:

https://github.com/phbradley/conga/blob/master/conga/convert_svg_to_png.py#L42

replace

if which('convert') is not None:​

with

if False and which('convert') is not None:​

This will always be False so it will never try to use convert, and instead it will go on to the inkscape. Let me know if that works! If so, then I could try to figure out a way to make that configurable in conga without changing the code.

Take care, Phil


From: JingwenD @.> Sent: Wednesday, December 29, 2021 10:59 AM To: phbradley/conga @.> Cc: Bradley PhD, Phil @.>; Comment @.> Subject: Re: [phbradley/conga] TCR/BCR logos misaligned (Issue #35)

Hi Philip,

Thanks a lot for the detailed explain for the bars of conditions, now I fully understand what they mean. Confusion solved!

I am trying to figure out the issue when plotting:

I link the inkscape inconvert_svg_to_png.py as this:

PATH_TO_INKSCAPE='/bin/inkscape' ALT_PATH_TO_INKSCAPE='/Applications/Inkscape.app/Contents/Resources/bin/inkscape'

Here was my plot command:

conga.plotting.make_graph_vs_graph_logos( adata, outfile_prefix, min_cluster_size, nbrs_gex, nbrs_tcr)

And it was the output after adding the verbose = True​ in L32:

making tcr score table, #features= 35 storing 'test' as categorical run rank_genes_groups [('none', 7480), ('clp_1_3', 109), ('clp_1_0', 107), ('clp_1_6', 103), ('clp_1_8', 75), ('clp_1_9', 58), ('clp_1_5', 54), ('clp_1_2', 22), ('clp_1_7', 20), ('clp_1_1', 16), ('clp_1_4', 13)] making cluster logos: 0 10 tmp_hs_pbmc1_graph_vs_graph_logos.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_8_0.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_8_0.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_8_1.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_8_1.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_8_2.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_8_2.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_8_A.svg tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_8_A.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_8_B.svg tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_8_B.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmpsc_1_8.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmpsc_1_8.png making cluster logos: 1 10 tmp_hs_pbmc1_graph_vs_graph_logos.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_6_0.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_6_0.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_6_1.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_6_1.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_6_2.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_6_2.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_6_A.svg tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_6_A.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_6_B.svg tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_6_B.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmpsc_1_6.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmpsc_1_6.png making cluster logos: 2 10 tmp_hs_pbmc1_graph_vs_graph_logos.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_4_0.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_4_0.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_4_1.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_4_1.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_4_2.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_4_2.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_4_A.svg tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_4_A.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_4_B.svg tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_4_B.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmpsc_1_4.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmpsc_1_4.png making cluster logos: 3 10 tmp_hs_pbmc1_graph_vs_graph_logos.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_0_0.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_0_0.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_0_1.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_0_1.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_0_2.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_0_2.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_0_A.svg tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_0_A.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_0_B.svg tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_0_B.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmpsc_1_0.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmpsc_1_0.png making cluster logos: 4 10 tmp_hs_pbmc1_graph_vs_graph_logos.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_7_0.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_7_0.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_7_1.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_7_1.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_7_2.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_7_2.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_7_A.svg tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_7_A.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_7_B.svg tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_7_B.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmpsc_1_7.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmpsc_1_7.png making cluster logos: 5 10 tmp_hs_pbmc1_graph_vs_graph_logos.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_5_0.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_5_0.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_5_1.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_5_1.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_5_2.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_5_2.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_5_A.svg tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_5_A.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_5_B.svg tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_5_B.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmpsc_1_5.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmpsc_1_5.png making cluster logos: 6 10 tmp_hs_pbmc1_graph_vs_graph_logos.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_1_0.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_1_0.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_1_1.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_1_1.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_1_2.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_1_2.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_1_A.svg tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_1_A.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_1_B.svg tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_1_B.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmpsc_1_1.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmpsc_1_1.png making cluster logos: 7 10 tmp_hs_pbmc1_graph_vs_graph_logos.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_3_0.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_3_0.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_3_1.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_3_1.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_3_2.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_3_2.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_3_A.svg tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_3_A.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_3_B.svg tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_3_B.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmpsc_1_3.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmpsc_1_3.png making cluster logos: 8 10 tmp_hs_pbmc1_graph_vs_graph_logos.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_9_0.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_9_0.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_9_1.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_9_1.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_9_2.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_9_2.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_9_A.svg tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_9_A.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_9_B.svg tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_9_B.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmpsc_1_9.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmpsc_1_9.png making cluster logos: 9 10 tmp_hs_pbmc1_graph_vs_graph_logos.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_2_0.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_2_0.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_2_1.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_2_1.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_2_2.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmp_1_2_2.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_2_A.svg tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_2_A.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_2_B.svg tmp_hs_pbmc1_graph_vs_graph_logos.png_tmp_1_2_B.png convert tmp_hs_pbmc1_graph_vs_graph_logos.png.tmpsc_1_2.svg tmp_hs_pbmc1_graph_vs_graph_logos.png.tmpsc_1_2.png making: tmp_hs_pbmc1_graph_vs_graph_logos.png writing help message to file: tmp_hs_pbmc1_graph_vs_graph_logos.png_README.txt

It seems no error was reported?

Best,

Jingwen

— Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_phbradley_conga_issues_35-23issuecomment-2D1002735723&d=DwMFaQ&c=eRAMFD45gAfqt84VtBcfhfEazhEXT91ASHynm_9f1N0&r=OoOdU4GyDM4g0P0UJHufcJpPOVmpY9zfZYFqEZ7QEzw&m=DGt1opDmct9yFlvNcez3pdminlxpIZB__u5yGpNFoxYrBVP-pOM0mHsHYQ1dtRzD&s=MNRIPrq3ViDI77GAI-NlLVWV_YjKmbjQNpVayN7fPMM&e=, or unsubscribehttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_ABBNCH2PABRF5JNFWOYUADLUTNLCJANCNFSM5J6JNNTQ&d=DwMFaQ&c=eRAMFD45gAfqt84VtBcfhfEazhEXT91ASHynm_9f1N0&r=OoOdU4GyDM4g0P0UJHufcJpPOVmpY9zfZYFqEZ7QEzw&m=DGt1opDmct9yFlvNcez3pdminlxpIZB__u5yGpNFoxYrBVP-pOM0mHsHYQ1dtRzD&s=aqam6Z2Cx-AAPbUWT8iOWwfnr4rXcOykqSqmGauLxgQ&e=. Triage notifications on the go with GitHub Mobile for iOShttps://urldefense.proofpoint.com/v2/url?u=https-3A__apps.apple.com_app_apple-2Dstore_id1477376905-3Fct-3Dnotification-2Demail-26mt-3D8-26pt-3D524675&d=DwMFaQ&c=eRAMFD45gAfqt84VtBcfhfEazhEXT91ASHynm_9f1N0&r=OoOdU4GyDM4g0P0UJHufcJpPOVmpY9zfZYFqEZ7QEzw&m=DGt1opDmct9yFlvNcez3pdminlxpIZB__u5yGpNFoxYrBVP-pOM0mHsHYQ1dtRzD&s=RZoBX2SWv-ilW3y1tBFvcVtxyQHHkdMjd41TodVex3g&e= or Androidhttps://urldefense.proofpoint.com/v2/url?u=https-3A__play.google.com_store_apps_details-3Fid-3Dcom.github.android-26referrer-3Dutm-5Fcampaign-253Dnotification-2Demail-2526utm-5Fmedium-253Demail-2526utm-5Fsource-253Dgithub&d=DwMFaQ&c=eRAMFD45gAfqt84VtBcfhfEazhEXT91ASHynm_9f1N0&r=OoOdU4GyDM4g0P0UJHufcJpPOVmpY9zfZYFqEZ7QEzw&m=DGt1opDmct9yFlvNcez3pdminlxpIZB__u5yGpNFoxYrBVP-pOM0mHsHYQ1dtRzD&s=6fJ297v2bxeb9Xy1NyWDMu-cBP8t5tWIp4FDAPMsTe8&e=. You are receiving this because you commented.Message ID: @.***>

JingwenD commented 2 years ago

Hi, Philip,

I get a perfectly aligned png after replacing if which('convert') is not None:​ with if False and which('convert') is not None:​.

Thanks a lot!

Best regards and wish you a happy new year,

Jingwen