Skip to content
This repository has been archived by the owner on Sep 22, 2022. It is now read-only.

add: optional import of a vipr snakemake rule #3

Closed
wants to merge 1 commit into from

Conversation

j23414
Copy link
Contributor

@j23414 j23414 commented May 19, 2022

Description

This is mainly to start a discussion if we want to use importable snakemake rules to reduce code duplication? The vipr rule is simple enough that it doesn't need to use external python/bash scripts.

Perfectly fine if we want to stick with one Snakefile, just submitting this in case.

@victorlin
Copy link
Member

I like the idea. Previously tried doing the same for nextstrain/ncov#921: nextstrain/ncov-tutorial@6125006

But I haven't used Snakemake much to understand - are there any drawbacks to this approach?


module vipr_workflow:
snakefile:
github("j23414/test_snakemake_6", path="workflow/vipr.smk", branch="main")
Copy link
Member

Choose a reason for hiding this comment

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

Comment on lines +13 to +18
use rule vipr_fasta from vipr_workflow as pull_data with:
output:
output="vipr_download.fasta",
params:
family='pneumoviridae',
virus='Respiratory%20syncytial%20virus',
Copy link
Member

Choose a reason for hiding this comment

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

Based on ZIKA.md, these are the URL parameters used there:

  • datatype=genome
  • family=flavi
  • species=Zika virus
  • fromyear=2013
  • minlength=5000
  • metadata=genbank,strainname,segment,date,host,country,genotype,species
  • output=fasta

Can the rule be generalized to take arbitrary URL parameters, maybe as a single Snakemake param? I notice there's a slight difference between the above and vipr.smk.

@j23414
Copy link
Contributor Author

j23414 commented Sep 21, 2022

Thanks @victorlin for all the comments! Sorry I never got back to you, my fault. Closing this PR since it may be superseded by a different codebase.

@j23414 j23414 closed this Sep 21, 2022
@victorlin victorlin deleted the jen/optional_import_ingest branch September 21, 2022 17:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

2 participants