Answers.Body: <p>The answer for any testing purpose is generally to put together a small and minimal dataset so the test completes in seconds or minutes while still being representative. It makes (to me) limited sense to have a Actions/CI running using for example the entire human genome as input. The point of testing is to check that steps are executed properly, arguments are passed correctly, errors are detected. For this use either a small genome (such as from a bacterium or yeast), or make an artificial one consisting of very few basepairs.</p>
  <p>What I often do (for example for a peak calling workflow) is to take a full dataset, then subset to a region where I see a) many peaks and b) no peaks, then extract this genomic range (a few thousand bp) to build an artificial genome, plus extract from the bam/fastq the reads contributing to this region. That way I have basically a read-world dataset but very limited in size. For CI testing that does very well and CI finished in seconds, allowing to test even different configurations of this workflow on a standard / unpaid Actions runner.</p>
  <p>I personally prefer to not automate downloads but rather to have the user provide an actual file, or provide the file pre-downloaded in the workflow bundle. Connections might be bad or broken that day or the server/HPC is not connected to internet, and the entire workflows fails. Maybe write the relevant section in a way that it either accepts a URL for download OR a local file, and then write a testing profile that then reads the file to ensure it always is accessable to the Actions runner.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-08-30T07:29:21.697Z
Answers.LastActivityDate: 2023-08-31T01:22:46.500Z
Answers.LastEditDate: 2023-08-31T01:22:46.500Z
Answers.UserDisplayName: ATpoint
Body: <p>I am working on a snake-make workflow that follows the guidelines of formatting and linting so that it can be published on the official Snake-make repository.
  Whenever I push my code on GitHub, the GitHub actions are run and the pipeline is tested <a href="https://github.com/snakemake/snakemake-github-action" rel="nofollow noreferrer">as indicated here</a>.</p>
  <p>The problem is related to the execution of some time-consuming rules, such as the genome indexing generation for bowtie. These rules are run every time and take plenty of time.
  I was wondering whether there was a way to bypass the execution of these rules and test the pipeline anyway. Do you have any suggestions about this?</p>
  <p>A problem is that I have a rule in my snakemake workflow that downloads the human genome and that is needed to index and then for the alignment. I need a workaround to avoid this behaviour, since has you said it is not feasible to test on the whole genome.</p>
  <p>Thanks</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-08-31T01:21:34.723Z
Comments.Text: Please add more context to your question. An example snakemake workflow added into your question with code formatting would be helpful (i.e. not just linking to an external site).
Comments.UserDisplayName: gringer
Tags: <python><snakemake><github>
Title: Snakemake and github actions
ThreadText: # Snakemake and github actions
  
  (Asked by: username_0 on 2023-08-29)
  
  I am working on a snake-make workflow that follows the guidelines of formatting and linting so that it can be published on the official Snake-make repository.
  Whenever I push my code on GitHub, the GitHub actions are run and the pipeline is tested [as indicated here](https://github.com/snakemake/snakemake-github-action).
  
  The problem is related to the execution of some time-consuming rules, such as the genome indexing generation for bowtie. These rules are run every time and take plenty of time.
  I was wondering whether there was a way to bypass the execution of these rules and test the pipeline anyway. Do you have any suggestions about this?
  
  A problem is that I have a rule in my snakemake workflow that downloads the human genome and that is needed to index and then for the alignment. I need a workaround to avoid this behaviour, since has you said it is not feasible to test on the whole genome.
  
  Thanks
  
  **Tags:** python, snakemake, github
  
  > **Comments:**
  > **username_1**: Please add more context to your question. An example snakemake workflow added into your question with code formatting would be helpful (i.e. not just linking to an external site).  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2023-08-30. Score: 2 | Accepted answer
  
  The answer for any testing purpose is generally to put together a small and minimal dataset so the test completes in seconds or minutes while still being representative. It makes (to me) limited sense to have a Actions/CI running using for example the entire human genome as input. The point of testing is to check that steps are executed properly, arguments are passed correctly, errors are detected. For this use either a small genome (such as from a bacterium or yeast), or make an artificial one consisting of very few basepairs.
  
  What I often do (for example for a peak calling workflow) is to take a full dataset, then subset to a region where I see a) many peaks and b) no peaks, then extract this genomic range (a few thousand bp) to build an artificial genome, plus extract from the bam/fastq the reads contributing to this region. That way I have basically a read-world dataset but very limited in size. For CI testing that does very well and CI finished in seconds, allowing to test even different configurations of this workflow on a standard / unpaid Actions runner.
  
  I personally prefer to not automate downloads but rather to have the user provide an actual file, or provide the file pre-downloaded in the workflow bundle. Connections might be bad or broken that day or the server/HPC is not connected to internet, and the entire workflows fails. Maybe write the relevant section in a way that it either accepts a URL for download OR a local file, and then write a testing profile that then reads the file to ensure it always is accessable to the Actions runner.
  
  
  ---
  
  