Commit 9596d46c authored by Audrey Gibert's avatar Audrey Gibert
Browse files

Ajout du path JAVA pour les picardTools

parent b818975b
......@@ -100,7 +100,7 @@ user_base_directory = /work/
#fastx_reverse_complement = /usr/bin/fastx_reverse_complement
#STAR = /usr/bin/STAR
#fastuniq = /usr/local/bin/fastuniq
#
#javaPICARD = /tools/java/jre1.8.0_45/bin/java
# workflow specific
#
......
......@@ -607,6 +607,7 @@ class Component(object):
trace_fh.close()
def __write_element(self,fh, title, element):
logging.getLogger("jflow").debug("element = "+str(element))
to_write=''
if isinstance(element, list):
if len (element)> 0 :
......@@ -617,7 +618,7 @@ class Component(object):
else :
to_write+="\n".join(element)+"\n"
else :
to_write+= element+"\n"
to_write+= str(element)+"\n"
if to_write != "" :
fh.write(title+" :\n")
fh.write(to_write)
......@@ -527,9 +527,9 @@ class CasavaNG6Workflow(NG6Workflow):
except : pass
# contamination_search
if contam :
if self.contamination_databank: contam.extend(self.contamination_databank)
contamination_search = self.add_component("ContaminationSearch", [filtered_read1_files+filtered_read2_files, contam, reads_prefixes], parent = fastqilluminafilter)
#if contam :
# if self.contamination_databank: contam.extend(self.contamination_databank)
# contamination_search = self.add_component("ContaminationSearch", [filtered_read1_files+filtered_read2_files, contam, reads_prefixes], parent = fastqilluminafilter)
# make some statistics on raw file
fastqc = self.add_component("FastQC", [filtered_read1_files+filtered_read2_files, (self.group_prefix is not None), self.no_group, "fastqc.tar.gz"], parent = fastqilluminafilter)
......
......@@ -45,6 +45,9 @@ class AlignmentStats (Analysis):
self.add_parameter("max_file_handles", "max_file_handles", default=max_file_handles, type=int)
self.add_parameter("sorting_collection_size_ratio", "sorting_collection_size_ratio", default=max_file_handles, type=float)
self.add_parameter("archive_name", "archive_name", default=archive_name)
self.memory = '4G'
if self.get_memory() != None :
self.memory=self.get_memory()
self.add_output_file_list( "stat_files", "stat_files", pattern='{basename_woext}.stat', items=self.bam_files)
self.add_output_file_list( "cigar_stderrs", "cigar_stderrs", pattern='{basename_woext}.cigar_stderr', items=self.bam_files)
......@@ -150,9 +153,10 @@ class AlignmentStats (Analysis):
def process(self):
# Duplication stats
xmx="-Xmx"+self.memory.lower()
if self.search_dupl:
self.tmp_bam = self.get_outputs('{basename_woext}_noDupl.bam', self.bam_files)
self.add_shell_execution("/tools/java/jre1.8.0_45/bin/java -Xmx4g -jar " + self.get_exec_path("Picard") + " MarkDuplicates INPUT=$1 METRICS_FILE=$2 OUTPUT=$3" + self.duplication_options + " 2> $4",
self.add_shell_execution(self.get_exec_path("javaPICARD")+ xmx +"-jar " + self.get_exec_path("Picard") + " MarkDuplicates INPUT=$1 METRICS_FILE=$2 OUTPUT=$3" + self.duplication_options + " 2> $4",
cmd_format='{EXE} {IN} {OUT}', map=True,
inputs=self.bam_files, outputs=[self.duplication_files, self.tmp_bam, self.dupl_stderrs])
......
......@@ -57,7 +57,7 @@ def inserts_metrics(bam_file, pairs_count_file, metrics_file, hist_file, log_fil
if properly_paired_nb > 0 :
# Process inserts sizes metrics
command = Popen( ["-c", "/tools/java/jre1.8.0_45/bin/java "+xmx+" -jar " + picard_path + " CollectInsertSizeMetrics " +options + " HISTOGRAM_FILE=" + hist_file + " INPUT=" + bam_file + " OUTPUT=" + metrics_file + " 2> " + log_file], shell=True, stdout=PIPE, stderr=PIPE )
command = Popen( ["-c", self.get_exec_path("javaPICARD")+" " +xmx+" -jar " + picard_path + " CollectInsertSizeMetrics " +options + " HISTOGRAM_FILE=" + hist_file + " INPUT=" + bam_file + " OUTPUT=" + metrics_file + " 2> " + log_file], shell=True, stdout=PIPE, stderr=PIPE )
stdout, stderr = command.communicate()
# Count nb pairs in bam file
command = Popen( ["-c", samtools_path + " view -F384 " + bam_file + " | wc -l"], shell=True, stdout=PIPE, stderr=PIPE) # First read in pair
......@@ -138,14 +138,10 @@ class InsertsSizes (Analysis):
self._create_and_archive(self.info_files, self.archive_name)
def get_version(self):
cmd = "/tools/java/jre1.8.0_45/bin/java -Xmx1g -jar {} CollectInsertSizeMetrics --version".format(self.get_exec_path("Picard"))
cmd = self.get_exec_path("javaPICARD")+" " + xmx +" -jar {} CollectInsertSizeMetrics --version".format(self.get_exec_path("Picard"))
p = Popen(cmd, stdout=PIPE, stderr=PIPE, shell=True)
stdout, stderr = p.communicate()
return(stderr.decode("utf-8").rsplit()[0])
# cmd = ["/tools/java/jre1.8.0_45/bin/java", "-Xmx1g", "-jar", self.get_exec_path("Picard")," CollectInsertSizeMetrics --version"]
# p = Popen(cmd, stdout=PIPE, stderr=PIPE)
# stdout, stderr = p.communicate()
# return stderr.split()[0]
def process(self):
options_dump_path = self.get_temporary_file(".dump")
......
......@@ -47,13 +47,13 @@ class RnaSeqQualityCheck (CasavaNG6Workflow):
if not os.path.exists( self.reference_transcriptome + ".bwt" ):
bwaindex = self.add_component("BWAIndex", [self.reference_transcriptome])
indexed_ref = bwaindex.databank
# align reads against indexed genome
sample_lane_prefixes = None
if self.group_prefix != None :
sample_lane_prefixes = list((Utils.get_group_basenames(filtered_read1_files+filtered_read2_files, "lane")).keys())
bwa = self.add_component("BWA", [indexed_ref, filtered_read1_files, filtered_read2_files, sample_lane_prefixes, "mem", not self.delete_bam], parent = fastqilluminafilter)
# make some statistic on the alignement
alignmentstats = self.add_component("AlignmentStats", [bwa.bam_files, self.is_paired_end()], parent = bwa, component_prefix="bwa")
......@@ -77,17 +77,17 @@ class RnaSeqQualityCheck (CasavaNG6Workflow):
concat_read2_files = filtered_read2_files
concat_read1_files = sorted(concat_read1_files)
concat_read2_files = sorted(concat_read2_files)
sample_lane_prefixes = None
if self.group_prefix != None :
sample_lane_prefixes = sorted(list((Utils.get_group_basenames(concat_read1_files+concat_read2_files, "lane")).keys()))
star = self.add_component("STAR", [reference_genome, index_dir, concat_read1_files, concat_read2_files,sample_lane_prefixes, not self.delete_bam, self.n_threads], parent = fastqilluminafilter)
# make some statistic on the alignment
alignmentstats = self.add_component("AlignmentStats", [star.output_bams, self.is_paired_end()], parent = star, component_prefix="star")
#Quality RNA Seq analysis
if self.annotation:
rseqc = self.add_component("RSeQC", [star.output_bams, self.annotation], parent = star)
......@@ -35,7 +35,7 @@ class STARIndex (Component):
def process(self):
xmx="-Xmx" + self.memory.lower()
# normalize fasta
self.add_shell_execution( "/tools/java/jre1.8.0_45/bin/java " + xmx + " -jar " + self.get_exec_path("Picard") + " NormalizeFasta I=$1 O=$2 ",
self.add_shell_execution( self.get_exec_path("javaPICARD")+" " + xmx + " -jar " + self.get_exec_path("Picard") + " NormalizeFasta I=$1 O=$2 ",
cmd_format="{EXE} {IN} {OUT}", map=False,
inputs = self.input_fasta, outputs = self.normalized_fasta_file)
......
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