Skip to content

Commit

Permalink
Merge pull request #927 from maxplanck-ie/dev_KS
Browse files Browse the repository at this point in the history
Further cleanup of mode Gruen and misc
  • Loading branch information
katsikora committed Aug 22, 2023
2 parents 0408e3b + 44ae47e commit 54d3b2e
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 70 deletions.
8 changes: 4 additions & 4 deletions .ci_stuff/test_dag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ if [ ${PIPESTATUS[0]} -ne 0 ] || [ $WC -ne 841 ]; then exit 1 ; fi
WC=`mRNA-seq -i PE_input -o output --sampleSheet .ci_stuff/test_sampleSheet.tsv --snakemakeOptions " --dryrun --conda-prefix /tmp" -m "alignment,deepTools_qc" --trim .ci_stuff/organism.yaml | tee >(cat 1>&2) | grep -v "conda installation\|Conda environment" | sed '/^\s*$/d' | wc -l`
if [ ${PIPESTATUS[0]} -ne 0 ] || [ $WC -ne 1261 ]; then exit 1 ; fi
WC=`mRNA-seq -i PE_input -o output --sampleSheet .ci_stuff/test_sampleSheet.tsv --snakemakeOptions " --dryrun --conda-prefix /tmp" -m "alignment-free,deepTools_qc" .ci_stuff/organism.yaml | tee >(cat 1>&2) | grep -v "conda installation\|Conda environment" | sed '/^\s*$/d' | wc -l`
if [ ${PIPESTATUS[0]} -ne 0 ] || [ $WC -ne 1309 ]; then exit 1 ; fi
if [ ${PIPESTATUS[0]} -ne 0 ] || [ $WC -ne 1330 ]; then exit 1 ; fi
WC=`mRNA-seq -i PE_input -o output --sampleSheet .ci_stuff/test_sampleSheet.tsv --snakemakeOptions " --dryrun --conda-prefix /tmp" -m "alignment,deepTools_qc" --bcExtract --trim .ci_stuff/organism.yaml | tee >(cat 1>&2) | grep -v "conda installation\|Conda environment" | sed '/^\s*$/d' | wc -l`
if [ ${PIPESTATUS[0]} -ne 0 ] || [ $WC -ne 1217 ]; then exit 1 ; fi
WC=`mRNA-seq -i PE_input -o output --sampleSheet .ci_stuff/test_sampleSheet.tsv --snakemakeOptions " --dryrun --conda-prefix /tmp" -m "alignment,deepTools_qc" --bcExtract --UMIDedup --trim .ci_stuff/organism.yaml | tee >(cat 1>&2) | grep -v "conda installation\|Conda environment" | sed '/^\s*$/d' | wc -l`
Expand All @@ -210,7 +210,7 @@ if [ ${PIPESTATUS[0]} -ne 0 ] || [ $WC -ne 741 ]; then exit 1 ; fi
WC=`mRNA-seq -i SE_input -o output --sampleSheet .ci_stuff/test_sampleSheet.tsv --snakemakeOptions " --dryrun --conda-prefix /tmp" -m "alignment,deepTools_qc" --trim .ci_stuff/organism.yaml | tee >(cat 1>&2) | grep -v "conda installation\|Conda environment" | sed '/^\s*$/d' | wc -l`
if [ ${PIPESTATUS[0]} -ne 0 ] || [ $WC -ne 1150 ]; then exit 1 ; fi
WC=`mRNA-seq -i SE_input -o output --sampleSheet .ci_stuff/test_sampleSheet.tsv --snakemakeOptions " --dryrun --conda-prefix /tmp" -m "alignment-free,deepTools_qc" .ci_stuff/organism.yaml | tee >(cat 1>&2) | grep -v "conda installation\|Conda environment" | sed '/^\s*$/d' | wc -l`
if [ ${PIPESTATUS[0]} -ne 0 ] || [ $WC -ne 1198 ]; then exit 1 ; fi
if [ ${PIPESTATUS[0]} -ne 0 ] || [ $WC -ne 1219 ]; then exit 1 ; fi
WC=`mRNA-seq -i SE_input -o output --sampleSheet .ci_stuff/test_sampleSheet.tsv --snakemakeOptions " --dryrun --conda-prefix /tmp" --trim --fastqc .ci_stuff/organism.yaml | tee >(cat 1>&2) | grep -v "conda installation\|Conda environment" | sed '/^\s*$/d' | wc -l`
if [ ${PIPESTATUS[0]} -ne 0 ] || [ $WC -ne 1286 ]; then exit 1 ; fi
WC=`mRNA-seq -i BAM_input/filtered_bam -o output --sampleSheet .ci_stuff/test_sampleSheet.tsv --snakemakeOptions " --dryrun --conda-prefix /tmp" --fromBAM .ci_stuff/organism.yaml | tee >(cat 1>&2) | grep -v "conda installation\|Conda environment" | sed '/^\s*$/d' | wc -l`
Expand All @@ -220,9 +220,9 @@ WC=`mRNA-seq --mode alignment,alignment-free -i PE_input -o output --rMats --sam
if [ ${PIPESTATUS[0]} -ne 0 ] || [ $WC -ne 1154 ]; then exit 1 ; fi
# three prime sequencing
WC=`mRNA-seq -i PE_input -o output --mode three-prime-seq --sampleSheet .ci_stuff/test_sampleSheet.tsv --snakemakeOptions " --dryrun --conda-prefix /tmp" .ci_stuff/organism.yaml | tee >(cat 1>&2) | grep -v "conda installation\|Conda environment" | sed '/^\s*$/d' | wc -l`
if [ ${PIPESTATUS[0]} -ne 0 ] || [ $WC -ne 866 ]; then exit 1 ; fi
if [ ${PIPESTATUS[0]} -ne 0 ] || [ $WC -ne 1085 ]; then exit 1 ; fi
WC=`mRNA-seq -i PE_input -o output --mode three-prime-seq,deepTools_qc --sampleSheet .ci_stuff/test_sampleSheet.tsv --snakemakeOptions " --dryrun --conda-prefix /tmp" .ci_stuff/organism.yaml | tee >(cat 1>&2) | grep -v "conda installation\|Conda environment" | sed '/^\s*$/d' | wc -l`
if [ ${PIPESTATUS[0]} -ne 0 ] || [ $WC -ne 1591 ]; then exit 1 ; fi
if [ ${PIPESTATUS[0]} -ne 0 ] || [ $WC -ne 1612 ]; then exit 1 ; fi
#allelic
WC=`mRNA-seq -m allelic-mapping,deepTools_qc -i PE_input -o output --snakemakeOptions " --dryrun --conda-prefix /tmp" --VCFfile allelic_input/file.vcf.gz --strains strain1,strain2 .ci_stuff/organism.yaml | tee >(cat 1>&2) | grep -v "conda installation\|Conda environment" | sed '/^\s*$/d' | wc -l`
if [ ${PIPESTATUS[0]} -ne 0 ] || [ $WC -ne 1771 ]; then exit 1 ; fi
Expand Down
4 changes: 4 additions & 0 deletions snakePipes/workflows/mRNA-seq/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,10 @@ def run_threePrimeSeq():
"three_prime_seq/combined_polyA.png",
"three_prime_seq/counts.tsv",
]
if sampleSheet:
sample_name = os.path.splitext(os.path.basename(sampleSheet))[0]
if not isMultipleComparison:
file_list.append( ["DESeq2_{}/DESeq2.session_info.txt".format(sample_name)] )
return file_list


Expand Down
63 changes: 2 additions & 61 deletions snakePipes/workflows/scRNAseq/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,7 @@ include: os.path.join(maindir, "shared", "rules", "FASTQ.snakefile")
#STARsolo uses filtered GTF for counting
include: os.path.join(maindir, "shared", "rules", "filterGTF.snakefile")
#umi_tools
if mode=="Gruen":
include: os.path.join(maindir, "shared", "rules", "umi_tools.snakefile")
include: os.path.join(maindir, "shared", "rules", "RNA_mapping.snakefile")
include: os.path.join(maindir, "shared", "rules", "scRNAseq_Gruen.snakefile")
# TrimGalore
if trim:
include: os.path.join(maindir, "shared", "rules", "trimming.snakefile")
elif mode=="STARsolo":
if mode=="STARsolo":
include: os.path.join(maindir, "shared", "rules", "scRNAseq_STARsolo.snakefile")
trim=False
skipRaceID=True
Expand All @@ -56,15 +49,6 @@ include: os.path.join(maindir, "shared", "rules", "multiQC.snakefile")
### conditional/optional rules #################################################
################################################################################

def run_Trimming(trim):
if trim:
file_list = [
expand(fastq_dir+"/{sample}"+reads[0]+".fastq.gz", sample = samples),
expand("FastQC_trimmed/{sample}"+reads[0]+"_fastqc.html", sample = samples)
]
return(file_list)
else:
return([])

def run_deeptools_qc():
file_list = [
Expand All @@ -78,16 +62,6 @@ def run_deeptools_qc():
"deepTools_qc/plotPCA/PCA.bed_coverage.tsv"] )
return(file_list)

def run_RaceID(skipRaceID):
if not skipRaceID:
file_list = [
"Filtered_cells_RaceID/metrics.tab.RData",
"Filtered_cells_RaceID/sessionInfo.txt",
'Filtered_cells_RaceID/Stats_report.html'
]
return(file_list)
else:
return([])

def run_velocyto(skipVelocyto):
if not skipVelocyto :
Expand Down Expand Up @@ -117,16 +91,8 @@ onstart:
print("Genome:", genome)
print("Downsample:", downsample)
print("Mode:", mode)
print("Trimming:", trim)
print("Input directory for mapping:", fastq_dir)
print("Input directory for trimming:", fastq_indir_trim)
print("BigWig bin size:", bwBinSize)
print("Barcode pattern:", cellBarcodePattern)
print("Barcode file:", cellBarcodeFile)
print("UMI_LEN:",UMI_length)
print("UMI_offset:",UMI_offset)
print("CELLI_LEN:",CELLI_length)
print("CELLI_offset:",CELLI_offset)

print("-" * 80, "\n")

Expand All @@ -141,32 +107,7 @@ onstart:

### main rule ##################################################################
################################################################################

if mode=="Gruen":
rule all:
input:
expand("FASTQ_barcoded/{sample}{read}.fastq.gz", sample = samples, read=reads[0]),
run_Trimming(trim),
expand("FastQC/{sample}{read}_fastqc.html", sample = samples, read=reads),
expand(aligner + "/{sample}.bam", sample = samples),
expand(aligner + "/{sample}.bam.bai", sample = samples),
"Sambamba/flagstat_report_all.tsv",
"Annotation/genes.filtered.bed",
"Annotation/genes.filtered.gtf",
expand("Counts/{sample}.raw_counts.txt",sample = samples),
expand("Counts/{sample}.featureCounts_summary.txt",sample = samples),
expand("Counts/{sample}.corrected.txt",sample = samples),
"Results/all_samples.gencode_genomic.corrected_merged.csv",
"QC_report/QC_report.all_samples.libstats_reads.tsv",
"Filtered_cells_monocle/metrics.tab.RData",
"Filtered_cells_monocle/sessionInfo.txt",
run_RaceID(skipRaceID),
run_deeptools_qc(),
"deepTools_qc/bamPEFragmentSize/fragmentSize.metric.tsv",
expand("deepTools_qc/estimateReadFiltering/{sample}_filtering_estimation.txt",sample = samples),
"multiQC/multiqc_report.html",
'Filtered_cells_monocle/Stats_report.html'
elif mode=="STARsolo":
if mode=="STARsolo":
localrules: gzip_STARsolo_for_seurat
rule all:
input:
Expand Down
2 changes: 1 addition & 1 deletion snakePipes/workflows/scRNAseq/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ velocyto:
STARsolo_raw_to_seurat:
memory: 10G
velo_to_sce:
memeory: 30G
memory: 30G
8 changes: 4 additions & 4 deletions tests/test_jobcounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ def test_alfreemode(self, ifs):
print(' '.join([str(i) for i in ci]))
_p = sp.run(ci, capture_output=True, text=True)
assert _p.returncode == 0
assert parseSpOut(_p) == 129
assert parseSpOut(_p) == 131
def test_bcExtract(self, ifs):
ci = [
"mRNA-seq",
Expand Down Expand Up @@ -865,7 +865,7 @@ def test_SEalfreemode(self, ifs):
print(' '.join([str(i) for i in ci]))
_p = sp.run(ci, capture_output=True, text=True)
assert _p.returncode == 0
assert parseSpOut(_p) == 116
assert parseSpOut(_p) == 118
def test_SEfastqc(self, ifs):
ci = [
"mRNA-seq",
Expand Down Expand Up @@ -921,7 +921,7 @@ def test_threeprime(self, ifs):
print(' '.join([str(i) for i in ci]))
_p = sp.run(ci, capture_output=True, text=True)
assert _p.returncode == 0
assert parseSpOut(_p) == 92
assert parseSpOut(_p) == 114
def test_threeprimeqc(self, ifs):
ci = [
"mRNA-seq",
Expand All @@ -940,7 +940,7 @@ def test_threeprimeqc(self, ifs):
print(' '.join([str(i) for i in ci]))
_p = sp.run(ci, capture_output=True, text=True)
assert _p.returncode == 0
assert parseSpOut(_p) == 161
assert parseSpOut(_p) == 163
def test_allelic(self, ifs):
ci = [
"mRNA-seq",
Expand Down

0 comments on commit 54d3b2e

Please sign in to comment.