コード例 #1
0
ファイル: server.py プロジェクト: Cibiv/Teaser
	def addSectionSelectData(self, page):
		page.addSection("Import Data Set", """
        	Teaser supports reads in FASTQ format and gold standard alignments in SAM format. First, place your data files in the <i>Teaser/import</i> directory. After refreshing this page, you will be able to select the files to import below. If you do not find your desired reference sequence in the list, please download and place the uncompressed FASTA file in the <i>Teaser/references</i> directory.<br><hr>
	        <div class="form-horizontal">
	          <div class="form-group">
	            <label for="reference" class="col-sm-2 control-label">Reference Genome</label>
	            <div class="col-sm-4">
	              <select id="reference" class="form-control" name="reference">
	                """ + "\n".join(self.getReferenceOptions()) + """
	              </select>
	            </div>
	          </div>

              <div class="form-group">
              <label class="col-sm-2 control-label">
              Library Type
              </label>
              <div class="radio">
                <label>
                  <input type="radio" name="paired" id="optionsRadios1" value="false" onClick="javascript:$('#reads2').prop('disabled',true);" checked>
                  Single-End
                </label>
                <label>
                  <input type="radio" name="paired" id="optionsRadios2" value="true" onClick="javascript:$('#reads2').prop('disabled',false);">
                  Paired-End
                </label>
              </div>
              </div>

              <div class="form-group">
                <label for="reads1" class="col-sm-2 control-label">Simulated Reads File (1)</label>
                <div class="col-sm-4">
                  <select id="reads1" class="form-control" name="reads1">
                    """ + "\n".join(self.getFileOptions()) + """
                  </select>
                </div>
              </div>

              <div class="form-group">
                <label for="reads2" class="col-sm-2 control-label">Simulated Reads File (2)</label>
                <div class="col-sm-4">
                  <select id="reads2" class="form-control" name="reads2" disabled>
                    """ + "\n".join(self.getFileOptions()) + """
                  </select>
                </div>
              </div>

              <div class="form-group">
                <label for="gold_standard" class="col-sm-2 control-label">Gold Standard Alignment File</label>
                <div class="col-sm-4">
                  <select id="gold_standard" class="form-control" name="gold_standard">
                    """ + "\n".join(self.getFileOptions([".sam"])) + """
                  </select>
                </div>
              </div>
            </div>

            """, """<div class="form-group">
                <a href="#section1" class="btn btn-info" role="button">Back</a> <a href="#section3" class="btn btn-info" role="button">Next</a>  
              </div>""")
コード例 #2
0
    def addSectionEvaluation(self, page):
        mapper_options = ""
        for mapper_id in sorted(config["mappers"]):
            if "title" in config["mappers"][mapper_id]:
                mapper_title = config["mappers"][mapper_id]["title"]
            else:
                mapper_title = mapper_id

            mapper_options += """<optgroup label="%s">""" % mapper_title
            mapper_options += """<option value="m%s" selected>%s - Default</option>""" % (
                mapper_id, mapper_title)

            if "parameters" in config:
                for parameter_id in sorted(config["parameters"]):
                    if config["parameters"][parameter_id][
                            "mapper"] != mapper_id:
                        continue

                    if "title" in config["parameters"][parameter_id]:
                        param_title = config["parameters"][parameter_id][
                            "title"]
                    else:
                        param_title = parameter_id
                    mapper_options += """<option value="p%s">%s - %s</option>""" % (
                        parameter_id, mapper_title, param_title)

            mapper_options += """</optgroup>"""

        page.addSection(
            "Evaluation", """
        	Finally, select the mappers and parameter sets that should be evaluated. Community-created parameter sets are available for download at: <a href="https://github.com/Cibiv/Teaser">https://github.com/Cibiv/Teaser</a>. <br><hr>
			<div class="form-horizontal">
               <div class="form-group">
                <label for="mappers" class="col-sm-2 control-label">Mappers and Parameter Settings</label>
                <div class="col-sm-4">
                    <select class="selectpicker" name="mappers" id="mappers" data-width="100%" multiple>
                       """ + mapper_options + """
                    </select>
                </div>
              </div>

              <div class="form-group">
                <label for="evaluator" class="col-sm-2 control-label">Alignment Evaluation Method</label>
                <div class="col-sm-4">
                  <select id="evaluator" class="form-control" name="evaluator">
                     <option value="1" selected>Basic</option>
                  </select>
                </div>
              </div>
            </div>
            """, """<div class="form-group">
                <a href="#section2" class="btn btn-info" role="button">Back</a> <button type="submit" class="btn btn-primary" id="submitButton" name="submitButton">Run Teaser</button> <a href="#section4" class="btn btn-info" role="button">Advanced Options</a>
              </div>""")

        page.addScript(
            """window.onload = function () {$('.selectpicker').selectpicker();}"""
        )
コード例 #3
0
    def addSectionAdvanced(self, page):
        page.addSection(
            "Advanced", """
            The options below allow adjusting the resources used for evaluation and other advanced options. Please note that for large, i.e. complex mammalian, genomes simulation and mapping may require up to 16GB of memory.<br><hr>
			<div class="form-horizontal">
              <div class="form-group">
                <label for="threads" class="col-sm-2 control-label">Number of CPU cores to use</label>
                <div class="col-sm-2">
                  <input type="number" class="form-control" id="threads" name="threads" min="1" max="%d" value="%d" step="1">
                </div>
              </div>

              <div class="form-group">
                <label for="sub_max_memory" class="col-sm-2 control-label">Max. Mapper Memory Usage (MB)</label>
                <div class="col-sm-2">
                  <input type="number" class="form-control" id="sub_max_memory" name="sub_max_memory" min="1" max="%d" value="%d" step="1">
                </div>
              </div>

              <div class="form-group">
                <label for="sub_max_runtime" class="col-sm-2 control-label">Max. Mapper Runtime (s)</label>
                <div class="col-sm-2">
                  <input type="number" class="form-control" id="sub_max_memory" name="sub_max_runtime" min="60" max="%d" value="%d" step="1">
                </div>
              </div>

              <div class="form-group">
                <label for="simulator" class="col-sm-2 control-label">Simulator</label>
                <div class="col-sm-4">
                  <select id="simulator" class="form-control" name="simulator">
                    <option value="none">Choose Automatically</option>
                    <option value="mason">Mason (Illumina,454)</option>
                    <option value="dwgsim">DWGSIM (Illumina,454,Ion Torrent)</option>
                  </select>
                </div>
              </div>

              <div class="form-group">
                <label for="coverage" class="col-sm-2 control-label">Read Count Multiplier</label>
                <div class="col-sm-2">
                  <input type="number" class="form-control" id="coverage" name="coverage" size="1" min="0.1" max="5" step="0.1" value="1">
                </div>
              </div>

            </div>
            """ % (config["teaser"]["server"]["max_threads"],
                   config["teaser"]["server"]["default_threads"],
                   config["teaser"]["server"]["max_memory"],
                   config["teaser"]["server"]["default_memory"],
                   config["teaser"]["server"]["max_runtime"],
                   config["teaser"]["server"]["default_runtime"]),
            """<div class="form-group">
              <a href="#section4" class="btn btn-info" role="button">Back</a> <button type="submit" class="btn btn-primary" id="submitButton" name="submitButton">Run Teaser</button>
              </div></form>""")
コード例 #4
0
    def addSectionSelectData(self, page):
        page.addSection(
            "Import Data Set", """
        	Teaser supports reads in FASTQ format. First, place your data files in the <i>Teaser/import</i> directory. After refreshing this page, you will be able to select the files to import below. If you do not find your desired reference sequence in the list, please download and place the uncompressed FASTA file in the <i>Teaser/references</i> directory.<br><hr>
	        <div class="form-horizontal">
	          <div class="form-group">
	            <label for="reference" class="col-sm-2 control-label">Reference Genome</label>
	            <div class="col-sm-4">
	              <select id="reference" class="form-control" name="reference">
	                """ + "\n".join(self.getReferenceOptions()) + """
	              </select>
	            </div>
	          </div>

              <div class="form-group">
              <label class="col-sm-2 control-label">
              Library Type
              </label>
              <div class="radio">
                <label>
                  <input type="radio" name="paired" id="optionsRadios1" value="false" onClick="javascript:$('#reads2').prop('disabled',true);" checked>
                  Single-End
                </label>
                <label>
                  <input type="radio" name="paired" id="optionsRadios2" value="true" onClick="javascript:$('#reads2').prop('disabled',false);">
                  Paired-End
                </label>
              </div>
              </div>

              <div class="form-group">
                <label for="reads1" class="col-sm-2 control-label">Simulated Reads File (1)</label>
                <div class="col-sm-4">
                  <select id="reads1" class="form-control" name="reads1">
                    """ + "\n".join(self.getFileOptions()) + """
                  </select>
                </div>
              </div>

              <div class="form-group">
                <label for="reads2" class="col-sm-2 control-label">Simulated Reads File (2)</label>
                <div class="col-sm-4">
                  <select id="reads2" class="form-control" name="reads2" disabled>
                    """ + "\n".join(self.getFileOptions()) + """
                  </select>
                </div>
              </div>
            </div>

            """, """<div class="form-group">
                <a href="#section1" class="btn btn-info" role="button">Back</a> <a href="#section3" class="btn btn-info" role="button">Next</a>  
              </div>""")
コード例 #5
0
ファイル: server.py プロジェクト: Cibiv/Teaser
	def addSectionEvaluation(self, page):
		mapper_options = ""
		for mapper_id in sorted(config["mappers"]):
			if "title" in config["mappers"][mapper_id]:
				mapper_title = config["mappers"][mapper_id]["title"]
			else:
				mapper_title = mapper_id

			mapper_options += """<optgroup label="%s">""" % mapper_title
			mapper_options += """<option value="m%s" selected>%s - Default</option>""" % (mapper_id, mapper_title)

			if "parameters" in config:
				for parameter_id in sorted(config["parameters"]):
					if config["parameters"][parameter_id]["mapper"] != mapper_id:
						continue

					if "title" in config["parameters"][parameter_id]:
						param_title = config["parameters"][parameter_id]["title"]
					else:
						param_title = parameter_id
					mapper_options += """<option value="p%s">%s - %s</option>""" % (parameter_id, mapper_title, param_title)

			mapper_options += """</optgroup>"""

		page.addSection("Evaluation", """
        	Finally, select the mappers and parameter sets that should be evaluated. Community-created parameter sets are available for download at: <a href="https://github.com/Cibiv/Teaser">https://github.com/Cibiv/Teaser</a>. <br><hr>
			<div class="form-horizontal">
               <div class="form-group">
                <label for="mappers" class="col-sm-2 control-label">Mappers and Parameter Settings</label>
                <div class="col-sm-4">
                    <select class="selectpicker" name="mappers" id="mappers" data-width="100%" multiple>
                       """ + mapper_options + """
                    </select>
                </div>
              </div>

              <div class="form-group">
                <label for="evaluator" class="col-sm-2 control-label">Alignment Evaluation Method</label>
                <div class="col-sm-4">
                  <select id="evaluator" class="form-control" name="evaluator">
                     <option value="1" selected>Basic</option>
                  </select>
                </div>
              </div>
            </div>
            """, """<div class="form-group">
                <a href="#section2" class="btn btn-info" role="button">Back</a> <button type="submit" class="btn btn-primary" id="submitButton" name="submitButton">Run Teaser</button> <a href="#section4" class="btn btn-info" role="button">Advanced Options</a>
              </div>""")

		page.addScript("""window.onload = function () {$('.selectpicker').selectpicker();}""")
コード例 #6
0
ファイル: server.py プロジェクト: Cibiv/Teaser
	def addSectionDataSource(self, page, type=""):
		button_teaser = self.makeButton("simulated_teaser", type, "/define")
		button_custom = self.makeButton("simulated_custom", type, "/define-custom")
		button_real = self.makeButton("real", type, "/define-real")

		page.addSection("Choose Data Source", """
			  To begin, choose the source of the NGS read data that mappers should be benchmarked for.<br><hr>
              <div class="container-fluid">
			     <div class="row-fluid" align="center">
				    <div class="col-md-4" style="border-right:2px solid grey;"><h3>New Simulation</h3> <p style="height:75px;"> Use Teaser to quickly define a simulated data set and benchmark mappers on it.</p><p>%s</p></div>
				    <div class="col-md-4" style="border-right:2px solid grey;"><h3>Existing Simulation</h2> <p style="height:75px;"> Provide a custom set of reads and gold standard alignment for benchmarking mappers.</p><p>%s</p></div>
				    <div class="col-md-4"><h3>Real Data</h3> <p style="height:75px;"> Provide real read data to benchmark mapped percentages and throughput of mappers.</p><p>%s</p></div>
			     </div>
              </div>
              <form method="post" role="form" action="submitjob" class="form-horizontal" name="mainForm" id="mainForm">
              <input type="hidden" name="type" value="%s">""" % (button_teaser, button_custom, button_real, type), """<div class="form-group"><a href="../" class="btn btn-warning" role="button">Cancel</a> <a href="#section2" class="btn btn-info" role="button">Next</a></div>""")
コード例 #7
0
ファイル: server.py プロジェクト: Cibiv/Teaser
	def addSectionAdvanced(self, page):
		page.addSection("Advanced", """
            The options below allow adjusting the resources used for evaluation and other advanced options. Please note that for large, i.e. complex mammalian, genomes simulation and mapping may require up to 16GB of memory.<br><hr>
			<div class="form-horizontal">
              <div class="form-group">
                <label for="threads" class="col-sm-2 control-label">Number of CPU cores to use</label>
                <div class="col-sm-2">
                  <input type="number" class="form-control" id="threads" name="threads" min="1" max="%d" value="%d" step="1">
                </div>
              </div>

              <div class="form-group">
                <label for="sub_max_memory" class="col-sm-2 control-label">Max. Mapper Memory Usage (MB)</label>
                <div class="col-sm-2">
                  <input type="number" class="form-control" id="sub_max_memory" name="sub_max_memory" min="1" max="%d" value="%d" step="1">
                </div>
              </div>

              <div class="form-group">
                <label for="sub_max_runtime" class="col-sm-2 control-label">Max. Mapper Runtime (s)</label>
                <div class="col-sm-2">
                  <input type="number" class="form-control" id="sub_max_memory" name="sub_max_runtime" min="60" max="%d" value="%d" step="1">
                </div>
              </div>

              <div class="form-group">
                <label for="simulator" class="col-sm-2 control-label">Simulator</label>
                <div class="col-sm-4">
                  <select id="simulator" class="form-control" name="simulator">
                    <option value="none">Choose Automatically</option>
                    <option value="mason">Mason (Illumina,454)</option>
                    <option value="dwgsim">DWGSIM (Illumina,454,Ion Torrent)</option>
                  </select>
                </div>
              </div>

              <div class="form-group">
                <label for="coverage" class="col-sm-2 control-label">Read Count Multiplier</label>
                <div class="col-sm-2">
                  <input type="number" class="form-control" id="coverage" name="coverage" size="1" min="0.1" max="5" step="0.1" value="1">
                </div>
              </div>

            </div>
            """ % (config["teaser"]["server"]["max_threads"], config["teaser"]["server"]["default_threads"], config["teaser"]["server"]["max_memory"], config["teaser"]["server"]["default_memory"], config["teaser"]["server"]["max_runtime"], config["teaser"]["server"]["default_runtime"]), """<div class="form-group">
              <a href="#section4" class="btn btn-info" role="button">Back</a> <button type="submit" class="btn btn-primary" id="submitButton" name="submitButton">Run Teaser</button>
              </div></form>""")
コード例 #8
0
    def addSectionHaplotype(self, page):
        page.addSection(
            "Data: Haplotype", """
        	This section covers key properties related to the organism that is the target of sequencing. If you do not find your desired reference sequence in the list, please download and place the uncompressed FASTA file in the <i>Teaser/references</i> directory.<br><hr>
			<div class="form-horizontal">
              <div class="form-group">
                <label for="reference" class="col-sm-2 control-label">Reference Genome</label>
                <div class="col-sm-4">
                  <select id="reference" class="form-control" name="reference">
                    """ + "\n".join(self.getReferenceOptions()) + """
                  </select>
                </div>
              </div>
			
              <div class="form-group">
                <label for="mutation_rate" class="col-sm-2 control-label">Mutation Rate</label>
                <div class="col-sm-2">
                  <input type="number" class="form-control" id="mutation_rate" name="mutation_rate" min="0" max="0.5" value="0.001" step="0.001">
                </div>
              </div>

              <div class="form-group">
                <label for="mutation_indel_frac" class="col-sm-2 control-label">Mutation Indel Fraction</label>
                <div class="col-sm-2">
                  <input type="number" class="form-control" id="mutation_indel_frac" name="mutation_indel_frac" min="0" max="1" value="0.3" step="0.001">
                </div>
              </div>

              <div class="form-group">
                <label for="mutation_indel_avg_len" class="col-sm-2 control-label">Mutation Indel Avg. Length</label>
                <div class="col-sm-2">
                  <input type="number" class="form-control" id="mutation_indel_avg_len" name="mutation_indel_avg_len" min="0" max="1000" value="1" step="1">
                </div>
              </div>


            </div>

            """, """<div class="form-group">
                <a href="#section1" class="btn btn-info" role="button">Back</a> <a href="#section3" class="btn btn-info" role="button">Next</a>  
              </div>""")
コード例 #9
0
    def addSectionDataSource(self, page, type=""):
        button_teaser = self.makeButton("simulated_teaser", type, "/define")
        button_custom = self.makeButton("simulated_custom", type,
                                        "/define-custom")
        button_real = self.makeButton("real", type, "/define-real")

        page.addSection(
            "Choose Data Source", """
			  To begin, choose the source of the NGS read data that mappers should be benchmarked for.<br><hr>
              <div class="container-fluid">
			     <div class="row-fluid" align="center">
				    <div class="col-md-4" style="border-right:2px solid grey;"><h3>New Simulation</h3> <p style="height:75px;"> Use Teaser to quickly define a simulated data set and benchmark mappers on it.</p><p>%s</p></div>
				    <div class="col-md-4" style="border-right:2px solid grey;"><h3>Existing Simulation</h2> <p style="height:75px;"> Provide a custom set of reads and gold standard alignment for benchmarking mappers.</p><p>%s</p></div>
				    <div class="col-md-4"><h3>Real Data</h3> <p style="height:75px;"> Provide real read data to benchmark mapped percentages and throughput of mappers.</p><p>%s</p></div>
			     </div>
              </div>
              <form method="post" role="form" action="submitjob" class="form-horizontal" name="mainForm" id="mainForm">
              <input type="hidden" name="type" value="%s">""" %
            (button_teaser, button_custom, button_real, type),
            """<div class="form-group"><a href="../" class="btn btn-warning" role="button">Cancel</a> <a href="#section2" class="btn btn-info" role="button">Next</a></div>"""
        )
コード例 #10
0
ファイル: server.py プロジェクト: Cibiv/Teaser
	def addSectionHaplotype(self, page):
		page.addSection("Data: Haplotype", """
        	This section covers key properties related to the organism that is the target of sequencing. If you do not find your desired reference sequence in the list, please download and place the uncompressed FASTA file in the <i>Teaser/references</i> directory.<br><hr>
			<div class="form-horizontal">
              <div class="form-group">
                <label for="reference" class="col-sm-2 control-label">Reference Genome</label>
                <div class="col-sm-4">
                  <select id="reference" class="form-control" name="reference">
                    """ + "\n".join(self.getReferenceOptions()) + """
                  </select>
                </div>
              </div>
			
              <div class="form-group">
                <label for="mutation_rate" class="col-sm-2 control-label">Mutation Rate</label>
                <div class="col-sm-2">
                  <input type="number" class="form-control" id="mutation_rate" name="mutation_rate" min="0" max="0.5" value="0.001" step="0.001">
                </div>
              </div>

              <div class="form-group">
                <label for="mutation_indel_frac" class="col-sm-2 control-label">Mutation Indel Fraction</label>
                <div class="col-sm-2">
                  <input type="number" class="form-control" id="mutation_indel_frac" name="mutation_indel_frac" min="0" max="1" value="0.3" step="0.001">
                </div>
              </div>

              <div class="form-group">
                <label for="mutation_indel_avg_len" class="col-sm-2 control-label">Mutation Indel Avg. Length</label>
                <div class="col-sm-2">
                  <input type="number" class="form-control" id="mutation_indel_avg_len" name="mutation_indel_avg_len" min="0" max="1000" value="1" step="1">
                </div>
              </div>


            </div>

            """, """<div class="form-group">
                <a href="#section1" class="btn btn-info" role="button">Back</a> <a href="#section3" class="btn btn-info" role="button">Next</a>  
              </div>""")
コード例 #11
0
ファイル: server.py プロジェクト: Cibiv/Teaser
	def addSectionEvaluation(self, page):
		mapper_options = ""
		mappers_missing_binaries=[]
		for mapper_id in sorted(config["mappers"]):
			if "title" in config["mappers"][mapper_id]:
				mapper_title = config["mappers"][mapper_id]["title"]
			else:
				mapper_title = mapper_id

			if isinstance(config["mappers"][mapper_id]["bin"], basestring):
				if not os.path.exists(config["mappers"][mapper_id]["bin"]):
					mappers_missing_binaries.append((mapper_title,config["mappers"][mapper_id]["bin"]))
					continue

			else:
				missing=False
				for path in config["mappers"][mapper_id]["bin"]:
					if not os.path.exists(path):
						mappers_missing_binaries.append((mapper_title,path))
						missing=True
						break
				if missing:
					continue

			mapper_options += """<optgroup label="%s">""" % mapper_title
			selected = "selected" if mapper_id in ["bowtie2","ngm","bwamem","bwasw","bwa"] else ""
			mapper_options += """<option value="m%s" %s>%s - Default</option>""" % (mapper_id, selected, mapper_title)

			if "parameters" in config:
				for parameter_id in sorted(config["parameters"]):
					if config["parameters"][parameter_id]["mapper"] != mapper_id:
						continue

					if "title" in config["parameters"][parameter_id]:
						param_title = config["parameters"][parameter_id]["title"]
					else:
						param_title = parameter_id
					mapper_options += """<option value="p%s">%s - %s</option>""" % (parameter_id, mapper_title, param_title)

			mapper_options += """</optgroup>"""

		missing_binaries_str=""
		if len(mappers_missing_binaries):
			missing_binaries_str="""<hr><small><b><span class="glyphicon glyphicon-warning-sign" aria-hidden="true"></span> No executable files were found for the following mappers:</b>"""
			for mapper,bin in mappers_missing_binaries:
				missing_binaries_str+="<br>%s: Need '%s'"%(mapper,bin)
			missing_binaries_str+="</small>"


		page.addSection("Evaluation", """
        	Finally, select the mappers and parameter ensembles that should be evaluated. Community-created parameter sets are available for download at: <a href="https://github.com/Cibiv/Teaser">https://github.com/Cibiv/Teaser</a>. <br><hr>
			<div class="form-horizontal">
               <div class="form-group">
                <label for="mappers" class="col-sm-2 control-label">Mappers and Parameters</label>
                <div class="col-sm-4">
                    <select class="selectpicker" name="mappers" id="mappers" data-width="100%" multiple>
                       """ + mapper_options + """
                    </select>
                </div>
              </div>
              
              <div class="form-group">
                <label for="evaluator" class="col-sm-2 control-label">Alignment Evaluation Method</label>
                <div class="col-sm-4">
                  <select id="evaluator" class="form-control" name="evaluator">
                     <option value="1" selected>Position-based using gold standard</option>
                  </select>
                </div>
              </div>
 
              <div class="form-group">
                <label for="pos_threshold" class="col-sm-2 control-label">Position threshold (bp)</label>
                <div class="col-sm-4">
                  <select id="pos_threshold" class="form-control" name="pos_threshold">
                     <option value="-1" selected>Default (50% of read length)</option>
                     <option>0</option>
                     <option>5</option>
                     <option>25</option>
                     <option>50</option>
                     <option>200</option>
                     <option>500</option>
                     <option>1000</option>
                  </select>
                </div>
              </div>

              """+ missing_binaries_str + """

            </div>
            """, """<div class="form-group">
                <a href="#section3" class="btn btn-info" role="button">Back</a> <button type="submit" class="btn btn-primary" id="submitButton" name="submitButton">Run Teaser</button> <a href="#section5" class="btn btn-info" role="button">Advanced Options</a>
              </div>""")

		page.addScript("""window.onload = function () {$('.selectpicker').selectpicker();}""")
コード例 #12
0
ファイル: server.py プロジェクト: Cibiv/Teaser
	def addSectionSequencing(self, page):
		page.addSection("Data: Sequencing", """
        	This section covers properties related to basic library preparation and sequencing.<br><hr>
        	<div class="form-horizontal">
              <div class="form-group">
                <label for="platform" class="col-sm-2 control-label">Sequencing Platform</label>
                <div class="col-sm-4">
                  <select id="platform" name="platform" class="form-control">
                    <option value="illumina">Illumina</option>
                    <option value="454">454</option>
                    <option value="ion_torrent">Ion Torrent</option>
                  </select>
                </div>
              </div>

              <div class="form-group">
                <label for="read_length" class="col-sm-2 control-label">Read Length</label>
                <div class="col-sm-2">
                  <input type="number" class="form-control" id="read_length" name="read_length" size="1" min="22" max="10000" step="1" value="60">
                </div>
              </div>

              <div class="form-group">
                <label for="error_rate_mult" class="col-sm-2 control-label">Sequencing Error Multiplier</label>
                <div class="col-sm-2">
                  <input type="number" class="form-control" id="error_rate_mult" name="error_rate_mult" min="0" max="1000" step="0.01" value="1">
                </div>
              </div>

              <div class="form-group">
              <label class="col-sm-2 control-label">
              Library Type
              </label>
              <div class="radio">
                <label>
                  <input type="radio" name="paired" id="optionsRadios1" value="false" onClick="javascript:$('#insert_size').prop('disabled',true); $('#insert_size_error').prop('disabled',true);" checked>
                  Single-End
                </label>
                <label>
                  <input type="radio" name="paired" id="optionsRadios2" value="true" onClick="javascript:$('#insert_size').prop('disabled',false); $('#insert_size_error').prop('disabled',false);">
                  Paired-End
                </label>
              </div>
              </div>

              <div class="form-group">
                <label for="insert_size" class="col-sm-2 control-label">Insert Size</label>
                <div class="col-sm-2">
                  <input type="number" class="form-control" id="insert_size" name="insert_size" min="0" max="1000" step="1" value="100" disabled>
                </div>
              </div>

              <div class="form-group">
                <label for="insert_size_error" class="col-sm-2 control-label">Insert Size Error</label>
                <div class="col-sm-2">
                  <input type="number" class="form-control" id="insert_size_error" name="insert_size_error" min="0" max="1000" step="1" value="50" disabled>
                </div>
              </div>

            </div>
            """, """<div class="form-group">
                <a href="#section2" class="btn btn-info" role="button">Back</a> <a href="#section4" class="btn btn-info" role="button">Next</a>
              </div>""")
コード例 #13
0
ファイル: server.py プロジェクト: Cibiv/Teaser
	def get(self):
		instance.pollJobs()

		page = Page()

		page.setFooter("Copyright &copy; 2015, CIBIV.")

		page.addSection("Home", """

    <div class="jumbotron" style="border-radius:10px;">
      <div class="container">
        <h1>Teaser</h1>
        <p>A tool for fast personalized benchmarks and optimization of NGS read mapping.</p>
        <p><a href="define" class="btn btn-success" role="button"><span class="glyphicon glyphicon-arrow-right" aria-hidden="true"></span> Start a mapper benchmark now</a> <a href="static/dataset_gallery" class="btn btn-info" role="button">View Example Report</a> <a href="http://github.com/cibiv/teaser/" class="btn btn-info" role="button">Wiki and Download</a></p>
      </div>
    </div>

        <div class="container-fluid">
			<div class="row-fluid" align="center">
				<div class="col-md-3"><h2>Find</h2> <p>...a suitable mapper for your next-gen sequencing data in minutes</p></div>
				<div class="col-md-3"><h2>Identify</h2> <p>...the right mapping quality thresholds for filtering</p></div>
				<div class="col-md-3"><h2>Optimize</h2> <p>...mapper parameters for accuracy or throughput</p></div>
				<div class="col-md-3"><h2>Compare</h2> <p>...simulation and real data results</p></div>
			</div>
        </div>
		<br>
		""", "", "", False)

		page.addStyle("""
div.featurebox
{
padding:10px;
background-color:#CCCCCC;
margin-left:10px;
margin-right:10px;
margin-top:10px;
margin-bottom:10px;
border:solid 1px black;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
		""")

		page.addNav([{"title": "View on GitHub", "link": "https://github.com/Cibiv/Teaser"}])
		page.addNav([{"title": "Wiki", "link": "https://github.com/Cibiv/Teaser/wiki"}])
		page.addNav([{"title": "|", "link": "#"}])
		page.addNav([{"title": "CIBIV", "link": "http://www.cibiv.at"}])
		page.addNav([{"title": "CSHL", "link": "http://www.cshl.edu"}])

		page.enableNavSeparators(False)
		page.enableSidebar(False)

		recent_html = ""
		recent_configs = []
		for rid in os.listdir("reports"):
			if not os.path.isdir("reports/%s" % rid):
				continue

			report_config_filename = "reports/%s/config.yaml" % rid
			try:
				report_config = yaml.load(open(report_config_filename, "r"))
				recent_configs.append(report_config)
			except Exception as e:
				#print("Failed to load report config from %s: %s"%(report_config_filename,str(e)))
				pass

		max_i = 10
		i = 0
		for config_ in sorted(recent_configs, key=lambda k: k["meta_timestamp"], reverse=True):
			test_name = list(config_["teaser"]["tests"].keys())[0]
			test_config = config_["teaser"]["tests"][test_name]
			reference_name, reference_ext = os.path.splitext(test_config["reference"])

			if not "type" in test_config or test_config["type"] == "simulated_teaser":
				recent_html += "<tr><td><a href=\"reports/%s\">%s</a></td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>" % (test_name, test_name, reference_name, datetime.datetime.fromtimestamp(int(config_["meta_timestamp"])).strftime('%Y-%m-%d %H:%M:%S'), str(test_config["platform"]), "paired-end" if test_config["paired"] else "single-end", str(test_config["read_length"]))
			else:
				recent_html += "<tr><td><a href=\"reports/%s\">%s</a></td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>" % (test_name, test_name, reference_name, datetime.datetime.fromtimestamp(int(config_["meta_timestamp"])).strftime('%Y-%m-%d %H:%M:%S'), "Unknown", "paired-end" if test_config["paired"] else "single-end", "Unknown")
			i += 1
			if i >= max_i:
				break

		if i==0:
			recent_html = "<tr><td colspan=6><i>No benchmarks were performed yet.</i></td></tr>"

		page.addSection("Summary", "Teaser analyzes the performance of read mappers based on a data set provided by you. After you enter key characteristics such as read length and reference genome, Teaser will simulate read data including the gold standard alignment. After the simulation, Teaser automatically runs and evaluates each mapper for the selected parameters and summarizes the results in a report. Teaser also supports benchmarking mappers on real data or custom simulations, as well as testing new mappers and custom parameter sets. You can start using Teaser right now using this web application, or download and install it to unlock all advanced features.<br><br><b>If you use Teaser to optimize read mapping in your study, please cite:</b> Smolka M, Rescheneder P, Schatz MC, von Haeseler A and Sedlazeck FJ. Teaser: Individualized benchmarking and optimization of read mapping results for NGS data. Genome Biology 2015, 16:235 (22 October 2015). DOI: 10.1186/s13059-015-0803-1")

		if config["teaser"]["server"]["news"] != "":
			page.addSection("Update News", config["teaser"]["server"]["news"])

		page.addSection("Recent Benchmarks", """
		<div class="table-responsive"><table class=table table-striped">
		<thead>
		<tr>
		<th>Teaser Accession</th>
		<th>Organism</th>
		<th>Date</th>
		<th>Platform</th>
		<th>Library</th>
		<th>Read Length</th>
		</tr>
		</thead>
		<tbody>
		%s
		</tbody>
		</table>
		</div>
		""" % recent_html)


		if config["teaser"]["server"]["send_usage_information"]:
			page.addScript("""
	  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
	  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
	  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
	  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

	  ga('create', 'UA-66386566-1', 'auto');
	  ga('send', 'pageview');""")

		self.write(page.html())
コード例 #14
0
    def addSectionEvaluation(self, page):
        mapper_options = ""
        mappers_missing_binaries = []
        for mapper_id in sorted(config["mappers"]):
            if "title" in config["mappers"][mapper_id]:
                mapper_title = config["mappers"][mapper_id]["title"]
            else:
                mapper_title = mapper_id

            if isinstance(config["mappers"][mapper_id]["bin"], basestring):
                if not os.path.exists(config["mappers"][mapper_id]["bin"]):
                    mappers_missing_binaries.append(
                        (mapper_title, config["mappers"][mapper_id]["bin"]))
                    continue

            else:
                missing = False
                for path in config["mappers"][mapper_id]["bin"]:
                    if not os.path.exists(path):
                        mappers_missing_binaries.append((mapper_title, path))
                        missing = True
                        break
                if missing:
                    continue

            mapper_options += """<optgroup label="%s">""" % mapper_title
            selected = "selected" if mapper_id in [
                "bowtie2", "ngm", "bwamem", "bwasw", "bwa"
            ] else ""
            mapper_options += """<option value="m%s" %s>%s - Default</option>""" % (
                mapper_id, selected, mapper_title)

            if "parameters" in config:
                for parameter_id in sorted(config["parameters"]):
                    if config["parameters"][parameter_id][
                            "mapper"] != mapper_id:
                        continue

                    if "title" in config["parameters"][parameter_id]:
                        param_title = config["parameters"][parameter_id][
                            "title"]
                    else:
                        param_title = parameter_id
                    mapper_options += """<option value="p%s">%s - %s</option>""" % (
                        parameter_id, mapper_title, param_title)

            mapper_options += """</optgroup>"""

        missing_binaries_str = ""
        if len(mappers_missing_binaries):
            missing_binaries_str = """<hr><small><b><span class="glyphicon glyphicon-warning-sign" aria-hidden="true"></span> No executable files were found for the following mappers:</b>"""
            for mapper, bin in mappers_missing_binaries:
                missing_binaries_str += "<br>%s: Need '%s'" % (mapper, bin)
            missing_binaries_str += "</small>"

        page.addSection(
            "Evaluation", """
        	Finally, select the mappers and parameter ensembles that should be evaluated. Community-created parameter sets are available for download at: <a href="https://github.com/Cibiv/Teaser">https://github.com/Cibiv/Teaser</a>. <br><hr>
			<div class="form-horizontal">
               <div class="form-group">
                <label for="mappers" class="col-sm-2 control-label">Mappers and Parameters</label>
                <div class="col-sm-4">
                    <select class="selectpicker" name="mappers" id="mappers" data-width="100%" multiple>
                       """ + mapper_options + """
                    </select>
                </div>
              </div>
              
              <div class="form-group">
                <label for="evaluator" class="col-sm-2 control-label">Alignment Evaluation Method</label>
                <div class="col-sm-4">
                  <select id="evaluator" class="form-control" name="evaluator">
                     <option value="1" selected>Position-based using gold standard</option>
                  </select>
                </div>
              </div>
 
              <div class="form-group">
                <label for="pos_threshold" class="col-sm-2 control-label">Position threshold (bp)</label>
                <div class="col-sm-4">
                  <select id="pos_threshold" class="form-control" name="pos_threshold">
                     <option value="-1" selected>Default (50% of read length)</option>
                     <option>0</option>
                     <option>5</option>
                     <option>25</option>
                     <option>50</option>
                     <option>200</option>
                     <option>500</option>
                     <option>1000</option>
                  </select>
                </div>
              </div>

              """ + missing_binaries_str + """

            </div>
            """, """<div class="form-group">
                <a href="#section3" class="btn btn-info" role="button">Back</a> <button type="submit" class="btn btn-primary" id="submitButton" name="submitButton">Run Teaser</button> <a href="#section5" class="btn btn-info" role="button">Advanced Options</a>
              </div>""")

        page.addScript(
            """window.onload = function () {$('.selectpicker').selectpicker();}"""
        )
コード例 #15
0
    def addSectionSequencing(self, page):
        page.addSection(
            "Data: Sequencing", """
        	This section covers properties related to basic library preparation and sequencing.<br><hr>
        	<div class="form-horizontal">
              <div class="form-group">
                <label for="platform" class="col-sm-2 control-label">Sequencing Platform</label>
                <div class="col-sm-4">
                  <select id="platform" name="platform" class="form-control">
                    <option value="illumina">Illumina</option>
                    <option value="454">454</option>
                    <option value="ion_torrent">Ion Torrent</option>
                  </select>
                </div>
              </div>

              <div class="form-group">
                <label for="read_length" class="col-sm-2 control-label">Read Length</label>
                <div class="col-sm-2">
                  <input type="number" class="form-control" id="read_length" name="read_length" size="1" min="22" max="10000" step="1" value="60">
                </div>
              </div>

              <div class="form-group">
                <label for="error_rate_mult" class="col-sm-2 control-label">Sequencing Error Multiplier</label>
                <div class="col-sm-2">
                  <input type="number" class="form-control" id="error_rate_mult" name="error_rate_mult" min="0" max="1000" step="0.01" value="1">
                </div>
              </div>

              <div class="form-group">
              <label class="col-sm-2 control-label">
              Library Type
              </label>
              <div class="radio">
                <label>
                  <input type="radio" name="paired" id="optionsRadios1" value="false" onClick="javascript:$('#insert_size').prop('disabled',true); $('#insert_size_error').prop('disabled',true);" checked>
                  Single-End
                </label>
                <label>
                  <input type="radio" name="paired" id="optionsRadios2" value="true" onClick="javascript:$('#insert_size').prop('disabled',false); $('#insert_size_error').prop('disabled',false);">
                  Paired-End
                </label>
              </div>
              </div>

              <div class="form-group">
                <label for="insert_size" class="col-sm-2 control-label">Insert Size</label>
                <div class="col-sm-2">
                  <input type="number" class="form-control" id="insert_size" name="insert_size" min="0" max="1000" step="1" value="100" disabled>
                </div>
              </div>

              <div class="form-group">
                <label for="insert_size_error" class="col-sm-2 control-label">Insert Size Error</label>
                <div class="col-sm-2">
                  <input type="number" class="form-control" id="insert_size_error" name="insert_size_error" min="0" max="1000" step="1" value="50" disabled>
                </div>
              </div>

            </div>
            """, """<div class="form-group">
                <a href="#section2" class="btn btn-info" role="button">Back</a> <a href="#section4" class="btn btn-info" role="button">Next</a>
              </div>""")
コード例 #16
0
ファイル: report.py プロジェクト: mshakya/Teaser
    def generateOverviewPlot(self, page, measure):
        format_func = "function(y){return y;}"
        min = 0
        title_section = ""
        if measure == "correct":
            title = "Correctly Mapped Reads [%]"
            title_section = "Correctly Mapped Reads"
            format_func = "function(y){return Math.round(100000*y)/100000 + \"%\";}"
        elif measure == "corrects":
            title = "Correctly Mapped Reads [Reads/s]"
            title_section = "Correct/s"
            format_func = "function(y){return Math.round(1000*y)/1000;}"
        elif measure == "precision":
            title = "Precision"
            format_func = "function(y){return Math.round(10000*y)/10000;}"
            # min = 0.75
        elif measure == "recall":
            title = "Recall"
            format_func = "function(y){return Math.round(10000*y)/10000;}"
            # min = 0.75
        elif measure == "fmeasure":
            title = "F-Measure"
            format_func = "function(y){return Math.round(10000*y)/10000;}"
            # min = 0.75

        if title_section == "":
            title_section = title

        import json

        data = []
        titles = []
        for mapper in sorted(self.mate.getMappers()):
            column = []
            for test_name in self.mate.getTestNameList():
                test = self.mate.getTestByMapperName(test_name, mapper)
                if test == None or test._("base") != "tests_base/base_mapping":
                    continue

                if len(column) == 0:
                    column.append(test.getMapper().getTitle())

                if test.getRunResults() == None or test.getErrorCount():
                    column.append(0)
                    continue

                if measure == "correct":
                    try:
                        value = test.getRunResults().correct / float(
                            test.getRunResults().total)
                        value = value * 100
                    except ZeroDivisionError:
                        value = 0

                elif measure == "corrects":
                    try:
                        value = test.getRunResults().correct / float(
                            test.getRunResults().maptime)
                    except ZeroDivisionError:
                        value = 0

                elif measure == "precision":
                    value = test.getRunResults().precision
                elif measure == "recall":
                    value = test.getRunResults().recall
                elif measure == "fmeasure":
                    value = test.getRunResults().fmeasure
                value = round(value, 4)
                column.append(value)

            if len(column):
                data.append(column)

        if min != 0:
            min_str = ",min: %f" % min
        else:
            min_str = ""

        titles = []
        for name in self.mate.getTestNameList():
            tests = self.mate.getTestsByName(name)
            if len(tests) != 0 and tests[0]._(
                    "base") == "tests_base/base_mapping":
                titles.append(tests[0].getTitle())
        # titles=["0%","75%","90%","95%","99%"]
        page.addSection(
            "Results: %s" % title_section, """<div id="plot_%s"></div>%s""" %
            (measure, util.makeExportDropdown("plot_%s" % measure, "")))
        page.addScript("""
var chart_%s = c3.generate({
    bindto: '#plot_%s',
    size: {
      height: 400
    },
    data: {
      columns: %s,
      type: "bar"
    },
    grid: {
      y: {
        show: true
      }
    },
    axis: {
      x: {
        type: "category",
        categories: %s,
        label:
        {
              text: "Data Set",
              position: "outer-middle"
        }
      },

      y: {
        label:
        {
              text: "%s",
              position: "outer-middle"
        },
        tick: { format: %s }
        %s
      }
    },
    legend: {
    	position: "right"
    }
});""" % (measure, measure, json.dumps(data), json.dumps(titles), title,
          format_func, min_str))
コード例 #17
0
    def get(self):
        instance.pollJobs()

        page = Page()

        page.setFooter("Copyright &copy; 2015, CIBIV.")

        page.addSection(
            "Home", """

    <div class="jumbotron" style="border-radius:10px;">
      <div class="container">
        <h1>Teaser</h1>
        <p>A tool for fast personalized benchmarks and optimization of NGS read mapping.</p>
        <p><a href="define" class="btn btn-success" role="button"><span class="glyphicon glyphicon-arrow-right" aria-hidden="true"></span> Start a mapper benchmark now</a> <a href="static/dataset_gallery" class="btn btn-info" role="button">View Example Report</a> <a href="http://github.com/cibiv/teaser/" class="btn btn-info" role="button">Wiki and Download</a></p>
      </div>
    </div>

        <div class="container-fluid">
			<div class="row-fluid" align="center">
				<div class="col-md-3"><h2>Find</h2> <p>...a suitable mapper for your next-gen sequencing data in minutes</p></div>
				<div class="col-md-3"><h2>Identify</h2> <p>...the right mapping quality thresholds for filtering</p></div>
				<div class="col-md-3"><h2>Optimize</h2> <p>...mapper parameters for accuracy or throughput</p></div>
				<div class="col-md-3"><h2>Compare</h2> <p>...simulation and real data results</p></div>
			</div>
        </div>
		<br>
		""", "", "", False)

        page.addStyle("""
div.featurebox
{
padding:10px;
background-color:#CCCCCC;
margin-left:10px;
margin-right:10px;
margin-top:10px;
margin-bottom:10px;
border:solid 1px black;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
		""")

        page.addNav([{
            "title": "View on GitHub",
            "link": "https://github.com/Cibiv/Teaser"
        }])
        page.addNav([{
            "title": "Wiki",
            "link": "https://github.com/Cibiv/Teaser/wiki"
        }])
        page.addNav([{"title": "|", "link": "#"}])
        page.addNav([{"title": "CIBIV", "link": "http://www.cibiv.at"}])
        page.addNav([{"title": "CSHL", "link": "http://www.cshl.edu"}])

        page.enableNavSeparators(False)
        page.enableSidebar(False)

        recent_html = ""
        recent_configs = []
        for rid in os.listdir("reports"):
            if not os.path.isdir("reports/%s" % rid):
                continue

            report_config_filename = "reports/%s/config.yaml" % rid
            try:
                report_config = yaml.load(open(report_config_filename, "r"))
                recent_configs.append(report_config)
            except Exception as e:
                #print("Failed to load report config from %s: %s"%(report_config_filename,str(e)))
                pass

        max_i = 10
        i = 0
        for config_ in sorted(recent_configs,
                              key=lambda k: k["meta_timestamp"],
                              reverse=True):
            test_name = list(config_["teaser"]["tests"].keys())[0]
            test_config = config_["teaser"]["tests"][test_name]
            reference_name, reference_ext = os.path.splitext(
                test_config["reference"])

            if not "type" in test_config or test_config[
                    "type"] == "simulated_teaser":
                recent_html += "<tr><td><a href=\"reports/%s\">%s</a></td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>" % (
                    test_name, test_name, reference_name,
                    datetime.datetime.fromtimestamp(
                        int(config_["meta_timestamp"])).strftime(
                            '%Y-%m-%d %H:%M:%S'), str(test_config["platform"]),
                    "paired-end" if test_config["paired"] else "single-end",
                    str(test_config["read_length"]))
            else:
                recent_html += "<tr><td><a href=\"reports/%s\">%s</a></td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>" % (
                    test_name, test_name, reference_name,
                    datetime.datetime.fromtimestamp(
                        int(config_["meta_timestamp"])).strftime(
                            '%Y-%m-%d %H:%M:%S'), "Unknown", "paired-end"
                    if test_config["paired"] else "single-end", "Unknown")
            i += 1
            if i >= max_i:
                break

        if i == 0:
            recent_html = "<tr><td colspan=6><i>No benchmarks were performed yet.</i></td></tr>"

        page.addSection(
            "Summary",
            "Teaser analyzes the performance of read mappers based on a data set provided by you. After you enter key characteristics such as read length and reference genome, Teaser will simulate read data including the gold standard alignment. After the simulation, Teaser automatically runs and evaluates each mapper for the selected parameters and summarizes the results in a report. Teaser also supports benchmarking mappers on real data or custom simulations, as well as testing new mappers and custom parameter sets. You can start using Teaser right now using this web application, or download and install it to unlock all advanced features.<br><br><b>If you use Teaser to optimize read mapping in your study, please cite:</b> Smolka M, Rescheneder P, Schatz MC, von Haeseler A and Sedlazeck FJ. Teaser: Individualized benchmarking and optimization of read mapping results for NGS data. Genome Biology 2015, 16:235 (22 October 2015). DOI: 10.1186/s13059-015-0803-1"
        )

        if config["teaser"]["server"]["news"] != "":
            page.addSection("Update News", config["teaser"]["server"]["news"])

        page.addSection(
            "Recent Benchmarks", """
		<div class="table-responsive"><table class=table table-striped">
		<thead>
		<tr>
		<th>Teaser Accession</th>
		<th>Organism</th>
		<th>Date</th>
		<th>Platform</th>
		<th>Library</th>
		<th>Read Length</th>
		</tr>
		</thead>
		<tbody>
		%s
		</tbody>
		</table>
		</div>
		""" % recent_html)

        if config["teaser"]["server"]["send_usage_information"]:
            page.addScript("""
	  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
	  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
	  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
	  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

	  ga('create', 'UA-66386566-1', 'auto');
	  ga('send', 'pageview');""")

        self.write(page.html())