This vignette will show you a simple example PEP-formatted project, and how to read it into python using the
peppy package. This example comes from the example_peps repsitory in the example_basic folder.
Start by importing
peppy, and then let's take a look at the configuration file that defines our project:
project_config_file = "../examples/example_peps-master/example_basic/project_config.yaml" with open(project_config_file) as f: print(f.read())
metadata: sample_annotation: sample_annotation.csv output_dir: $HOME/hello_looper_results pipeline_dir: $HOME/pipeline_dir
It's a basic
yaml file with one section, metadata, with just two variables. This is about the simplest possible PEP project configuration file. The sample_annotation points at the annotation file, which is stored in the same folder as
project_config.yaml. Let's now glance at that annotation file:
project_config_file = "../examples/example_peps-master/example_basic/sample_annotation.csv" with open(project_config_file) as f: print(f.read())
sample_name,library,file frog_1,anySampleType,data/frog1_data.txt frog_2,anySampleType,data/frog2_data.txt
This sample_annotation file is a basic csv file, with rows corresponding to samples, and columns corresponding to sample attributes. Let's read this simple example project into python using
proj = peppy.Project("../examples/example_peps-master/example_basic/project_config.yaml")
No local config file was provided Found global config file in DIVCFG: /Users/mstolarczyk/Uczelnia/UVA/code/pepenv/uva_rivanna.yaml Loading divvy config file: /Users/mstolarczyk/Uczelnia/UVA/code/pepenv/uva_rivanna.yaml Use 'compute_packages' instead of 'compute' Available packages: set(['singularity_local', 'default', 'largemem', 'singularity_slurm', 'sigterm', 'local', 'parallel']) Activating compute package 'default'
Now, we have access to all the project metadata in easy-to-use form using python objects. We can browse the samples in the project like this: