Exemplo n.º 1
0
#!/usr/bin/env python
"""
    Input:  File with tab separated columns.
            One column contains the id's of a collection of molecules
            that should to be retrieved.
    Output: Retrieved compounds
"""
import argparse
import sys

import cheminfolib
import psycopg2.extras

cheminfolib.pybel_stop_logging()


def parse_command_line(argv):
    parser = argparse.ArgumentParser()
    parser.add_argument(
        "-i",
        "--input",
        required=True,
        help="input file name containing one or multiple unique molecule identifiers",
    )
    parser.add_argument(
        "-c",
        "--column",
        required=True,
        type=int,
        help="#column containing the id codes",
    )
Exemplo n.º 2
0
def start_parser(args):
    (path, schema, conn_string, molecule_type) = args
    cheminfolib.pybel_stop_logging()
    gmp = GenericMoleculeParser(path, schema, conn_string, molecule_type)
    gmp.parse_into_database()
    return path
Exemplo n.º 3
0
#!/usr/bin/env python
"""
    Input: set of molecules with pre-calculated physico-chemical properties
    Output: set of molecules that pass all the filters
    Copyright 2012, Bjoern Gruening and Xavier Lucas

    TODO: AND/OR conditions?
"""
import sys, os
import argparse
import cheminfolib
import json
import pybel
import shlex, subprocess

cheminfolib.pybel_stop_logging()

def parse_command_line():
    parser = argparse.ArgumentParser()
    parser.add_argument('-i', '--input', help='Input file name')
    parser.add_argument('-iformat', help='Input file format')
    parser.add_argument('-oformat', 
        default='smi',
        help='Output file format')
    parser.add_argument('-o', '--output', 
        help='Output file name',
        required=True)
    parser.add_argument('--filters', 
        help="Specify the filters to apply",
        required=True,
        )
Exemplo n.º 4
0
def start_parser(args):
    (path, schema, conn_string, molecule_type) = args
    cheminfolib.pybel_stop_logging()
    gmp = GenericMoleculeParser(path, schema, conn_string, molecule_type)
    gmp.parse_into_database()
    return path