Quick demo for Snakemake to present during the Hacky Hour at DPG spring meeting in Erlangen 2022.

public public 1yr ago Version: 2 0 bookmarks

Joint session AGI/AKjDPG
AGI 1.2: Talk
Wednesday, March 16, 2022, 14:45-15:15, AGI-H20
Link to proceedings: https://www.dpg-verhandlungen.de/year/2022/conference/erlangen/part/agi/session/1/contribution/2

Installation

Code Snippets

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
import pandas as pd

locations = list()

for city_file in snakemake.input["tickets"]:
    with open (city_file, "r") as f:
        city_name = f.readline().strip()

        locations.append(city_name)

df = pd.DataFrame(locations, columns=["city"])
df.to_csv(snakemake.output["tickets"])
1
2
3
4
5
with open(snakemake.input["city"], "r") as f:
    city_name = f.readline().strip()

with open(snakemake.output["city"], "w") as f:
    print(f"Hello {city_name}!", file=f)
1
2
3
4
5
6
7
8
import pandas as pd

tickets = pd.read_csv(snakemake.input["tickets"])
conferences = pd.read_csv(snakemake.input["conferences"])

schedule = conferences[conferences["City"].isin(tickets["city"])]

schedule.to_csv(snakemake.output["schedule"])
1
print("Hello World")
2
3
script:
    "scripts/say_hello.py"
13
14
script:
    "scripts/greet_city.py"
21
22
script:
    "scripts/greet_city.py"
33
34
script:
    "scripts/greet_city.py"
46
47
script:
    "scripts/combine_tickets.py"
56
57
script:
    "scripts/make_conference_schedule.py"
ShowHide 9 more snippets with no or duplicated tags.

Login to post a comment if you would like to share your experience with this workflow.

Do you know this workflow well? If so, you can request seller status , and start supporting this workflow.

Free

Created: 1yr ago
Updated: 1yr ago
Maitainers: public
URL: https://github.com/euronion/snakemake-demo
Name: snakemake-demo
Version: 2
Badge:
workflow icon

Insert copied code into your website to add a link to this workflow.

Other Versions:
Downloaded: 0
Copyright: Public Domain
License: MIT License
  • Future updates

Related Workflows

cellranger-snakemake-gke
snakemake workflow to run cellranger on a given bucket using gke.
A Snakemake workflow for running cellranger on a given bucket using Google Kubernetes Engine. The usage of this workflow ...