Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
1 merge request!22Resolve "Add broad / narrow peak for available tools"
......@@ -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
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment