Example #1
0
 def __init__(self, folder, directory, gene_list_file, *args):
     super(Read_Depth_Gui, self).__init__(*args)
     self.setupUi(self)
     self.input_folder = folder
     self.interval = 100
     self.interval_spin.setValue(100)
     self.allowed_mismatches = 1
     self.directory = directory
     self.gene_list_file = gene_list_file
     self.fileio = f.fileio()
     self.list_of_reads = []
     self.plot = plot.RDPlot("Base Pair", "# Hits")
     self.selected_accession_number_name = ''
     self.selected_gene = {}
     self.dataset_name = '-- Select --'
     self.gene_list = OrderedDict()
     self.datasets_cache = OrderedDict()
     self.accession_numbers_list = QtCore.QStringList()
     self._initialize_ui_elements()
     self.process = process.process()
     self.read_list_thread = GetReadList_Thread(self.directory, self.input_folder, self.dataset_name,
                                                self.selected_gene, self)
     self.connect(self.read_list_thread, QtCore.SIGNAL("GeneListFinished"), self.dataset_loaded)
     self.calculate_depth_thread = CalculateDepth_Thread(self)
     self.connect(self.calculate_depth_thread, QtCore.SIGNAL("CalculateDepthFinished"), self.load_table_w_data)
Example #2
0
 def __init__(self, folder, directory, gene_list_file, *args):
     super(Read_Depth_Gui, self).__init__(*args)
     self.setupUi(self)
     self.input_folder = folder
     self.interval = 100
     self.interval_spin.setValue(100)
     self.allowed_mismatches = 1
     self.directory = directory
     self.gene_list_file = gene_list_file
     self.fileio = f.fileio()
     self.list_of_reads = []
     self.plot = plot.RDPlot("Base Pair", "# Hits")
     self.selected_accession_number_name = ''
     self.selected_gene = {}
     self.dataset_name = '-- Select --'
     self.gene_list = OrderedDict()
     self.datasets_cache = OrderedDict()
     self.accession_numbers_list = QtCore.QStringList()
     self._initialize_ui_elements()
     self.process = process.process()
     self.read_list_thread = GetReadList_Thread(self.directory,
                                                self.input_folder,
                                                self.dataset_name,
                                                self.selected_gene, self)
     self.connect(self.read_list_thread, QtCore.SIGNAL("GeneListFinished"),
                  self.dataset_loaded)
     self.calculate_depth_thread = CalculateDepth_Thread(self)
     self.connect(self.calculate_depth_thread,
                  QtCore.SIGNAL("CalculateDepthFinished"),
                  self.load_table_w_data)
Example #3
0
    def __init__(self, folder, directory, list_file, *args):
        super(Query_Blast_Gui, self).__init__(*args)
        self.setupUi(self)
        self.clipboard = ""
        self.input_folder = folder
        self.directory = directory
        self.list_file = list_file
        self.updating = False
        self.fileio = f.fileio()
        # Selections from GUI
        self.selected_gene_name = ''
        self.selected_accession_number = ''
        self.selected_dataset_names = [
            '-- Select --', '-- Select --', '-- Select --'
        ]
        # Generic Table Names
        self.table = None
        self.table_filtered = None
        # Cache for storing data
        self.gene_info_list = OrderedDict()
        self.accession_number_list = OrderedDict()
        self.datasets_cache = OrderedDict()
        self.sequences_info_list = {}
        # Methods
        self._initialize_ui_elements()
        # Results Store
        self.results = [[], [], []]
        self.filtered_results = [[], [], []]

        self.graph1 = plot.QBPlot('Base Pair', 'Junction Count (ppm)')
        self.tabWidget_1.addTab(self.graph1, "Plot")
        self.graph1.initialize_plot()

        self.graph2 = plot.QBPlot('Base Pair', 'Junction Count (ppm)')
        self.tabWidget_2.addTab(self.graph2, "Plot")
        self.graph2.initialize_plot()

        self.graph3 = plot.QBPlot('Base Pair', 'Junction Count (ppm)')
        self.tabWidget_3.addTab(self.graph3, "Plot")
        self.graph3.initialize_plot()
Example #4
0
    def __init__(self, folder, directory, gene_list_file, *args):
        super(Query_Blast_Gui, self).__init__(*args)
        self.setupUi(self)
        self.input_folder = folder
        self.directory = directory
        self.gene_list_file = gene_list_file

        self.fileio = f.fileio()
        # Selections from GUI
        self.selected_accession_number_name = ''
        self.selected_dataset_names = ['-- Select --', '-- Select --', '-- Select --']
        # Generic Table Names
        self.table = None
        self.table_filtered = None
        # Cache for storing data
        self.selected_gene = {}
        self.gene_information = OrderedDict()
        self.datasets_cache = OrderedDict()
        self.accession_numbers_list = QtCore.QStringList()
        # Methods
        self._initialize_ui_elements()
        # Results Store
        self.results = [[], [], []]
        self.filtered_results = [[], [], []]

        self.graph1 = plot.QBPlot('Base Pair', 'Junction Count (ppm)')
        self.tabWidget_1.addTab(self.graph1, "Plot")
        self.graph1.initialize_plot()

        self.graph2 = plot.QBPlot('Base Pair', 'Junction Count (ppm)')
        self.tabWidget_2.addTab(self.graph2, "Plot")
        self.graph2.initialize_plot()

        self.graph3 = plot.QBPlot('Base Pair', 'Junction Count (ppm)')
        self.tabWidget_3.addTab(self.graph3, "Plot")
        self.graph3.initialize_plot()
Example #5
0
    print ">>> Using %d Processor Cores" % (num_cores - 1)
    _spin = spinbar.SpinCursor(msg="Processing mapped .sam files ...", speed=2)
    _spin.start()
    Parallel.Parallel(n_jobs=num_cores-1)(Parallel.delayed(letsCount)(directory, summary_folder, chromosomes_folder,
                                                                      input_folder, chromosomes_list, f) for f in
                                                                      sam_file_list)
    _spin.stop()


def initialize_folders(directory):
    # Creates the folder that will hold the Genecounts summaries
    fileio.create_new_folder(directory, summary_folder)
    # Creates the folder that will hold more granualar data on exon counts per chromosome
    fileio.create_new_folder(directory, chromosomes_folder)
    fileio.create_new_folder(directory, "gene_count_indices")

if __name__ == '__main__':
    # Instantiate Function Objects for Basic Input Output
    printio = p.printio()
    fileio = f.fileio()

    sys.stdout.write("\n*** Running Gene Count Y2H ***\n\n")
    sys.stdout.flush()

    initialize_folders(main_directory)
    # Makes sure proper files are in their place and returns .sam file list
    sam_file_list = fileio.get_sam_filelist(main_directory, input_folder)
    # Gets list of chromosomes from Y2Hreadme.txt file
    chromosomes_list = fileio.get_chromosomes_list(main_directory, chromosomes_list_name, printio)
    gene_count(main_directory, summary_folder, chromosomes_folder, input_folder, chromosomes_list, sam_file_list)
Example #6
0
import os
Example #7
0
    def __init__(self, *args):
        super(DEEPN_Launcher, self).__init__(*args)
        self.setupUi(self)
        self.proceed = 1
        self.prompt = 2
        self.fileio = f.fileio()
        self.printio = p.printio()
        self.directory = None
        self.clicked_button = None
        self.clicked_button_text = None
        self.db_selection = None
        self.combined = 0
        self.blast_db_name = ''
        self.gene_dictionary = ''
        self.gene_list_file = ''
        self.chromosome_list = ''
        self.start_match = re.compile(r'^[>>>|\t|***]')
        self.bar = itertools.cycle(['/', '-', '\\'])
        self._layouts = [
            self.analyze_data_layout, self.process_data_layout_1,
            self.process_data_layout_2, self.process_data_layout_3,
            self.process_data_layout_4, self.status_layout
        ]
        self.window = self.window()
        self.window.setGeometry(10, 30, self.width(), self.height())
        self.buttons = []
        self.thread = None
        self.message = m.Message_Dialog()
        self.comment = m.Message_Dialog()
        self.quit = False
        for layout in self._layouts:
            widgets = (layout.itemAt(i).widget()
                       for i in range(layout.count()))
            for btn in widgets:
                if btn != None:
                    self.buttons.append(btn)

        self.buttons1 = []
        widgets = (self.layout1.itemAt(i).widget()
                   for i in range(self.layout1.count()))
        for btn in widgets:
            if btn != None:
                self.buttons1.append(btn)

        # Checkbox
        self.prompt_box.stateChanged.connect(self.on_prompt_box_stateChanged)

        # QProcess object for external app
        self.process = QtCore.QProcess(self)
        self.process.readyReadStandardOutput.connect(self.stdout_ready)
        # self.process.readyReadStandardError.connect(self.stderr_ready)
        self.process.started.connect(self.process_started)
        self.process.finished.connect(self.process_finished)

        # QThread for processes
        self.thread = QtCore.QThread(self)

        # Connect database
        self.g_db = db.genome_db(os.path.join('DEEPN_db.sqlite3'))
        for row in self.g_db.select_all('*'):
            self.db_list_wgt.addItem(vQlistWidgetItem(row[1], row[0]))

        # Binding Selection Changed Signal
        self.db_list_wgt.itemSelectionChanged.connect(self.selection_changed)

        # Disable All buttons
        self.disable_unused_buttons()
        for btn in self.buttons1:
            btn.setEnabled(False)

        self.message.quit_btn.clicked.connect(self.message_quit_signal)
        self.message.continue_btn.clicked.connect(self.message_continue_signal)
        self.comment.continue_btn.clicked.connect(self.comment_continue_signal)
        self.comment.quit_btn.setEnabled(False)
Example #8
0
        lets_count)(directory, summary_folder, chromosomes_folder,
                    input_folder, chromosomes_list, f) for f in sam_file_list)


def initialize_folders(directory):
    # Creates the folder that will hold the Genecounts summaries
    fileio.create_new_folder(directory, summary_folder)
    # Creates the folder that will hold more granualar data on exon counts per chromosome
    fileio.create_new_folder(directory, chromosomes_folder)
    fileio.create_new_folder(directory, "gene_count_indices")


if __name__ == '__main__':
    # Instantiate Function Objects for Basic Input Output
    printio = p.printio()
    fileio = f.fileio()

    sys.stdout.write("\n*** Running Gene Count Y2H ***\n\n")
    sys.stdout.flush()

    initialize_folders(main_directory)
    # Makes sure proper files are in their place and returns .sam file list
    sam_file_list = fileio.get_sam_filelist(main_directory, input_folder)
    processed_file_list = fileio.get_file_list(main_directory, summary_folder,
                                               ".csv")
    for processed_file in processed_file_list:
        for sam_file in sam_file_list:
            if processed_file.replace("_summary.csv", "") == sam_file[:-4]:
                sam_file_list.remove(sam_file)
                break
    # Gets list of chromosomes from Y2Hreadme.txt file
Example #9
0
    def __init__(self, *args):
        super(DEEPN_Launcher, self).__init__(*args)
        self.setupUi(self)
        self.proceed = 1
        self.prompt = 2
        self.fileio = f.fileio()
        self.printio = p.printio()
        self.directory = None
        self.clicked_button = None
        self.clicked_button_text = None
        self.db_selection = None
        self.blast_db_name = ''
        self.gene_dictionary = ''
        self.gene_list_file = ''
        self.chromosome_list = ''
        self.start_match = re.compile(r'^[>>>|\t|***]')
        self.bar = itertools.cycle(['/', '-', '\\'])
        self._layouts = [self.analyze_data_layout, self.process_data_layout_1,
                         self.process_data_layout_2, self.process_data_layout_3,
                         self.process_data_layout_4, self.status_layout]
        self.window = self.window()
        self.window.setGeometry(10, 30, self.width(), self.height())
        self.buttons = []
        self.thread = None
        self.message = m.Message_Dialog()
        self.comment = m.Message_Dialog()
        self.quit = False
        for layout in self._layouts:
            widgets = (layout.itemAt(i).widget() for i in range(layout.count()))
            for btn in widgets:
                if btn != None:
                    self.buttons.append(btn)

        self.buttons1 = []
        widgets = (self.layout1.itemAt(i).widget() for i in range(self.layout1.count()))
        for btn in widgets:
            if btn != None:
                self.buttons1.append(btn)

        # Checkbox
        self.prompt_box.stateChanged.connect(self.on_prompt_box_stateChanged)

        # QProcess object for external app
        self.process = QtCore.QProcess(self)
        self.process.readyReadStandardOutput.connect(self.stdout_ready)
        # self.process.readyReadStandardError.connect(self.stderr_ready)
        self.process.started.connect(self.process_started)
        self.process.finished.connect(self.process_finished)

        # QThread for processes
        self.thread = QtCore.QThread(self)

        # Connect database
        self.g_db = db.genome_db(os.path.join('DEEPN_db.sqlite3'))
        for row in self.g_db.select_all('*'):
            self.db_list_wgt.addItem(vQlistWidgetItem(row[1], row[0]))

        # Binding Selection Changed Signal
        self.db_list_wgt.itemSelectionChanged.connect(self.selection_changed)

        # Disable All buttons
        self.disable_unused_buttons()
        for btn in self.buttons1:
            btn.setEnabled(False)

        self.message.quit_btn.clicked.connect(self.message_quit_signal)
        self.message.continue_btn.clicked.connect(self.message_continue_signal)
        self.comment.continue_btn.clicked.connect(self.comment_continue_signal)
        self.comment.quit_btn.setEnabled(False)