Skip to content

Commit

Permalink
Merge pull request #1073 from maxplanck-ie/develop
Browse files Browse the repository at this point in the history
3.1.0
  • Loading branch information
WardDeb authored Oct 22, 2024
2 parents a36b999 + 19d195b commit 7df9bd3
Show file tree
Hide file tree
Showing 32 changed files with 514 additions and 288 deletions.
238 changes: 119 additions & 119 deletions .ci_stuff/test_dag.sh

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.11', '3.12']
python-version: ['3.11', '3.12' ,'3.13']
optdeps: [".", ".[actions]", ".[docs]"]
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -100,7 +100,8 @@ jobs:
'CONDA_PREPROCESSING_ENV',
'CONDA_NONCODING_RNASEQ_ENV',
'CONDA_SAMBAMBA_ENV',
'CONDA_pysam_ENV'
'CONDA_pysam_ENV',
'CONDA_FQLINT_ENV'
]
runs-on: ubuntu-latest
steps:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ jobs:
'CONDA_PREPROCESSING_ENV',
'CONDA_NONCODING_RNASEQ_ENV',
'CONDA_SAMBAMBA_ENV',
'CONDA_pysam_ENV'
'CONDA_pysam_ENV',
'CONDA_FQLINT_ENV'
]
runs-on: macos-latest
steps:
Expand All @@ -46,6 +47,6 @@ jobs:
pip install .
- name: createEnvsOSX
run: |
conda config --add subdirs osx-64
conda config --set subdir osx-64
snakePipes createEnvs --only ${{matrix.envs}}
5 changes: 3 additions & 2 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% set version = "3.0.0" %}
{% set version = "3.1.0" %}

package:
name: snakepipes
Expand All @@ -14,9 +14,10 @@ build:

requirements:
host:
- python >=3
- python >=3, < 3.13
- pip
- seaborn
- setuptools
run:
- python >=3.11
- snakemake >=8
Expand Down
3 changes: 1 addition & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import sys
import os
from importlib.metadata import version as importlibversion
import sphinx_rtd_theme

# to allow readthedocs to compile without installing some dependencies
import mock
Expand Down Expand Up @@ -150,7 +149,7 @@

# import them both locally and on rtd
html_theme = 'sphinx_rtd_theme' # 'alabaster' 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand Down
15 changes: 15 additions & 0 deletions docs/content/News.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
snakePipes News
===============

snakePipes 3.1.0
________________

* installation test for python 3.13
* bulk mode in makePairs wf
* Removal of --user flag in createIndices. Organism yamls are by default written to both installation folder and output folder.

snakePipes 3.0.0
________________

* clusteryaml omitted for profiles
* All workflows have '-' removed from their name
* toml file installation
* makePairs mode introduced

snakePipes 2.9.0
________________

Expand Down
4 changes: 2 additions & 2 deletions docs/content/setting_up.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ or for the pytests:
Configuring snakePipes
----------------------

Finally, at least one file (``defaults.yaml``) should be modified to match your compute infrastructure. The location of this file can be found out by executing:
Finally, config files ``defaults.yaml`` and snakemake profile should be modified to match your compute infrastructure. The location of this file can be found out by executing:

.. code:: bash
Expand All @@ -86,7 +86,7 @@ If you want to use the snakepipes_genericprofile, make sure to review the follow

* ``module load slurm &&`` - could be omitted
* ``resources.partition`` - set to your slurm partition
* ``conda-prefix`` - set to your preferred location where snakePipes environments should be stored
* ``conda-prefix`` - set to your preferred location where snakePipes environments should be stored. You can set this value by running `snakePipes config --condaEnvDir` and providing the respective path.
* ``resources`` - make sure default resources make sense for your infrastructure
* ``ccancel.sh`` - refers to the ccancel.sh file inside the profile directory and contains instructions on how to kill submitted jobs (on failure / interruption of snakemake). The module command could be omitted here as before

Expand Down
4 changes: 2 additions & 2 deletions docs/content/workflows/makePairs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ makePairs
What it does
------------

The snakePipes makePairs workflow allows users to process their HiC data from raw fastq files to HiC matrices in
an allele-specific manner. The workflow utilized mapping by bwa, followed by analysis
The snakePipes makePairs workflow allows users to process their HiC/uC data from raw fastq files to HiC matrices (in
an allele-specific manner). The workflow utilizes mapping by bwa, followed by analysis
using `pairtools <https://www.ncbi.nlm.nih.gov/pmc/articles/PMC9949071/>`__ . The workflow follows the `example workflow described in the documentation of pairtools <https://pairtools.readthedocs.io/en/latest/examples/pairtools_phase_walkthrough.html>`__ ,
which explains each step in detail and would be useful for new users to have a look at.
Currently the output matrices are produced in the `.pairs <https://pairtools.readthedocs.io/en/latest/formats.html>`__ format.
Expand Down
3 changes: 2 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ Quick start
* Download genome fasta and annotations for an your organism, and build indexes, Check in :ref:`createIndices`

* Configure snakePipes with paths to organism and cluster configs on your system using snakePipes config. For detailed information, run:
* Configure snakePipes with paths to organism and snakemake configs on your system using snakePipes config. Importantly, take care to set `--condaEnvDir` parameter, which defaults to `/tmp`.
For detailed information, run:

.. code:: bash
Expand Down
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
name = "snakePipes"
description = 'Snakemake workflows and wrappers for NGS data processing from the MPI-IE'
readme = "README.md"
version = "3.0.0"
version = "3.1.0"
keywords = [
"DNAmapping",
"ChIPSeq",
Expand All @@ -24,8 +24,7 @@ authors = [
]

classifiers = [
"Intended Audience :: Bioinformaticians",
"Intended Audience :: Biologists",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
]
Expand Down
4 changes: 3 additions & 1 deletion snakePipes/common_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ def set_env_yamls():
'CONDA_NONCODING_RNASEQ_ENV': 'envs/noncoding.yaml',
'CONDA_SAMBAMBA_ENV': 'envs/sambamba.yaml',
'CONDA_pysam_ENV': 'envs/pysam.yaml',
'CONDA_SEACR_ENV': 'envs/chip_seacr.yaml'}
'CONDA_SEACR_ENV': 'envs/chip_seacr.yaml',
'CONDA_FQLINT_ENV': 'envs/fqlint.yaml'
}


def merge_dicts(x, y):
Expand Down
2 changes: 1 addition & 1 deletion snakePipes/parserCommon.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def snpArguments(defaults):
snpargs = parser.add_argument_group('Allele-specific mapping arguments')
snpargs.add_argument("--VCFfile",
default='',
help="VCF file to create N-masked genomes (default: 'None')")
help="VCF file to create N-masked genomes (default: 'None'). Note that for the makePairs workflow this file is assumed to be gzipped and indexed (with tabix).")

snpargs.add_argument("--strains",
default='',
Expand Down
2 changes: 1 addition & 1 deletion snakePipes/shared/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ max_thread: 25
#print tools versions
toolsVersion: True
oldConfig:
configMode: manual
configMode: manual
2 changes: 1 addition & 1 deletion snakePipes/shared/rules/ChIP_peak_calling.snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ rule MACS2_peak_qc:
# compute peak genome coverage
peak_len=`awk '{{total+=$3-$2}}END{{print total}}' {params.peaks}`
genome_size=`awk '{{total+=$3-$2}}END{{print total}}' {params.genome_index}`
genome_size=`awk '{{total+=$3-$2}}END{{printf( "%14d",total) }}' {params.genome_index}`
genomecov=`bc -l <<< "$peak_len/$genome_size"`
# write peak-based QC metrics to output file
Expand Down
4 changes: 2 additions & 2 deletions snakePipes/shared/rules/FASTQ.snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if pairedEnd or pipeline=="scrnaseq":
r2 = indir+"/{sample}"+reads[1]+ext
output:
temp("originalFASTQ/{sample}.valid")
conda: CONDA_SHARED_ENV
conda: CONDA_FQLINT_ENV
shell:"""
fq lint {input.r1} {input.r2}
touch {output}
Expand All @@ -16,7 +16,7 @@ else:
r1 = indir+"/{sample}"+reads[0]+ext
output:
temp("originalFASTQ/{sample}.valid")
conda: CONDA_SHARED_ENV
conda: CONDA_FQLINT_ENV
shell:"""
fq lint {input.r1}
touch {output}
Expand Down
4 changes: 4 additions & 0 deletions snakePipes/shared/rules/envs/fqlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
channels:
- bioconda
dependencies:
- fq = 0.12.0
2 changes: 1 addition & 1 deletion snakePipes/shared/rules/envs/makePairs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: pairtools_phased
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- bwa
- cooler
- samtools
- tabix
- bcftools
Expand Down
3 changes: 1 addition & 2 deletions snakePipes/shared/rules/envs/shared.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ dependencies:
- fastqc = 0.12.1
- cutadapt = 4.6
- trim-galore = 0.6.10
- multiqc = 1.19
- multiqc = 1.23
- fastp = 0.23.4
- umi_tools = 1.1.4
- fq = 0.11.0
- pybigwig = 0.3.22

9 changes: 4 additions & 5 deletions snakePipes/shared/rules/masked_genomeIndex.snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ from os.path import join, dirname
import glob

GENOMEDIR = os.path.dirname(genome_fasta)
BASENAME = genome
genome_alias = os.path.splitext(os.path.basename(genome))[0]
BASENAME = genome_alias
# define snpgenome_dir
if allele_hybrid == 'dual':
SNPdir = "snp_genome/" + strains[0] + "_" + \
Expand Down Expand Up @@ -50,17 +51,15 @@ else:
params:
strain1 = strains[0],
SNPpath = os.path.abspath(VCFfile),

temp_out=temp("all_SNPs_" + strains[0] + "_GRCm38.txt.gz"),
temp_out=temp("all_SNPs_" + strains[0] + "_" + genome_alias + ".txt.gz"),
out_bname=os.path.basename(SNPFile)
conda: CONDA_SHARED_ENV
shell:
" ( [ -d snp_genome ] || mkdir -p snp_genome ) && cd snp_genome &&"
" SNPsplit_genome_preparation"
" --genome_build {BASENAME}"
" --reference_genome {input.genome} --vcf_file {params.SNPpath}"
" --strain {params.strain1} && cp "
"{params.temp_out} {params.out_bname}"
" --strain {params.strain1}"
"&& cd ../"

if aligner == "STAR":
Expand Down
Loading

0 comments on commit 7df9bd3

Please sign in to comment.