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

feat: genefuse wrapper #493

Merged
merged 12 commits into from Aug 30, 2022
Merged

Conversation

Smeds
Copy link
Contributor

@Smeds Smeds commented Jun 2, 2022

Description

Wrapper used to run genefuse

QC

For all wrappers added by this PR, I made sure that

  • there is a test case which covers any introduced changes,
  • input: and output: file paths in the resulting rule can be changed arbitrarily,
  • either the wrapper can only use a single core, or the example rule contains a threads: x statement with x being a reasonable default,
  • rule names in the test case are in snake_case and somehow tell what the rule is about or match the tools purpose or name (e.g., map_reads for a step that maps reads),
  • all environment.yaml specifications follow the respective best practices,
  • wherever possible, command line arguments are inferred and set automatically (e.g. based on file extensions in input: or output:),
  • all fields of the example rules in the Snakefiles and their entries are explained via comments (input:/output:/params: etc.),
  • stderr and/or stdout are logged correctly (log:), depending on the wrapped tool,
  • temporary files are either written to a unique hidden folder in the working directory, or (better) stored where the Python function tempfile.gettempdir() points to (see here; this also means that using any Python tempfile default behavior works),
  • the meta.yaml contains a link to the documentation of the respective tool or command,
  • Snakefiles pass the linting (snakemake --lint),
  • Snakefiles are formatted with snakefmt,
  • Python wrapper scripts are formatted with black.

@Smeds Smeds force-pushed the genefuse-wrapper branch 5 times, most recently from 9dbe685 to b43bafb Compare June 2, 2022 11:11
@fgvieira
Copy link
Collaborator

Hi @Smeds,

thanks for your contribution! I was wondering, is the html output mandatory?
If not, would it make sense to also reflect that in the wrapper?

@johanneskoester johanneskoester added the stale: contribution welcome Please feel free to finalize this work. label Aug 16, 2022
@Smeds Smeds closed this Aug 22, 2022
@Smeds Smeds reopened this Aug 22, 2022
@Smeds
Copy link
Contributor Author

Smeds commented Aug 22, 2022

@fgvieira

neither json or html are required! But from my understanding both will always be generated, if you don't use flags -h and -j you will end up with default names. Since the files always will be generated I thought it would be good pratices to force the user to specify the names, or set them to temp if snakemake should remove them.

@fgvieira
Copy link
Collaborator

So the html and json files are generated even if options -h/-j are not specified?
What if the wrapper always sets -h and -j to some temporary files and, if the user specified them as outputs, copy them to their final destination?

@Smeds
Copy link
Contributor Author

Smeds commented Aug 23, 2022

I

So the html and json files are generated even if options -h/-j are not specified?
What if the wrapper always sets -h and -j to some temporary files and, if the user specified them as outputs, copy them to their final destination?

They will always be generated from what I can see. I can change to temporary files and then maybe add a check that at least one of html or json is specified?

@fgvieira
Copy link
Collaborator

...and then maybe add a check that at least one of html or json is specified?

But why would we need to enforce that, if all works fine if -h and -j are not specififed?
If the user specifies them as rule outputs, then the wrapper copies them to their final destination. If none of them are specified, then they are automatically deleted when the rule ends (since they are temp).

@Smeds
Copy link
Contributor Author

Smeds commented Aug 23, 2022

...and then maybe add a check that at least one of html or json is specified?

But why would we need to enforce that, if all works fine if -h and -j are not specififed? If the user specifies them as rule outputs, then the wrapper copies them to their final destination. If none of them are specified, then they are automatically deleted when the rule ends (since they are temp).

Couldn't that give rise to confusing errors? Let say someone use the wrapper and specify output without using a keyword, in that case the program will run properly and snakemake would generate a missing output file error.

@fgvieira
Copy link
Collaborator

I think that would be ok, since the user would have to figure out what is wrong.
But maybe we could also hear @johanneskoester... 😄

@Smeds
Copy link
Contributor Author

Smeds commented Aug 25, 2022

@fgvieira new pull-request where output is written to a temp folder and then copied to the specifed output path

bio/genefuse/meta.yaml Outdated Show resolved Hide resolved
bio/genefuse/wrapper.py Outdated Show resolved Hide resolved
bio/genefuse/wrapper.py Outdated Show resolved Hide resolved
bio/genefuse/wrapper.py Outdated Show resolved Hide resolved
bio/genefuse/wrapper.py Outdated Show resolved Hide resolved
bio/genefuse/wrapper.py Outdated Show resolved Hide resolved
Copy link
Contributor

@johanneskoester johanneskoester left a comment

Choose a reason for hiding this comment

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

Excellent work @Smeds and @fgvieira!

@johanneskoester johanneskoester merged commit 9bcf282 into snakemake:master Aug 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale: contribution welcome Please feel free to finalize this work.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants