Beispiel #1
0
 def dock_one(enum_tuple):
     """ Docks one smiles. Input = tuple from enumerate iterator"""
     identifier, smiles = enum_tuple
     return dock(smiles,
                 identifier,
                 PYTHONSH,
                 VINA,
                 parallel=False,
                 exhaustiveness=16)
Beispiel #2
0
def one_slurm(list_smiles,
              server,
              unique_id,
              name,
              target='drd3',
              parallel=True,
              exhaustiveness=16,
              mean=False,
              load=False):
    """

    :param list_smiles:
    :param server:
    :param unique_id:
    :param name:
    :param parallel:
    :param exhaustiveness:
    :param mean:
    :param load:
    :return:
    """
    pythonsh, vina = set_path(server)
    dirname = os.path.join(script_dir, 'results', name,
                           'docking_small_results')
    dump_path = os.path.join(dirname, f"{unique_id}.csv")

    header = ['smile', 'score']
    with open(dump_path, 'w', newline='') as csvfile:
        csv.writer(csvfile).writerow(header)

    for smile in list_smiles:
        score_smile = dock(smile,
                           target='drd3',
                           unique_id=unique_id,
                           parallel=parallel,
                           exhaustiveness=exhaustiveness,
                           mean=mean,
                           pythonsh=pythonsh,
                           vina=vina,
                           load=load)
        # score_smile = 0
        with open(dump_path, 'a', newline='') as csvfile:
            list_to_write = [smile, score_smile]
            csv.writer(csvfile).writerow(list_to_write)
Beispiel #3
0
def one_dock(smile,
             server,
             parallel=False,
             exhaustiveness=16,
             mean=False,
             load=False,
             target='drd3'):
    pythonsh, vina = set_path(server)
    score_smile = dock(smile,
                       unique_id=smile,
                       parallel=parallel,
                       exhaustiveness=exhaustiveness,
                       mean=mean,
                       pythonsh=pythonsh,
                       vina=vina,
                       load=load,
                       target=target)

    return score_smile
Beispiel #4
0
        "-i",
        "--input",
        default='O=CC=C(C1C2=NC=C(C=NC3=CC=CC=C3N=C2)C=C1F)NC=C',
        help="Smiles to dock")
    parser.add_argument('--target',
                        type=str,
                        default='drd3',
                        help='target to dock')
    parser.add_argument(
        "-s",
        "--server",
        default='pasteur',
        help="Server to run the docking on, for path and configs.")
    parser.add_argument("-e",
                        "--ex",
                        default=16,
                        help="exhaustiveness parameter for vina")

    args, _ = parser.parse_known_args()

    PYTHONSH, VINA = set_path(args.server)

    sc = dock(smile=args.input,
              target=args.target,
              unique_id=1,
              pythonsh=PYTHONSH,
              vina=VINA,
              parallel=True,
              exhaustiveness=args.ex)
    print('Score :', sc)