Commit 79ee510e authored by Penom Nom's avatar Penom Nom
Browse files

remove tophat and bowtie build components. correction of RSeQC javascript

parent a8d7b01b
......@@ -186,6 +186,7 @@ $(function () {
data: series
}]
};
var tt = {};
if (tooltip){
tt = {
......@@ -329,56 +330,72 @@ $(function () {
$("#infer-view-btn").click(function () {
if ($(":checked[id^=chk_sample_]").size() == 1) {
$("#modal-label-tmpl").html("NG6 <small> " + $("#analyse_name").val() + "</small>");
$('#modal-body-tmpl').html('<div id="infer-experiment-piechart-wrapper" style="width:auto;float:left"> </div> \
<div id="infer-experiment-text-wrapper" style="width:auto;float:right"> </div>');
$('#modal-body-tmpl').html('<div id="infer-experiment-piechart-wrapper" style="width:auto;"> </div> \
<div id="infer-experiment-text-wrapper" style="width:auto"> <dl> </dl></div>');
$("#modal-foot-tmpl").html('<button class="btn" data-dismiss="modal" aria-hidden="true"><i class="icon-remove"></i> Close</button>');
$("#ng6modal").css('width', 'auto');
$("#ng6modal").modal();
var combinations = {
"1++,1--,2+-,2-+" : {
title : 'PairEnd C1',
tooltip : "read1 mapped to ‘+’ strand indicates parental gene on ‘+’ strand<br>" +
"read1 mapped to ‘-‘ strand indicates parental gene on ‘-‘ strand<br>" +
"read2 mapped to ‘+’ strand indicates parental gene on ‘-‘ strand<br>" +
"read2 mapped to ‘-‘ strand indicates parental gene on ‘+’ strand<br><br>"
tooltip : [
"<dd>read1 mapped to ‘+’ strand indicates parental gene on ‘+’ strand</dd>",
"<dd>read1 mapped to ‘-‘ strand indicates parental gene on ‘-‘ strand</dd>",
"<dd>read2 mapped to ‘+’ strand indicates parental gene on ‘-‘ strand</dd>",
"<dd>read2 mapped to ‘-‘ strand indicates parental gene on ‘+’ strand</dd>"
].join("")
},
"1+-,1-+,2++,2--" : {
title : 'PairEnd C2',
tooltip : "read1 mapped to ‘+’ strand indicates parental gene on ‘-’ strand<br>" +
"read1 mapped to ‘-‘ strand indicates parental gene on ‘+‘ strand<br>" +
"read2 mapped to ‘+’ strand indicates parental gene on ‘+‘ strand<br>" +
"read2 mapped to ‘-‘ strand indicates parental gene on ‘-’ strand<br><br>"
tooltip : [
"<dd>read1 mapped to ‘+’ strand indicates parental gene on ‘-’ strand</dd>",
"<dd>read1 mapped to ‘-‘ strand indicates parental gene on ‘+‘ strand</dd>",
"<dd>read2 mapped to ‘+’ strand indicates parental gene on ‘+‘ strand</dd>",
"<dd>read2 mapped to ‘-‘ strand indicates parental gene on ‘-’ strand</dd>"
].join("")
},
"++,--" : {
title : 'SingleEnd C1',
tooltip : "read mapped to ‘+’ strand indicates parental gene on ‘+’ strand<br>" +
"read mapped to ‘-‘ strand indicates parental gene on ‘-‘ strand<br><br>"
tooltip : [
"<dd>read mapped to ‘+’ strand indicates parental gene on ‘+’ strand</dd>",
"<dd>read mapped to ‘-‘ strand indicates parental gene on ‘-‘ strand</dd>"
].join("")
},
"+-,-+" : {
title : 'SingleEnd C2',
tooltip : "read mapped to ‘+’ strand indicates parental gene on ‘-‘ strand<br>" +
"read mapped to ‘-‘ strand indicates parental gene on ‘+’ strand<br><br>"
tooltip : [
"<dd>read mapped to ‘+’ strand indicates parental gene on ‘-‘ strand</dd>",
"<dd>read mapped to ‘-‘ strand indicates parental gene on ‘+’ strand</dd>"
].join("")
},
'other' : {
title : 'other',
tooltip : 'Other combinations'
tooltip : '<dt>Other</dt><dd>Other combinations</dd>'
}
};
var titles = { 'PairEnd C1' : "1++,1--,2+-,2-+" , 'PairEnd C2' : "1+-,1-+,2++,2--", 'SingleEnd C1' : "++,--" , 'SingleEnd C2' : "+-,-+",
'other' : 'other'
};
var index = $(":checked[id^=chk_sample_]").attr("id").split("_")[2],
labels = [],
values = [];
var select = $("#reads_orientation_" + index ).val().split(';');
for (var i in select) {
var tmp = select[i].split(':');
labels.push(combinations[tmp[0]].title);
values.push(parseFloat(tmp[1]));
if(parseFloat(tmp[1]) > 0){
labels.push(combinations[tmp[0]].title);
values.push(parseFloat(tmp[1]));
$( "<dt>" + combinations[tmp[0]].title + "</dt>" + combinations[tmp[0]].tooltip ).appendTo($("#infer-experiment-text-wrapper dl"));
}
}
labels = labels.join(',');
values = values.join(',');
_piechart ('infer-experiment-piechart-wrapper' , labels, values) ;
$("#ng6modal").modal();
}
});
......@@ -413,7 +430,7 @@ $(function () {
$('#modal-body-tmpl').html('\
<div id="juncannot-nav" > \
<ul class="nav nav-tabs " > \
<li id="li-juncannot-junctions" class"active"><a href="#juncannot-chart-splicing-junctions" data-toggle="tab">Splicing junction</a></li> \
<li id="li-juncannot-junctions" class = "active"><a href="#juncannot-chart-splicing-junctions" data-toggle="tab">Splicing junction</a></li> \
<li id="li-juncannot-events" ><a href="#juncannot-chart-splicing-events" data-toggle="tab">Splicing events</a></li> \
</ul> \
</div> \
......@@ -443,12 +460,6 @@ $(function () {
}
_piechart ( 'juncannot-chart-splicing-' + type, labels.join(','),values.join(','), '###X###') ;
}
$('#juncannot-nav a').click(function (e) {
e.preventDefault();
$(this).tab('show');
})
$("#ng6modal").modal();
}
});
......@@ -526,46 +537,24 @@ $(function () {
if ($(":checked[id^=chk_sample_]").size() == 1 ) {
$("#modal-label-tmpl").html("NG6 <small> " + $("#analyse_name").val() + "</small>");
$('#modal-body-tmpl').html('\
<div id="rpkm-nav" > \
<ul class="nav nav-tabs " > \
<li id="li-rpkm-Q1" class"active"><a href="#div-rpkm-Q1" data-toggle="tab">Q1</a></li> \
<li id="li-rpkm-Q2" ><a href="#div-rpkm-Q2" data-toggle="tab">Q2</a></li> \
<li id="li-rpkm-Q3" ><a href="#div-rpkm-Q3" data-toggle="tab">Q3</a></li> \
<li id="li-rpkm-Q4" ><a href="#div-rpkm-Q4" data-toggle="tab">Q4</a></li> \
</ul> \
</div> \
<ul class="nav nav-tabs" > \
<li class="active"><a href="#div-rpkm-Q1" data-toggle="tab">Q1</a></li> \
<li ><a href="#div-rpkm-Q2" data-toggle="tab">Q2</a></li> \
<li ><a href="#div-rpkm-Q3" data-toggle="tab">Q3</a></li> \
<li ><a href="#div-rpkm-Q4" data-toggle="tab">Q4</a></li> \
</ul> \
<div class="tab-content">\
<div id="div-rpkm-Q1" class="tab-pane fade in active"><div id="rpkm-chart-Q1"></div></div>\
<div id="div-rpkm-Q2" class="tab-pane fade in "><div id="rpkm-chart-Q2"></div></div>\
<div id="div-rpkm-Q3" class="tab-pane fade in "><div id="rpkm-chart-Q3"></div></div>\
<div id="div-rpkm-Q4" class="tab-pane fade in "><div id="rpkm-chart-Q4"></div></div>\
<div id="div-rpkm-Q1" class="tab-pane fade in active"><div id="rpkm-chart-Q1"></div ><p class="tx-nG6-pi1-help">Transcripts with expression level ranked below 25 percentile</p></div>\
<div id="div-rpkm-Q2" class="tab-pane fade "><div id="rpkm-chart-Q2"></div><p class="tx-nG6-pi1-help">Transcripts with expression level ranked between 25 percentile and 50 percentile</p></div>\
<div id="div-rpkm-Q3" class="tab-pane fade "><div id="rpkm-chart-Q3"></div><p class="tx-nG6-pi1-help">Transcripts with expression level ranked between 50 percentile and 75 percentile</p></div>\
<div id="div-rpkm-Q4" class="tab-pane fade "><div id="rpkm-chart-Q4"></div><p class="tx-nG6-pi1-help">Transcripts with expression level ranked above 75 percentile</p></div>\
</div>\
');
$("#modal-foot-tmpl").html('<button class="btn" data-dismiss="modal" aria-hidden="true"><i class="icon-remove"></i> Close</button>');
$("#ng6modal").css('width', 'auto');
var index = $(":checked[id^=chk_sample_]").attr("id").split("_")[2];
var quartiles = ["Q1", "Q2", "Q3", "Q4"];
var titles = { "Q1" : "Q1 (0-25%)" , "Q2" : "Q2 (25-50%)", "Q3" : "Q3 (50-75%)", "Q4" : "Q4 (75-100%)" }
var quartiles = {
"Q1" :{
title : 'Q1 (0-25%)',
help : 'Transcripts with expression level ranked below 25 percentile'
},
"Q2" :{
title : "Q2 (25-50%)",
help : 'Transcripts with expression level ranked between 25 percentile and 50 percentile'
},
"Q3" :{
title : "Q3 (50-75%)",
help : 'Transcripts with expression level ranked between 50 percentile and 75 percentile'
},
"Q4" :{
title : "Q4 (75-100%)",
help : 'Transcripts with expression level ranked above 75 percentile'
},
};
var quartiles = { "Q1" : 'Q1 (0-25%)', "Q2" : "Q2 (25-50%)", "Q3" : "Q3 (50-75%)", "Q4" : "Q4 (75-100%)" };
for (var qname in quartiles){
if (quartiles.hasOwnProperty(qname)){
......@@ -578,7 +567,7 @@ $(function () {
},
yAxis: { title: { text: 'Percent Relative Error' }, min: 0 },
xAxis: { categories: [], title: { text: 'Resampling Percentage'}},
title: { text: quartiles[qname].title },
title: { text: quartiles[qname] },
series: [],
credits: { enabled: false }
};
......@@ -602,12 +591,6 @@ $(function () {
}
}
}
$('#rpkm-nav a').click(function (e) {
e.preventDefault();
$(this).tab('show');
})
$("#ng6modal").modal();
}
});
......
#
# Copyright (C) 2012 INRA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
import os
from jflow.component import Component
from jflow.iotypes import OutputFile, InputFile, Formats
from weaver.function import ShellFunction
class BowtieBuild (Component):
def define_parameters(self, input_fasta):
self.input_fasta = InputFile(input_fasta, Formats.FASTA)
self.databank = os.path.join(self.output_directory, os.path.splitext(os.path.basename(input_fasta))[0] )
self.output_fasta = OutputFile(self.databank + '.fa')
self.stdout = OutputFile(os.path.join(self.output_directory, "bowtie_build.stdout"))
self.stderr = OutputFile(os.path.join(self.output_directory, "bowtie_build.stderr"))
def process(self):
buildindex = ShellFunction( "ln -s $3 $4 ; $1 $3 $2 1> $5 2> $6 " , cmd_format="{EXE} {ARG} {IN} {OUT}" )
buildindex(inputs=self.input_fasta, outputs=[ self.output_fasta, self.stdout, self.stderr], arguments=[self.get_exec_path("bowtie2-build"), self.databank])
#
# Copyright (C) 2012 INRA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
import os
from subprocess import Popen, PIPE
from jflow.component import Component
from jflow.iotypes import OutputFile, OutputFileList, InputFileList, InputFile, Formats
from weaver.function import ShellFunction
from weaver.abstraction import Map
from ng6.analysis import Analysis
class TopHat (Analysis):
def define_parameters(self, index_basename, read1, read2, keep_bam=True, mate_inner_dist = 50):
self.index_basename = index_basename
self.input_fasta = InputFile(index_basename + '.fa')
self.read1 = InputFileList(read1, Formats.FASTQ)
self.read2 = None
self.mate_inner_dist = mate_inner_dist
self.keep_bam = keep_bam
self.stderr = OutputFileList(os.path.join(self.output_directory, "tophat2.stderr"))
if read2 :
self.read2 = InputFileList(read2, Formats.FASTQ)
self.accepted_hits = OutputFileList(os.path.join(self.output_directory, "accepted_hits.bam"), Formats.BAM)
def define_analysis(self):
self.name = "TopHat Alignment"
self.description = "Spliced transcripts alignment to whole genomes."
self.software = "tophat2"
def post_process(self):
if self.keep_bam:
self._save_files(self.bam_files)
def get_version(self):
cmd = [self.get_exec_path("tophat2"), "-v"]
p = Popen(cmd, stdout=PIPE, stderr=PIPE)
stdout, stderr = p.communicate()
return stdout.split()[1]
def process(self):
command = [self.get_exec_path("tophat2"), '-r', str(self.mate_inner_dist), "-o",self.output_directory, self.index_basename ]
if self.read2 :
tophat = ShellFunction( ' '.join(command + ["$1 $2 2> $4"]), cmd_format='{EXE} {IN} {OUT}')
tophat(inputs = [self.read1,self.read2, self.input_fasta], outputs = [self.stderr, self.accepted_hits])
else :
tophat = ShellFunction(' '.join(command + ["$1 2> $3"]), cmd_format='{EXE} {IN} {OUT}')
tophat(inputs = [self.read1, self.input_fasta],outputs = [self.stderr, self.accepted_hits])
\ No newline at end of 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