Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 6176

How to enable "output" to detect variables in "run" in snakemake

$
0
0

I am trying to make directories for the different "IDs" I have stored in the .csv file (they are stored under column "ID"). However, snakemake doesn't seem to be able to detect "IDs" in output from run.

rule make_directories:    input:"exptXXXXX_metadata.csv"    output:        directory(expand("tissues/{id}", id = IDs))    run:        import pandas as pd        df =  pd.read_csv('exptXXXXX_metadata.csv')        ##unique IDs which I want to make different directories of under the parent_dir "tissues"        IDs =  set(df['ID'])        for i in IDs:            f = output[id]            shell("mkdir {f}")

I have tried different suggestions from the snakemake documentation: https://snakemake.readthedocs.io/en/stable/project_info/faq.html#how-do-i-access-elements-of-input-or-output-by-a-variable-index


Viewing all articles
Browse latest Browse all 6176

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>