Skip to content

Commit

Permalink
Merge pull request #690 from maxplanck-ie/dev_ksikora2
Browse files Browse the repository at this point in the history
Dev ksikora2
  • Loading branch information
katsikora committed Sep 11, 2020
2 parents fe82f85 + 3844371 commit 4263be4
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 11 deletions.
10 changes: 10 additions & 0 deletions docs/content/News.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
snakePipes News
===============


snakePipes 2.x.y
----------------

* Genrich will now run if sampleSheet without replicates is provided.
* Updated zenodo link to mouse genome GRCm38/mm10 .


snakePipes 2.2.2
----------------

Expand All @@ -9,6 +17,7 @@ snakePipes 2.2.2
* Fixed labels in deepTools commands.
* Allele_info is now boolean.


snakePipes 2.2.1
----------------

Expand All @@ -17,6 +26,7 @@ snakePipes 2.2.1
* Added DAG test for allelic ChIPseq.
* Fixed a bug with deepTools QC for allelic mRNAseq.


snakePipes 2.2.0
----------------
* Added Alevin mode in scRNA workflow
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 @@ -34,7 +34,7 @@ The easiest way to install snakePipes is via our conda channel. The following co

.. code:: bash
conda create -n snakePipes -c mpi-ie -c conda-forge -c bioconda snakePipes==2.1.1
conda create -n snakePipes -c mpi-ie -c conda-forge -c bioconda snakePipes==2.2.2
This way, the software used within snakePipes do not conflict with the software pre-installed on your terminal or in your python environment.

Expand Down Expand Up @@ -193,7 +193,7 @@ Download premade indices
For the sake of convenience, we provide premade indices for the following organisms:

- `Human (GRCh38, Gencode release 29) <https://zenodo.org/record/2650763>`__
- `Mouse (GRCm38/mm10, Gencode release m19) <https://zenodo.org/record/3629114>`__
- `Mouse (GRCm38/mm10, Gencode release m19) <https://zenodo.org/record/4020455>`__
- `Mouse (GRCm37/mm9, Gencode release 1) <https://zenodo.org/record/2650849>`__
- `Fruit fly (dm6, Ensembl release 94) <https://zenodo.org/record/2650762>`__

Expand Down
2 changes: 1 addition & 1 deletion snakePipes/common_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def check_replicates(sample_info_file):

for k, v in d.items():
if v < 2:
sys.stderr.write("ERROR: The {} group has no replicates!\n".format(k))
sys.stderr.write("WARNING: The {} group has no replicates!\n".format(k))
return False

return True
Expand Down
4 changes: 2 additions & 2 deletions snakePipes/shared/rules/ChIP_peak_calling.snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ if pairedEnd:
rule Genrich_peaks:
input:
bams=lambda wildcards: expand(os.path.join("filtered_bam", "{sample}.namesorted.bam"), sample=genrichDict[wildcards.group]),
control = lambda wildcards: ["filtered_bam/"+get_control(x)+".namesorted.bam" for x in genrichDict[wildcards.group]]
control = lambda wildcards: ["filtered_bam/"+get_control(x)+".namesorted.bam" for x in genrichDict[wildcards.group]] if chip_samples_w_ctrl else []
output:
"Genrich/{group}.narrowPeak"
log: "Genrich/logs/{group}.log"
Expand All @@ -174,7 +174,7 @@ else:
rule Genrich_peaks:
input:
bams=lambda wildcards: expand(os.path.join("filtered_bam", "{sample}.namesorted.bam"), sample=genrichDict[wildcards.group]),
control = lambda wildcards: ["filtered_bam/"+get_control(x)+".namesorted.bam" for x in genrichDict[wildcards.group]]
control = lambda wildcards: ["filtered_bam/"+get_control(x)+".namesorted.bam" for x in genrichDict[wildcards.group] ] if chip_samples_w_ctrl else []
output:
"Genrich/{group}.narrowPeak"
log: "Genrich/logs/{group}.log"
Expand Down
4 changes: 2 additions & 2 deletions snakePipes/workflows/ChIP-seq/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ else:
include: os.path.join(maindir, "shared", "rules", "deepTools_ChIP_allelic.snakefile")

# CSAW for differential binding (if sampleinfo specified)
if sampleSheet:
if sampleSheet and cf.check_replicates(sampleSheet):
include: os.path.join(maindir, "shared", "rules", "CSAW.snakefile")
include: os.path.join(maindir, "shared", "rules", "nearestGene.snakefile")
include: os.path.join(maindir, "shared", "rules", "filterGTF.snakefile")
Expand Down Expand Up @@ -137,7 +137,7 @@ def run_deepTools_allelic():
return(file_list)

def run_CSAW():
if sampleSheet:
if sampleSheet and cf.check_replicates(sampleSheet):
file_list=["CSAW_{}_{}/CSAW.session_info.txt".format(peakCaller, sample_name)]
if not allele_info :
file_list.append(["Annotation/genes.filtered.symbol","Annotation/genes.filtered.t2g","CSAW_{}_{}/CSAW.Stats_report.html".format(peakCaller, sample_name)])
Expand Down
10 changes: 6 additions & 4 deletions snakePipes/workflows/ChIP-seq/internals.snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ if not os.path.isfile(samples_config):
if sampleSheet:
cf.check_sample_info_header(sampleSheet)
if not cf.check_replicates(sampleSheet):
print("\nWarning! CSAW cannot be invoked without replicates!\n")
sys.exit()
print("\nWarning! CSAW cannot be invoked without replicates and will not be run!\n")
if not peakCaller=="Genrich":
sys.exit()

chip_dict = {}
with open(samples_config, "r") as f:
Expand Down Expand Up @@ -181,9 +182,10 @@ def filter_dict(sampleSheet,input_dict):
return(output_dict)

if sampleSheet:
filtered_dict = filter_dict(sampleSheet,dict(zip(chip_samples_w_ctrl, [ get_control_name(x) for x in chip_samples_w_ctrl ])))
genrichDict = cf.sampleSheetGroups(sampleSheet)
reordered_dict = {k: filtered_dict[k] for k in [item for sublist in genrichDict.values() for item in sublist]}
if chip_samples_w_ctrl:
filtered_dict = filter_dict(sampleSheet,dict(zip(chip_samples_w_ctrl, [ get_control_name(x) for x in chip_samples_w_ctrl ])))
reordered_dict = {k: filtered_dict[k] for k in [item for sublist in genrichDict.values() for item in sublist]}
else:
genrichDict = {"all_samples": chip_samples}

Expand Down

0 comments on commit 4263be4

Please sign in to comment.