Skip to content

Commit

Permalink
Merge pull request #63 from maxplanck-ie/develop
Browse files Browse the repository at this point in the history
fix: hardcode snakemake version to 3.12 in all wrappers to avoid missing
  • Loading branch information
vivekbhr committed Oct 25, 2017
2 parents b2f8e04 + 199e723 commit 409552c
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions shared/common_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def get_sample_names(infiles, ext, reads):
x = os.path.basename(x).replace(ext, "")
try:
x = x.replace(reads[0], "").replace(reads[1], "")
except:
except IndexError:
pass
s.append(x)
return sorted(list(set(s)))
Expand Down Expand Up @@ -145,7 +145,7 @@ def get_fragment_length(infile):
try:
median = next(f).split()[0]
return int(median)
except:
except TypeError:
print("ERROR: File", infile, "is NOT a proper Picard CollectInsertSizeMetrics metrics file.\n")
exit(1)
# no match in infile
Expand Down
10 changes: 5 additions & 5 deletions shared/tools/sample_qc_report_PE.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
try:
infile_MACS2_xls = sys.argv[4] # sample_name.filtered.BAM_peaks.xls (optional)
infile_MACS2_qc_txt = sys.argv[5] # ample_name.filtered.BAM_peaks.qc.txt (optional)
except:
except IndexError:
pass


Expand Down Expand Up @@ -49,7 +49,7 @@
fmapped_pairs = 1.0 * mapped_pairs / read_pairs
fmapped_singletons = 1.0 * (mapped_reads - mapped_reads_in_pairs) / total_reads

except:
except OSError:
exit("ERROR! Unable to read: {}".format(infile_AlignmentSummaryMetrics))


Expand All @@ -63,7 +63,7 @@
fdup_mapped_pairs = 1.0 * dup_mapped_pairs / mapped_pairs
dupfree_mapped_pairs = mapped_pairs - dup_mapped_pairs
fdupfree_mapped_pairs = 1.0 * dupfree_mapped_pairs / read_pairs
except:
except OSError:
exit("ERROR! Unable to read: {}".format(infile_MarkDuplicates))


Expand All @@ -83,7 +83,7 @@
fragment_size = int(columns.split(" = ")[1])
else:
fragment_size = "NA"
except:
except OSError:
fragment_size = "NA"


Expand All @@ -94,7 +94,7 @@
peak_count = int(columns[0])
frip = round(float(columns[1]), 3)
peak_genome_coverage = round(columns[2], 3)
except:
except OSError:
peak_count = "NA"
frip = "NA"
peak_genome_coverage = "NA"
Expand Down
10 changes: 5 additions & 5 deletions shared/tools/sample_qc_report_SE.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
try:
infile_MACS2_xls = sys.argv[3] # sample_name.filtered.BAM_peaks.xls (optional)
infile_MACS2_qc_txt = sys.argv[4] # ample_name.filtered.BAM_peaks.qc.txt (optional)
except:
except IndexError:
pass


Expand All @@ -37,7 +37,7 @@

# fraction of high-quality mapped reads (MAPQ >=20)
fhq_mapped_reads = 1.0 * int(columns[8]) / total_reads
except:
except OSError:
exit("ERROR! Unable to read: {}\n".format(infile_AlignmentSummaryMetrics))


Expand All @@ -58,7 +58,7 @@

# fraction of duplication free mapped reads
fdupfree_mapped_reads = 1.0 * dupfree_mapped_reads / total_reads
except:
except OSError:
exit("ERROR! Unable to read: {}".format(infile_MarkDuplicates))


Expand All @@ -68,7 +68,7 @@
lines = f.readlines()
columns = filter(lambda x: x.startswith("# d"), lines)[0].strip()
fragment_size = int(columns.split(" = ")[1])
except:
except OSError:
fragment_size = "NA"


Expand All @@ -79,7 +79,7 @@
peak_count = int(columns[0])
frip = round(float(columns[1]), 3)
peak_genome_coverage = round(columns[2], 3)
except:
except OSError:
peak_count = "NA"
frip = "NA"
peak_genome_coverage = "NA"
Expand Down
2 changes: 1 addition & 1 deletion workflows/ATAC-seq/ATAC-seq
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def main():
with open(os.path.join(args.outdir,'config.yaml'), 'w') as f:
yaml.dump(config, f, default_flow_style=True)

snakemake_module_load = "module load snakemake slurm &&".split()
snakemake_module_load = "module load snakemake/3.12.0 slurm &&".split()
snakemake_cmd = """
snakemake {snakemake_options} --latency-wait 300 --snakefile {snakefile} --jobs {max_jobs} --directory {outdir} --configfile {configfile}
""".format( snakefile = os.path.join(args.this_script_dir, "Snakefile"),
Expand Down
2 changes: 1 addition & 1 deletion workflows/ChIP-seq/ChIP-seq
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def main():
## save to configs.yaml in outdir
cf.write_configfile(os.path.join(args.outdir,'ChIP-seq.config.yaml'),config)

snakemake_module_load = "module load snakemake slurm &&".split()
snakemake_module_load = "module load snakemake/3.12.0 slurm &&".split()
snakemake_cmd = """
snakemake {snakemake_options} --latency-wait 300 --snakefile {snakefile} --jobs {max_jobs} --directory {workingdir} --configfile {configfile}
""".format( snakefile = os.path.join(this_script_dir, "Snakefile"),
Expand Down
2 changes: 1 addition & 1 deletion workflows/scRNAseq/scRNAseq-mapcount
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def main():
## save to configs.yaml in outdir
cf.write_configfile(os.path.join(args.outdir,'config.yaml'),config)

snakemake_module_load = "module load snakemake slurm &&".split()
snakemake_module_load = "module load snakemake/3.12.0 slurm &&".split()
snakemake_cmd = """
snakemake {snakemake_options} --latency-wait 300 --snakefile {snakefile} --jobs {max_jobs} --directory {outdir} --configfile {configfile}
""".format( snakefile = os.path.join(this_script_dir, "Snakefile"),
Expand Down

0 comments on commit 409552c

Please sign in to comment.