Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a TrueType font for plotting sequence names with last/dotplot. #7404

Merged
merged 11 commits into from
Feb 3, 2025

Conversation

charles-plessy
Copy link
Contributor

@charles-plessy charles-plessy commented Jan 31, 2025

The last-dotplot command normally picks scalable fonts by default but did not manage to do so on the conda install in the images. Therefore I hardcode the path (which is likely to change when the images are updated).

Not using a scalable font prevents users from changing the font size using the command-line argument -s of last-dotplot.

In addition, I found that the CI tests did not check the outputted images, and corrected that too in this commit.

PR checklist

Closes #XXX

  • This comment contains a description of changes (with reason).
  • If you've fixed a bug or added code that should be tested, add tests!
  • If you've added a new tool - have you followed the module conventions in the contribution docs
  • If necessary, include test data in your PR.
  • Remove all TODO statements.
  • Emit the versions.yml file.
  • Follow the naming conventions.
  • Follow the parameters requirements.
  • Follow the input/output options guidelines.
  • Add a resource label
  • Use BioConda and BioContainers if possible to fulfil software requirements.
  • Ensure that the test works with either Docker / Singularity. Conda CI tests can be quite flaky:
    • For modules:
      • nf-core modules test <MODULE> --profile docker
      • nf-core modules test <MODULE> --profile singularity
      • nf-core modules test <MODULE> --profile conda
    • For subworkflows:
      • nf-core subworkflows test <SUBWORKFLOW> --profile docker
      • nf-core subworkflows test <SUBWORKFLOW> --profile singularity
      • nf-core subworkflows test <SUBWORKFLOW> --profile conda

The `last-dotplot` command normally picks scalable fonts by default but
did not manage to do so on the conda install in the images.  Therefore I
hardcode the path (which is likely to change when the images are
updated).

Not using a scalable font prevents users from changing the font size
using the command-line argument `-s` of `last-dotplot`.

In addition, I found that the CI tests did not check the outputted
images, and corrected that too in this commit.
@charles-plessy
Copy link
Contributor Author

Thanks @mashehu but the failing tests on conda revealed a real problem that I do not know how to solve now… I asked the following question on Slack:

I need to access a file that is in /opt/conda/pkgs/pillow-11.1.0-py313h8db990d_0/info/test/Tests/fonts/FreeMono.ttf in the Docker and Singularity images, but apparently it is elsewhere when using the conda runner. I have never used conda directly. How can I find the path to that file ?

@charles-plessy
Copy link
Contributor Author

Hi @mashehu I finally found the path of the file on conda installs. This leaves a messy commit history so I wanted to ask you if you would prefer me to open a new PR with squashed commits, and if you are fine with my final solution.

@mashehu
Copy link
Contributor

mashehu commented Feb 3, 2025

Good job!

The commits will be squashed anyway when the PR is merged, so no worries about the git history.

@charles-plessy charles-plessy added this pull request to the merge queue Feb 3, 2025
Merged via the queue into master with commit ea8c309 Feb 3, 2025
27 checks passed
@charles-plessy charles-plessy deleted the fix_last_dotplot_font branch February 3, 2025 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants