Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add script to export environments #674

Merged
merged 3 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/export_envs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import os
import re
from pathlib import Path
from functools import reduce
from operator import concat
import yaml
import pandas as pd
import numpy as np

class IndentDumper(yaml.Dumper):
def increase_indent(self, flow=False, indentless=False):
return super(IndentDumper, self).increase_indent(flow, False)

container_table = pd.read_csv("../../container/containers.csv")
container_table_universal = container_table[(container_table.Environment == "universal")]
container_table_envs = container_table[(container_table.Environment != "universal")]

# Hard code channels in the correct order
channels = ["dnachun", "conda-forge", "bioconda", "nodefaults"]

environment_list = [re.sub(r'\s+', "", env).split(",") for env in container_table_envs.Environment]
environments = list(np.unique(reduce(concat, environment_list, [])))

package_dict = {package: version for package, version in zip(container_table_envs.Package, container_table_envs.Version)}
environment_dict = {package: environment for package, environment in zip(container_table_envs.Package, container_table_envs.Environment)}
environment_package_dict = {environment: {} for environment in environments}
for environment in environments:
for package in sorted(environment_dict.keys()):
if environment in environment_dict[package]:
environment_package_dict[environment][package] = package_dict[package]
for environment in environment_package_dict.keys():
if environment != "dapars2":
universal_packages = sorted(set(container_table_universal.Package) - set(environment_package_dict[environment].keys()))
for package in universal_packages:
environment_package_dict[environment][package] = np.nan

yaml_dict = {environment: {"name": str(environment), "channels": channels, "dependencies": []} for environment in environment_package_dict.keys()}
for environment in yaml_dict.keys():
for package in environment_package_dict[environment].keys():
version = environment_package_dict[environment][package]
if pd.notna(version):
yaml_dict[environment]["dependencies"].append(f"{package}={version}")
else:
yaml_dict[environment]["dependencies"].append(package)

for environment in yaml_dict.keys():
yml_file = f"../../container/{environment}/{environment}.yml"
yml_path = Path(yml_file)
yml_path.parent.mkdir(parents=True, exist_ok=True)
with open(yml_file, 'w') as file_handle:
yaml.dump(yaml_dict[environment], file_handle, sort_keys = False, Dumper=IndentDumper)
28 changes: 14 additions & 14 deletions container/apex/apex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@ channels:
- nodefaults
dependencies:
- apex=0.2-alpha
- htslib
- bcftools=1.17
- seaborn
- bash_kernel
- r-tidyverse
- ptpython
- htslib
- altair
- matplotlib
- rpy2
- bash_kernel
- formulaic
- scipy
- ipykernel
- jupyterlab
- matplotlib
- numpy
- openpyxl
- pandas
- plotnine
- ptpython
- pytables
- r-irkernel
- statsmodels
- plotnine
- jupyterlab
- ipykernel
- r-tidyverse
- rpy2
- scikit-learn
- openpyxl
- pandas
- scipy
- seaborn
- statsmodels
34 changes: 17 additions & 17 deletions container/bioinfo/bioinfo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,31 @@ channels:
- bioconda
- nodefaults
dependencies:
- htslib
- bcftools=1.17
- gcta=1.94.1
- htslib
- plink=1.90b6.21
- plink2=2.00a3.7
- qtl=0.1.8
- r-igraph=1.5.1
- snpeff=5.1
- snpsift=5.1
- bcftools=1.17
- r-igraph=1.5.1
- plink=1.90b6.21
- seaborn
- bash_kernel
- r-tidyverse
- ptpython
- altair
- matplotlib
- rpy2
- bash_kernel
- formulaic
- scipy
- ipykernel
- jupyterlab
- matplotlib
- numpy
- openpyxl
- pandas
- plotnine
- ptpython
- pytables
- r-irkernel
- statsmodels
- plotnine
- jupyterlab
- ipykernel
- r-tidyverse
- rpy2
- scikit-learn
- openpyxl
- pandas
- scipy
- seaborn
- statsmodels
101 changes: 101 additions & 0 deletions container/containers.csv

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions container/fastenloc/fastenloc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@ dependencies:
- bcftools=1.17
- dap-g=1.0.0
- fastenloc=2
- torus=1
- r-susier=0.12.35
- seaborn
- bash_kernel
- r-tidyverse
- ptpython
- torus=1
- altair
- matplotlib
- rpy2
- bash_kernel
- formulaic
- scipy
- ipykernel
- jupyterlab
- matplotlib
- numpy
- openpyxl
- pandas
- plotnine
- ptpython
- pytables
- r-irkernel
- statsmodels
- plotnine
- jupyterlab
- ipykernel
- r-tidyverse
- rpy2
- scikit-learn
- openpyxl
- pandas
- scipy
- seaborn
- statsmodels
28 changes: 14 additions & 14 deletions container/flashpcar/flashpcar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@ channels:
- bioconda
- nodefaults
dependencies:
- r-flashpcar=2.1
- r-gridextra=2.3
- r-matrixstats=1.0.0
- r-flashpcar=2.1
- r-rlang=1.1.1
- seaborn
- bash_kernel
- r-tidyverse
- ptpython
- altair
- matplotlib
- rpy2
- bash_kernel
- formulaic
- scipy
- ipykernel
- jupyterlab
- matplotlib
- numpy
- openpyxl
- pandas
- plotnine
- ptpython
- pytables
- r-irkernel
- statsmodels
- plotnine
- jupyterlab
- ipykernel
- r-tidyverse
- rpy2
- scikit-learn
- openpyxl
- pandas
- scipy
- seaborn
- statsmodels
28 changes: 14 additions & 14 deletions container/leafcutter/leafcutter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@ channels:
- bioconda
- nodefaults
dependencies:
- samtools=1.17
- r-leafcutter=0.2.9
- regtools=1.0.0
- seaborn
- bash_kernel
- r-tidyverse
- ptpython
- samtools=1.17
- altair
- matplotlib
- rpy2
- bash_kernel
- formulaic
- scipy
- ipykernel
- jupyterlab
- matplotlib
- numpy
- openpyxl
- pandas
- plotnine
- ptpython
- pytables
- r-irkernel
- statsmodels
- plotnine
- jupyterlab
- ipykernel
- r-tidyverse
- rpy2
- scikit-learn
- openpyxl
- pandas
- scipy
- seaborn
- statsmodels
26 changes: 13 additions & 13 deletions container/metal/metal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ channels:
- nodefaults
dependencies:
- metal=2020_05_05
- seaborn
- bash_kernel
- r-tidyverse
- ptpython
- altair
- matplotlib
- rpy2
- bash_kernel
- formulaic
- scipy
- ipykernel
- jupyterlab
- matplotlib
- numpy
- openpyxl
- pandas
- plotnine
- ptpython
- pytables
- r-irkernel
- statsmodels
- plotnine
- jupyterlab
- ipykernel
- r-tidyverse
- rpy2
- scikit-learn
- openpyxl
- pandas
- scipy
- seaborn
- statsmodels
32 changes: 16 additions & 16 deletions container/methylation/methylation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,32 @@ channels:
- bioconda
- nodefaults
dependencies:
- htslib
- r-data.table=1.14.8
- r-glmnet=4.1
- bioconductor-illuminahumanmethylation450kmanifest=0.4.0
- bioconductor-illuminahumanmethylationepicmanifest=0.3.0
- bioconductor-limma=3.56.2
- bioconductor-minfi=1.46.0
- bioconductor-preprocesscore=1.62.1
- bioconductor-sesame=1.18.4
- bioconductor-sesamedata=1.18.0
- seaborn
- bash_kernel
- r-tidyverse
- ptpython
- htslib
- r-data.table=1.14.8
- r-glmnet=4.1
- altair
- matplotlib
- rpy2
- bash_kernel
- formulaic
- scipy
- ipykernel
- jupyterlab
- matplotlib
- numpy
- openpyxl
- pandas
- plotnine
- ptpython
- pytables
- r-irkernel
- statsmodels
- plotnine
- jupyterlab
- ipykernel
- r-tidyverse
- rpy2
- scikit-learn
- openpyxl
- pandas
- scipy
- seaborn
- statsmodels
28 changes: 14 additions & 14 deletions container/pcatools/pcatools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@ channels:
- bioconda
- nodefaults
dependencies:
- htslib
- bcftools=1.17
- bioconductor-biocsingular=1.16.0
- bioconductor-pcatools=2.12.0
- htslib
- r-rmtstat=0.3.1
- seaborn
- bash_kernel
- r-tidyverse
- ptpython
- altair
- matplotlib
- rpy2
- bash_kernel
- formulaic
- scipy
- ipykernel
- jupyterlab
- matplotlib
- numpy
- openpyxl
- pandas
- plotnine
- ptpython
- pytables
- r-irkernel
- statsmodels
- plotnine
- jupyterlab
- ipykernel
- r-tidyverse
- rpy2
- scikit-learn
- openpyxl
- pandas
- scipy
- seaborn
- statsmodels
Loading