<?xml version='1.0'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:atom="http://www.w3.org/2005/Atom" >
<channel>
	<title><![CDATA[BOL: Download with Snakemake !]]></title>
	<link>https://bioinformaticsonline.com/snippets/view/41412/download-with-snakemake?</link>
	<atom:link href="https://bioinformaticsonline.com/snippets/view/41412/download-with-snakemake?" rel="self" type="application/rss+xml" />
	<description><![CDATA[]]></description>
	
	<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/41412/download-with-snakemake</guid>
	<pubDate>Wed, 11 Mar 2020 07:16:44 -0500</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/41412/download-with-snakemake</link>
	<title><![CDATA[Download with Snakemake !]]></title>
	<description><![CDATA[<code># list sample names &amp; download URLs.
sample_links = {&quot;ERR458493&quot;: &quot;https://osf.io/5daup/download&quot;,
                &quot;ERR458494&quot;:&quot;https://osf.io/8rvh5/download&quot;,
                 &quot;ERR458495&quot;:&quot;https://osf.io/2wvn3/download&quot;,
                 &quot;ERR458500&quot;:&quot;https://osf.io/xju4a/download&quot;,
                 &quot;ERR458501&quot;: &quot;https://osf.io/nmqe6/download&quot;,
                 &quot;ERR458502&quot;: &quot;https://osf.io/qfsze/download&quot;}

# the sample names are dictionary keys in sample_links. extract them to a list we can use below
SAMPLES=sample_links.keys()

# download yeast rna-seq data from Schurch et al, 2016 study
rule download_all:
    input:
        expand(&quot;rnaseq/raw_data/{sample}.fq.gz&quot;, sample=SAMPLES)

# rule to download each individual file specified in sample_links
rule download_reads:
    output: &quot;rnaseq/raw_data/{sample}.fq.gz&quot; 
    params:
        # dynamically generate the download link directly from the dictionary
        download_link = lambda wildcards: sample_links[wildcards.sample]
    shell: &quot;&quot;&quot;
        curl -L {params.download_link} -o {output}
        &quot;&quot;&quot;</code>]]></description>
	<dc:creator>Surabhi Chaudhary</dc:creator>
</item>

</channel>
</rss>