Commit 8b9503fe authored by Gerald Salin's avatar Gerald Salin
Browse files

modified args in the source to replace _ with -

parent 80d21431
......@@ -24,7 +24,7 @@ from ng6.ng6workflow import NG6Workflow
from ng6.utils import Utils
#TODO : this pipeline only supports bowtie2 for the moment
#TODO : tested in paired-end mode with fatsq.gz files, with casava_directory and --read-1 / --read-2
#TODO : tested in paired-end mode with fatsq.gz files, with casava-directory and --read-1 / --read-2
#TODO : tested in paired-end mode with fatsq files (not gzipped), with --read-1 / --read-2
#TODO : not tested in single-end mode
class Methylseq (NG6Workflow):
......@@ -37,30 +37,30 @@ class Methylseq (NG6Workflow):
# manage the sequences files
group_prefix = None
if self.args['casava_directory'] is None and self.args['read_1'] is None :
logging.getLogger("Methylseq").error("You must specify either --casava_directory from which the pipeline can fetch fastq.gz files or --read-1 argument")
raise ValueError, "You must specify use either --casava_directory from which the pipeline can fecth fastq.gz files or --read-1 argument "
elif self.args['casava_directory'] is not None :
logging.getLogger("Methylseq").debug("self.args['casava_directory'] = " + self.args['casava_directory'])
if self.args['lane_number'] is None :
if self.args['casava-directory'] is None and self.args['read-1'] is None :
logging.getLogger("Methylseq").error("You must specify either --casava-directory from which the pipeline can fetch fastq.gz files or --read-1 argument")
raise ValueError, "You must specify use either --casava-directory from which the pipeline can fecth fastq.gz files or --read-1 argument "
elif self.args['casava-directory'] is not None :
logging.getLogger("Methylseq").debug("self.args['casava-directory'] = " + self.args['casava-directory'])
if self.args['lane-number'] is None :
raise ValueError, "lane-number must be specified with casava-directory."
logging.getLogger("Methylseq").debug("self.args['lane_number'] = " + str(self.args['lane_number']))
mids_desc_array, self.read1_files, self.read2_files = Utils.filesFromCasava( self.args['casava_directory'], self.project.get_name(), self.args['lane_number'] )
mids_desc_array, self.read1_files, self.read2_files = Utils.filesFromCasava( self.args['casava-directory'], self.project.get_name(), self.args['lane-number'] )
group_prefix = (Utils.get_group_basenames(self.read1_files+self.read2_files, "read")).keys()
self.runobj.add_mids_description(mids_desc_array)
elif (self.args['read_1'] is not None) and (len(self.args['read_1']) > 0) :
logging.getLogger("Methylseq").debug("self.args['read_1'] = " + str(self.args['read_1']))
elif (self.args['read-1'] is not None) and (len(self.args['read-1']) > 0) :
logging.getLogger("Methylseq").debug("self.args['read-1'] = " + str(self.args['read-1']))
self.read1_files = []
self.read2_files = []
for file in self.args["read_1"]:
for file in self.args["read-1"]:
if os.path.isfile(file):
self.read1_files.append(file)
else:
logging.getLogger("Methylseq").error(file + " file does not exists.")
raise IOError, file + " file does not exists."
if self.args["read_2"]:
logging.getLogger("Methylseq").debug("self.args['read_2'] = " + str(self.args['read_2']))
for file in self.args["read_2"]:
if self.args["read-2"]:
logging.getLogger("Methylseq").debug("self.args['read-2'] = " + str(self.args['read-2']))
for file in self.args["read-2"]:
if os.path.isfile(file):
self.read2_files.append(file)
else:
......@@ -73,10 +73,10 @@ class Methylseq (NG6Workflow):
is_paired_end = len(self.read2_files) > 0
logging.getLogger("Methylseq").debug("Is Paired-end run = " + str(is_paired_end))
if self.args["keep_reads"] != "all" :
logging.getLogger("Methylseq").debug("fastqIlluminaFilter parameter = " + self.args["keep_reads"])
if self.args["keep-reads"] != "all" :
logging.getLogger("Methylseq").debug("fastqIlluminaFilter parameter = " + self.args["keep-reads"])
# fastq illumina filter
fastqilluminafilter = self.add_component("FastqIlluminaFilter", [self.read1_files+self.read2_files, self.args["keep_reads"], group_prefix, run_name+"_fastqilluminafilter.tar.gz"])
fastqilluminafilter = self.add_component("FastqIlluminaFilter", [self.read1_files+self.read2_files, self.args["keep-reads"], group_prefix, run_name+"_fastqilluminafilter.tar.gz"])
# list filtered files
if is_paired_end :
......@@ -118,61 +118,61 @@ class Methylseq (NG6Workflow):
#cleaning raw files (quality and adapter trimming)
logging.getLogger("Methylseq").debug("Before TrimGalore")
trim_galore = self.add_component("TrimGalore", [ concat_read1_files, concat_read2_files, self.args["non_directional"]], parent = fastqilluminafilter)
trim_galore = self.add_component("TrimGalore", [ concat_read1_files, concat_read2_files, self.args["non-directional"]], parent = fastqilluminafilter)
# make some statistics on cleaned files
fastqcCleaned = self.add_component("FastQC", [trim_galore.read1_cleaned + trim_galore.read2_cleaned, (group_prefix is not None), True, run_name+"_trim_galore_fastqc.tar.gz"], component_prefix="trim_galore", parent = trim_galore)
# spliced alignment of reads against indexed genome
logging.getLogger("Methylseq").debug("Before alignment")
logging.getLogger("Methylseq").debug("Reference genome = " + self.args["reference_genome"])
logging.getLogger("Methylseq").debug("Reference genome = " + self.args["reference-genome"])
#Alignement against the reference genome
indexed_ref = self.args["reference_genome"]
indexed_ref = self.args["reference-genome"]
# index the reference genome if not already indexed
if not os.path.exists( os.path.join(os.path.dirname(indexed_ref),"Bisulfite_Genome" )):
bismark_genome_preparation = self.add_component("BismarkGenomePreparation", [ self.args["reference_genome"], self.args["bowtie2"] ])
bismark_genome_preparation = self.add_component("BismarkGenomePreparation", [ self.args["reference-genome"], self.args["bowtie2"] ])
indexed_ref = bismark_genome_preparation.databank_fasta
if is_paired_end :
# align the PE reads against the reference genome with bismark
bismarkReference = self.add_component("Bismark", [indexed_ref,trim_galore.read1_cleaned, trim_galore.read2_cleaned,self.args["non_directional"],self.args["bowtie2"],self.args["alignment_mismatch"]], component_prefix="paired",parent = trim_galore)
bismarkReference = self.add_component("Bismark", [indexed_ref,trim_galore.read1_cleaned, trim_galore.read2_cleaned,self.args["non-directional"],self.args["bowtie2"],self.args["alignment-mismatch"]], component_prefix="paired",parent = trim_galore)
# process insert sizes of the aligned reads
insertssizesReference = self.add_component("InsertsSizes", [bismarkReference.output_sorted_bam, self.args["histogram_width"], self.args["min_pct"], "LENIENT", "inserts_sizes.tar.gz"], component_prefix="paired", parent = bismarkReference)
insertssizesReference = self.add_component("InsertsSizes", [bismarkReference.output_sorted_bam, self.args["histogram-width"], self.args["min-pct"], "LENIENT", "inserts_sizes.tar.gz"], component_prefix="paired", parent = bismarkReference)
# compute the methylation extraction from the alignement
bismarkReference_extract = self.add_component("BismarkMethylationExtractor", [indexed_ref, bismarkReference.output_sorted_bam, "paired" , self.args["methylation_extractor_no_overlap"]], component_prefix="paired",parent = bismarkReference)
bismarkReference_extract = self.add_component("BismarkMethylationExtractor", [indexed_ref, bismarkReference.output_sorted_bam, "paired" , self.args["methylation-extractor-no-overlap"]], component_prefix="paired",parent = bismarkReference)
# make some statistic on the alignement
alignmentstats = self.add_component("AlignmentStats", [bismarkReference.output_sorted_bam, is_paired_end, False], parent = bismarkReference, component_prefix="PEreference")
else:
# align the SE reads against the reference genome with bismark
bismarkReference = self.add_component("Bismark", [indexed_ref,trim_galore.read1_cleaned, None ,self.args["non_directional"],self.args["bowtie2"],self.args["alignment_mismatch"]],parent = trim_galore)
bismarkReference = self.add_component("Bismark", [indexed_ref,trim_galore.read1_cleaned, None ,self.args["non-directional"],self.args["bowtie2"],self.args["alignment-mismatch"]],parent = trim_galore)
# compute the methylation extraction from the alignement
bismarkReference_extract = self.add_component("BismarkMethylationExtractor", [indexed_ref, bismarkReference.output_sorted_bam, "single" , self.args["methylation_extractor_no_overlap"]], parent = bismarkReference)
bismarkReference_extract = self.add_component("BismarkMethylationExtractor", [indexed_ref, bismarkReference.output_sorted_bam, "single" , self.args["methylation-extractor-no-overlap"]], parent = bismarkReference)
# make some statistic on the alignement
alignmentstats = self.add_component("AlignmentStats", [bismarkReference.output_sorted_bam, is_paired_end, False], parent = bismarkReference, component_prefix="SEreference")
#Alignement against the control sequence if specified
if self.args["control_reference"]:
logging.getLogger("Methylseq").debug("Controle sequence = " + self.args["control_reference"])
indexed_control = self.args["control_reference"]
if self.args["control-reference"]:
logging.getLogger("Methylseq").debug("Controle sequence = " + self.args["control-reference"])
indexed_control = self.args["control-reference"]
# index the control sequence if not already indexed
if not os.path.exists( os.path.join(os.path.dirname(indexed_control),"Bisulfite_Genome" )):
bismark_genome_preparation_control = self.add_component("BismarkGenomePreparation", [ self.args["control_reference"], self.args["bowtie2"] ], component_prefix="control")
bismark_genome_preparation_control = self.add_component("BismarkGenomePreparation", [ self.args["control-reference"], self.args["bowtie2"] ], component_prefix="control")
bismark_genome_preparation_control.description = "test modif description analyse"
indexed_control = bismark_genome_preparation_control.databank_fasta
if is_paired_end :
# align the PE reads against the control sequence with bismark
bismarkControl = self.add_component("Bismark", [indexed_control,trim_galore.read1_cleaned, trim_galore.read2_cleaned,self.args["non_directional"],self.args["bowtie2"],self.args["alignment_mismatch"]], component_prefix="control_paired", parent = trim_galore)
bismarkControl = self.add_component("Bismark", [indexed_control,trim_galore.read1_cleaned, trim_galore.read2_cleaned,self.args["non-directional"],self.args["bowtie2"],self.args["alignment-mismatch"]], component_prefix="control_paired", parent = trim_galore)
# process insert sizes of the aligned reads
insertssizesControl = self.add_component("InsertsSizes", [bismarkControl.output_sorted_bam, self.args["histogram_width"], self.args["min_pct"], "LENIENT", "inserts_sizes.tar.gz"], component_prefix="control_paired", parent = bismarkControl)
# compute the methylation extraction from the alignement
bismarkControl_extract = self.add_component("BismarkMethylationExtractor", [indexed_control, bismarkControl.output_sorted_bam, "paired" , self.args["methylation_extractor_no_overlap"]], component_prefix="control_paired", parent = bismarkControl)
bismarkControl_extract = self.add_component("BismarkMethylationExtractor", [indexed_control, bismarkControl.output_sorted_bam, "paired" , self.args["methylation-extractor-no-overlap"]], component_prefix="control_paired", parent = bismarkControl)
# make some statistic on the alignement
alignmentstats = self.add_component("AlignmentStats", [bismarkControl.output_sorted_bam, is_paired_end, False], parent = bismarkControl, component_prefix="PEcontrol")
else:
# align the SE reads against the control sequence with bismark
bismarkControl = self.add_component("Bismark", [indexed_control,trim_galore.read1_cleaned, None ,self.args["non_directional"],self.args["bowtie2"],self.args["alignment_mismatch"]], component_prefix="control", parent = trim_galore)
bismarkControl = self.add_component("Bismark", [indexed_control,trim_galore.read1_cleaned, None ,self.args["non-directional"],self.args["bowtie2"],self.args["alignment-mismatch"]], component_prefix="control", parent = trim_galore)
# compute the methylation extraction from the alignement
bismarkControl_extract = self.add_component("BismarkMethylationExtractor", [indexed_control, bismarkControl.output_sorted_bam, "single" , self.args["methylation_extractor_no_overlap"]], component_prefix="control", parent = bismarkControl)
bismarkControl_extract = self.add_component("BismarkMethylationExtractor", [indexed_control, bismarkControl.output_sorted_bam, "single" , self.args["methylation-extractor-no-overlap"]], component_prefix="control", parent = bismarkControl)
# make some statistic on the alignement
alignmentstats = self.add_component("AlignmentStats", [bismarkControl.output_sorted_bam, is_paired_end, False], parent = bismarkControl, component_prefix="SEcontrol")
......
......@@ -78,7 +78,7 @@ alignment_mismatch.default = 1
alignment_mismatch.type = int
max_insert_size.name = max_insert_size
max_insert_size.flag = --max_insert_size
max_insert_size.flag = --max-insert-size
max_insert_size.help = The maximum insert size for valid paired-end alignments.
max_insert_size.default = 500
......@@ -89,7 +89,7 @@ bowtie2.default = False
bowtie2.type = bool
extractor_no_overlap.name = methylation_extractor_no_overlap
extractor_no_overlap.flag = --extractor-no-overlap
extractor_no_overlap.flag = --methylation-extractor-no-overlap
extractor_no_overlap.help = This option avoids scoring overlapping methylation calls twice for paired data with too short inserts
extractor_no_overlap.default = True
extractor_no_overlap.type = bool
......@@ -113,11 +113,11 @@ keep_reads.choices = pass_illumina_filters|not_pass_illumina_filters|all
histogram_width.name = histogram_width
histogram_width.flag = --histogram_width
histogram_width.flag = --histogram-width
histogram_width.help = Explicitly sets the histogram width, overriding automatic truncation of histogram tail.
histogram_width.default = 800
min_pct.name = min_pct
min_pct.flag = --min_pct
min_pct.flag = --min-pct
min_pct.help = When generating the histogram, discard any data categories (out of FR, TANDEM, RF) that have fewer than this percentage of overall reads.
min_pct.default = 0.01
\ No newline at end of file
Markdown is supported
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