Commit 1e4f9cf4 authored by Maxime Manno's avatar Maxime Manno 🍜

Update insertssizes.py Java_path

parent c1d2d205
......@@ -32,7 +32,7 @@ from ng6.analysis import Analysis
# @param picard_path : path to the software picard.jar
# @param options : options for the software collectinsertsizemetrics
# """
def inserts_metrics(bam_file, pairs_count_file, metrics_file, hist_file, log_file, samtools_path, picard_path, options_dump_path, memory):
def inserts_metrics(bam_file, pairs_count_file, metrics_file, hist_file, log_file, samtools_path, java_path, picard_path, options_dump_path, memory):
"""
@param bam_file : path for bam
@param pairs_count_file : path to the produced file with the number of reads pairs in bam
......@@ -40,6 +40,7 @@ def inserts_metrics(bam_file, pairs_count_file, metrics_file, hist_file, log_fil
@param hist_file : path to the histogram produced by collectinsertsizemetrics
@param log_file : path to the log produced by collectinsertsizemetrics
@param samtools_path : path to the software samtools
@param java_path : path to the software java
@param picard_path : path to the software picard.jar
@param options : options for the software collectinsertsizemetrics
"""
......@@ -57,7 +58,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", 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 )
command = Popen( ["-c", java_path+" " +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
......@@ -153,7 +154,7 @@ class InsertsSizes (Analysis):
for i in range(len(self.bam_files)):
self.add_python_execution(inserts_metrics,cmd_format="{EXE} {IN} {OUT} {ARG}",
inputs=self.bam_files[i], outputs=[self.pairs_count_files[i], self.info_files[i], self.hist_files[i], self.log_files[i]],
arguments=[self.get_exec_path("samtools"), self.get_exec_path("Picard"), options_dump_path, self.memory])
arguments=[self.get_exec_path("samtools"), self.get_exec_path("javaPICARD"), self.get_exec_path("Picard"), options_dump_path, self.memory])
def parse_pairs_count_file(self, input_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