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

chore: Replace mutect2_par wrapper with snakemake scattergather #538

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tedil
Copy link
Contributor

@tedil tedil commented Aug 2, 2024

No description provided.

Copy link

github-actions bot commented Aug 2, 2024

  • Please format your Python code with ruff: make fmt
  • Please check your Python code with ruff: make check
  • Please format your Snakemake code with snakefmt: make snakefmt

You can trigger all lints locally by running make lint

"""Splits a given collection of contigs based on their length into `n_chunks` equal sized chunks"""
contigs, lengths = zip(*contig_lengths.items())
cumulative_lengths = list(accumulate(lengths, initial=0))
chunk_size = cumulative_lengths[-1] // n_chunks
Copy link
Contributor

@ericblanc20 ericblanc20 Aug 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that correct? I have the feeling that the code above would return two chunks of size of 4 each if the cumulative length is 9.
I would suggest:

# assert cumulative_lengths[-1] > 0, "Total sequence length is 0"
chunk_size = 1 + ((cumulative_lengths[-1] - 1) // n_chunks)

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