Skip to content

Conversation

@LudvigOlsen
Copy link

Hi guys,

I thought it a little suboptimal to have to copy all the bam files into the same directory to run Fragle. So I added the option of specifying the bam file paths directly.

I wanted to change as little as possible, but to ensure it worked with all the "--mode"s, I did end up making significant changes to the code base.

Here are my changes:

  • Allows specifying multiple --input paths. Then parses them for whether it's a single directory, a list of bam files, or the data.pkl file. NOTE: This actually breaks specifying the previous output directory as input directory for --mode 'F' (now you need to add data.pkl to the path. If you think this needs to be possible, I can quickly add it. I just think it's cleaner this way.
  • Refactors the command running part in main.py to reduce repeated code.
  • Uses argparse in feature_generation.py and predict.py (easier to pass multiple bam file paths this way and reduces bug risks).
  • Adds a check in predict.py for whether the output directory exists (when --mode 'F' and --output != --input).
  • Specifies argparse choices for --mode to have it check the value automatically.
  • Removes unused imports.
  • I accidentally used my autoformatter (check out the amazing ruff) to have consistent styling. I actually didn't want to do this but it's the reason for some of the changes. If you want me to revert the conversion of quotes (' -> "), let me know.

I have tested all but the targeted version (--mode 'T').

I would totally understand if there are too many changes in this PR. I do think there are some good improvements here even if you don't want to support specifying bam files directly though.

Best,
Ludvig

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.

3 participants