def createDefaults(self, file=None): if file is None: p = Parameters() else: p = Parameters(file) self.gtfFileTextBox.setText(p.gtfFile) self.refGenomeTextBox.setText(p.refGenome) self.dbsnpTextBox.setText(p.dbsnp) self.hapmapTextBox.setText(p.hapmap) self.omniTextBox.setText(p.omni) self.espTextBox.setText(p.esp) self.aluRegionsTextBox.setText(p.aluRegions) self.outputTextBox.setText(p.output) self.sourceDirTextBox.setText(p.sourceDir) self.threadsSpinBox.setValue(int(p.threads)) self.maxDiffSpinBox.setValue(float(p.maxDiff)) self.seedSpinBox.setValue(float(p.seedDiff)) self.standCallSpinBox.setValue(int(p.standCall)) self.standEmitSpinBox.setValue(int(p.standEmit)) self.intronDistanceSpinBox.setValue(int(p.intronDistance)) self.minPtsSpinBox.setValue(int(p.minPts)) self.epsSpinBox.setValue(int(p.eps)) self.pairedCheckBox.setChecked(p.paired) self.keepTempCheckBox.setChecked(p.keepTemp) self.overwriteCheckBox.setChecked(p.overwrite)
Helper.info("\t overwrite:" + str(self.params.overwrite), self.logFile) Helper.info("", self.logFile) if __name__ == '__main__': if len(sys.argv) > 1: parser = argparse.ArgumentParser( prog = 'RnaEditor', formatter_class=argparse.RawDescriptionHelpFormatter, description=textwrap.dedent('''\ RnaEditor: easily detect editing sites from deep sequencing data' ---------------------------------------------------------------- run without arguments to start the user interface. ''')) parser.add_argument('-i', '--input', metavar='Fastq-Files',nargs='+', type=str, help='Input fastq files (maximum two for paired-end sequencing)', required=True) parser.add_argument('-c', '--conf', metavar='Configuration File', type=str, help='Configuration File used to read Parameters for RnaEditor', required=True, default='configuration.txt') args = parser.parse_args() parameters = Parameters(args.conf) edit=RnaEdit(args.input,parameters,0) edit.start() edit.wait() del edit else: pass
def newAssay(self): """ Function wich starts a new analysis """ global assay inputTab = self.view.tabMainWindow.widget(0) # get Parameters parameters = Parameters(inputTab) if parameters.paired: # fastqs=inputTab.dropList.dropFirstTwoItems() fastqs = inputTab.dropList.dropFirstItem() if fastqs[0] is not None: if not str(fastqs[0].text()).endswith(".bam"): fastqs += inputTab.dropList.dropFirstItem() else: fastqs = inputTab.dropList.dropFirstItem() """ check if droplist returned a value """ if parameters.paired: if fastqs[-1] is None: QtGui.QMessageBox.information( self.view, "Warning", "Warning:\nNot enough Sequencing Files for paired-end sequencing!!!\n\nDrop FASTQ-Files to the drop area!" ) return if fastqs[0] is None: QtGui.QMessageBox.information( self.view, "Warning", "Warning:\nNo Sequencing Files found!!!\n\nDrop FASTQ-Files to the drop area!" ) return sampleName = Helper.getSampleName(str(fastqs[0].text())) if sampleName is None: QtGui.QMessageBox.information( self.view, "Warning", "Warning:\nNo valid Sequencing File!!!\n\nDrop FASTQ-Files to the drop area!" ) return fastqFiles = [] for fastq in fastqs: fastqFiles.append(str(fastq.text())) runTab = RunTab(self) # initialize new Thread with new assay try: assay = RnaEdit(fastqFiles, parameters, runTab.commandBox) except Exception as err: QtGui.QMessageBox.information(self.view, "Error", str(err) + "Cannot start Analysis!") Helper.error(str(err) + "\n creating rnaEditor Object Failed!", textField=runTab.commandBox) currentIndex = self.view.tabMainWindow.count() # self.view.tabMainWindow.addTab(self.runTab, "Analysis"+ str(Helper.assayCount)) self.view.tabMainWindow.addTab(runTab, sampleName + " " + str(currentIndex)) Helper.runningThreads.append(assay) assay.start() self.view.connect(assay, QtCore.SIGNAL("taskDone"), self.openAnalysis)