def fromGUI(self, wxobj): """ """ # Get Annotation file annotationPath = wxobj.annotation if not transit_tools.validate_annotation(annotationPath): return None # Get selected files ctrldata = wxobj.ctrlSelected() if not transit_tools.validate_control_datasets(ctrldata): return None # Validate transposon types types = tnseq_tools.get_file_types(ctrldata) if "himar1" in types: answer = transit_tools.ShowAskWarning( "Warning: One of the selected wig files looks like a Himar1 dataset. This method is designed to work on Tn5 wig files. Proceeding will fill in missing data with zeroes. Click OK to continue." ) if answer == wx.ID_CANCEL: return None # Read the parameters from the wxPython widgets ignoreCodon = True minread = int( wxobj.tn5GapsReadChoice.GetString( wxobj.tn5GapsReadChoice.GetCurrentSelection())) NTerminus = float(wxobj.globalNTerminusText.GetValue()) CTerminus = float(wxobj.globalCTerminusText.GetValue()) replicates = wxobj.tn5GapsRepChoice.GetString( wxobj.tn5GapsRepChoice.GetCurrentSelection()) normalization = None LOESS = False # Get output path name = transit_tools.basename(ctrldata[0]) defaultFileName = "tn5_gaps_output_m%d_r%s.dat" % (minread, replicates) defaultDir = os.getcwd() output_path = wxobj.SaveFile(defaultDir, defaultFileName) if not output_path: return None output_file = open(output_path, "w") return self( ctrldata, annotationPath, output_file, replicates, normalization, LOESS, ignoreCodon, minread, NTerminus, CTerminus, wxobj, )
def fromGUI(self, wxobj): """ """ #Get Annotation file annotationPath = wxobj.annotation if not transit_tools.validate_annotation(annotationPath): return None #Get selected files ctrldata = wxobj.ctrlSelected() if not transit_tools.validate_control_datasets(ctrldata): return None #Validate transposon types types = tnseq_tools.get_file_types(ctrldata) if 'himar1' in types: answer = transit_tools.ShowAskWarning("Warning: One of the selected wig files looks like a Himar1 dataset. This method is designed to work on Tn5 wig files. Proceeding will fill in missing data with zeroes. Click OK to continue.") if answer == wx.ID_CANCEL: return None #Read the parameters from the wxPython widgets ignoreCodon = True minread = int(wxobj.tn5GapsReadChoice.GetString(wxobj.tn5GapsReadChoice.GetCurrentSelection())) NTerminus = float(wxobj.globalNTerminusText.GetValue()) CTerminus = float(wxobj.globalCTerminusText.GetValue()) replicates= wxobj.tn5GapsRepChoice.GetString(wxobj.tn5GapsRepChoice.GetCurrentSelection()) normalization = None LOESS = False #Get output path name = transit_tools.basename(ctrldata[0]) defaultFileName = "tn5_gaps_output_m%d_r%s.dat" % (minread, replicates) defaultDir = os.getcwd() output_path = wxobj.SaveFile(defaultDir, defaultFileName) if not output_path: return None output_file = open(output_path, "w") return self(ctrldata, annotationPath, output_file, replicates, normalization, LOESS, ignoreCodon, minread, NTerminus, CTerminus, wxobj)
def test_file_types(self): types = tnseq_tools.get_file_types(all_data_list) types = set(types) self.assertEqual(len(types), 1) self.assertTrue("himar1" in types)
def test_file_types(self): types = tnseq_tools.get_file_types(all_data_list) types = set(types) self.assertEqual(len(types), 1) self.assertTrue("himar1" in types)