Example #1
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 #2
0
    Parallel.Parallel(n_jobs=num_cores - 1)(Parallel.delayed(
        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
Example #3
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 #4
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)