Commit 2d52456e authored by aknecht2's avatar aknecht2
Browse files

Added peak types for validation, updated run to validated based on info in configuration.

parent 9a4900f1
...@@ -39,6 +39,15 @@ peak_tools = [ ...@@ -39,6 +39,15 @@ peak_tools = [
"ccat" "ccat"
] ]
# Peak_type validation
peak_types = {
"spp": ["narrow", "broad"],
"macs2": ["narrow", "broad"],
"gem": ["narrow"],
"peakranger": ["narrow"],
"ccat": ["broad"]
}
# File extensions # File extensions
file_extensions = { file_extensions = {
"genome_index": ["fa", "fna"], "genome_index": ["fa", "fna"],
...@@ -46,7 +55,7 @@ file_extensions = { ...@@ -46,7 +55,7 @@ file_extensions = {
"sai": ["sai"], "sai": ["sai"],
"sam": ["sam"], "sam": ["sam"],
"bam": ["bam"], "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"], "bwa_genome": ["amb", "ann", "bwt", "pac", "sa"],
"bowtie2_genome": ["1.bt2", "2.bt2", "3.bt2", "4.bt2", "rev.1.bt2", "rev.2.bt2"], "bowtie2_genome": ["1.bt2", "2.bt2", "3.bt2", "4.bt2", "rev.1.bt2", "rev.2.bt2"],
"quality": ["quality"], "quality": ["quality"],
...@@ -139,7 +148,3 @@ genomes = { ...@@ -139,7 +148,3 @@ genomes = {
"additional_files": file_extensions["bowtie2_genome"] "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
...@@ -52,11 +52,9 @@ class Run(object): ...@@ -52,11 +52,9 @@ class Run(object):
def _validate(self): def _validate(self):
if self.peak not in chipathlon.conf.peak_tools: 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,)) 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: 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 self.idr is not None:
if len(self.signals) >= 2: if len(self.signals) >= 2:
if len(self.idr) == 2: if len(self.idr) == 2:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment