diff --git a/chipathlon/conf.py b/chipathlon/conf.py index f41bd1b02f8ae6832f155db0704c23a25c6dca34..4e1f30fc08766cc7f07956ce3da15b3acd0c8696 100644 --- a/chipathlon/conf.py +++ b/chipathlon/conf.py @@ -39,6 +39,15 @@ peak_tools = [ "ccat" ] +# Peak_type validation +peak_types = { + "spp": ["narrow", "broad"], + "macs2": ["narrow", "broad"], + "gem": ["narrow"], + "peakranger": ["narrow"], + "ccat": ["broad"] +} + # File extensions file_extensions = { "genome_index": ["fa", "fna"], @@ -46,7 +55,7 @@ file_extensions = { "sai": ["sai"], "sam": ["sam"], "bam": ["bam"], - "bed": ["bed", "peak", "region", "narrowPeak", "broadPeak", "tagAlign", "narrowPeak.gz"], + "bed": ["bed", "peak", "region", "narrowPeak", "broadPeak", "tagAlign", "narrowPeak.gz", "broadPeak.gz"], "bwa_genome": ["amb", "ann", "bwt", "pac", "sa"], "bowtie2_genome": ["1.bt2", "2.bt2", "3.bt2", "4.bt2", "rev.1.bt2", "rev.2.bt2"], "quality": ["quality"], @@ -139,7 +148,3 @@ genomes = { "additional_files": file_extensions["bowtie2_genome"] } } - -# number of lines from BED and peak result files to -# include per-document for bed and peak collections -result_lines_per_document = 75000 diff --git a/chipathlon/run.py b/chipathlon/run.py index 3081e57cac71f7e86ac063c1f4ecb07279c70130..550d0ddbdb369edd89d99d841cb488ce9e1055a8 100644 --- a/chipathlon/run.py +++ b/chipathlon/run.py @@ -52,11 +52,9 @@ class Run(object): def _validate(self): if self.peak not in chipathlon.conf.peak_tools: self.errors.append("Run defined by %s is invalid. Specified peak tool is not supported." % (self,)) - if self.peak_type in ["narrow", "broad"]: - if self.peak_type == "broad" and self.peak not in ["spp", "macs2", "peakranger"]: - self.errors.append("Run defined by %s is invalid. Specified peak calling type '%s' is invalid with peak calling tool '%s'." % (self, self.peak_type, self.peak)) else: - self.errors.append("Run defined by %s is invalid. Specified peak calling type '%s' is not supported." % (self, self.peak_type)) + if self.peak_type not in chipathlon.conf.peak_types[self.peak]: + self.errors.append("Run defined by %s is invalid. Specified peak calling type '%s' is invalid with peak calling tool '%s'. Should be one of %s." % (self, self.peak_type, self.peak, chipathlon.conf.peak_types[self.peak])) if self.idr is not None: if len(self.signals) >= 2: if len(self.idr) == 2: