def main():
    args = get_args()

    # Open database
    conn = db_utils.connect_local_database(args.seed_db)
    c = conn.cursor()
    db_utils.attach_local_database(c, args.uniref_db, 'uniref_proteins')

    # Prepare database
    print('Drop seed2uniref_mappings table...')
    seed_data_util.drop_seed2uniref_mappings_table(c)
    print('Create seed2uniref_mappings table...')
    seed_data_util.create_seed2uniref_mappings_table(c)

    # Import data
    print('Find genes with identical hashes...')
    data_analysis.find_seed2uniref_identical_mappings(c)
    print('Get genes from DIAMOND output...')
    seed_data_util.load_diamond_search_results(c, args.diamond_out, 95.0, 5)

    # Write changes and close database
    print('Saving database...', end='')
    conn.commit()
    conn.close()
    print('done.')
Ejemplo n.º 2
0
 def setUp(self):
     self.conn = db_utils.connect_local_database(seed_db_file)
     self.cursor = self.conn.cursor()
     seed_data_util.create_seed_genomes_table(self.cursor)
     seed_data_util.import_seed_genomes(self.cursor, os.path.join(data_dir, 'test_seed_genomes.txt'))
     seed_data_util.create_seed_genes_table(self.cursor)
     seed_data_util.import_seed_genes(self.cursor, test_seed_dir)
     db_utils.attach_local_database(self.cursor, uniref_db_file, 'uniref_proteins')
     uniref_data_util.create_uniref_proteins_table(self.cursor)
     uniref_data_util.import_uniref_fasta(self.cursor, uniref_fasta_file)
     uniref_data_util.create_uniref_proteins_indices(self.cursor)
def main():
    args = get_args()

    # Open database
    conn = db_utils.connect_local_database(args.kegg_db)
    c = conn.cursor()
    db_utils.attach_local_database(c, args.seed_db, 'seed_data')
    print('Finding unmapped proteins...')
    data_analysis.export_kegg_unmapped_proteins(c, args.infile, args.outfile)
    conn.close()
    print('done.')
Ejemplo n.º 4
0
def main():
    args = get_args()

    # Open database
    conn = db_utils.connect_local_database(args.seed_db)
    c = conn.cursor()
    db_utils.attach_local_database(c, args.kegg_db, 'kegg_data')
    print ('Finding genes...')
    gene_collection = data_analysis.make_collection_gene_list(c, args.name, args.ver)
    print(len(gene_collection), 'genes found. Writing output...')
    data_analysis.export_collection_proteins(gene_collection,args.seed_prots,args.outfile)
    data_analysis.export_collection_proteins(gene_collection,args.kegg_prots,args.outfile)
    conn.close()
    print ('done.')
Ejemplo n.º 5
0
def main():
    args = get_args()

    # Open database
    conn = db_utils.connect_local_database(args.seed_db)
    c = conn.cursor()
    db_utils.attach_local_database(c, args.kegg_db, 'kegg_data')
    db_utils.create_collections_table(c)
    db_utils.create_collection2function_table(c)
    data_analysis.import_collection_tsv(c, args.infile, args.name, args.info,
                                        args.ver)
    conn.commit()
    conn.close()
    print('done.')
 def setUp(self):
     self.conn = db_utils.connect_local_database(
         os.path.join(data_dir, kegg_db_file))
     self.cursor = self.conn.cursor()
     db_utils.attach_local_database(self.cursor,
                                    os.path.join(data_dir, uniref_db_file),
                                    'uniref_proteins')
     kegg_data_util.create_kegg_genomes_table(self.cursor)
     kegg_data_util.import_kegg_genomes_list(
         self.cursor, os.path.join(test_kegg_dir, 'kegg_genomes.txt'))
     kegg_data_util.create_kegg_genes_table(self.cursor)
     kegg_data_util.import_kegg_genes(
         self.cursor, os.path.join(test_kegg_dir, 'ko_proteins_nr.fasta'))
     uniref_data_util.create_uniref_proteins_table(self.cursor)
     uniref_data_util.import_uniref_fasta(self.cursor, uniref_fasta_file)
     uniref_data_util.create_uniref_proteins_indices(self.cursor)
def main():
    args = get_args()

    # Open database
    conn = db_utils.connect_local_database(args.seed_db)
    c = conn.cursor()
    db_utils.attach_local_database(c, args.kegg_db, 'kegg_data')
    db_utils.attach_local_database(c, args.uniref_db, 'uniref_proteins')

    # Prepare database
    seed_data_util.drop_seed2kegg_mappings_table(c)
    print('Creating seed2kegg_mappings table...')
    seed_data_util.create_seed2kegg_mappings_table(c)
    print('Populating seed2kegg_mappings table...')
    data_analysis.fill_seed2kegg_mappings_table(c, args.diamond_out, 95.0, 5)

    # Write changes and close database
    print('Saving database...', end='')
    conn.commit()
    conn.close()
    print('done.')
Ejemplo n.º 8
0
 def setUp(self):
     self.conn = db_utils.connect_local_database(db_file)
     self.cursor = self.conn.cursor()
     db_utils.attach_local_database(self.cursor, uniref_db_file,
                                    'uniref_proteins')