Skip to content

Instantly share code, notes, and snippets.

View 0ut0fcontrol's full-sized avatar

jcyang 0ut0fcontrol

  • NIBS, Beijing, China
  • Beijing, China
View GitHub Profile
@0ut0fcontrol
0ut0fcontrol / ppt2pdf.ps1
Created December 25, 2017 11:59 — forked from mp4096/ppt2pdf.ps1
Batch convert PowerPoint files to PDF
# Batch convert all .ppt/.pptx files encountered in folder and all its subfolders
# The produced PDF files are stored in the invocation folder
#
# Adapted from http://stackoverflow.com/questions/16534292/basic-powershell-batch-convert-word-docx-to-pdf
# Thanks to MFT, takabanana, ComFreek
#
# If PowerShell exits with an error, check if unsigned scripts are allowed in your system.
# You can allow them by calling PowerShell as an Administrator and typing
# ```
# Set-ExecutionPolicy Unrestricted
@0ut0fcontrol
0ut0fcontrol / read_gz_file.py
Last active May 13, 2024 07:54
python read gzip(.gz) file line by line, compatible with python2 python3
import gzip
gzfile = "example.gz"
# using `with`
with gzip.open(gzfile) as f:
for i in f:
i = i.decode('utf-8') # for compatible with python3
#do sometime
print(i)
@0ut0fcontrol
0ut0fcontrol / qm7_krrCM_feat_sdf.py
Created January 26, 2018 10:22
KRR(CM) gains worse performance when CM featurized from gdb7.sdf
"""
Script that trains Sklearn singletask models on GDB7 dataset.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import os
import deepchem as dc
import numpy as np
@0ut0fcontrol
0ut0fcontrol / minimal-style-for-slides.csl
Last active March 15, 2022 04:32
Minimal style for inserting citations into slides by Zotero [Quick Copy](https://www.zotero.org/support/creating_bibliographies). Example: Huang et al. J. Med. Chem. (2006)
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="sort-only" default-locale="en-GB">
<!-- This style was edited with the Visual CSL Editor (https://editor.citationstyles.org/visualEditor/) -->
<info>
<title>Minimal style for slides</title>
<id>http://www.zotero.org/styles/minimal-style-for-slides</id>
<link href="http://www.zotero.org/styles/minimal-style-for-slides" rel="self"/>
<author>
<email>gold.yang@qq.com</email>
<name>Jincai Yang</name>
@0ut0fcontrol
0ut0fcontrol / error_example.py
Last active November 9, 2019 03:21
NMR prediction glitch found and fixed
from schrodinger import maestro
pt = maestro.project_table_get()
# rows may not in alphabetical order in some linux distributions.
# so the outputfile and nmr_outputfile will mismatch.
for row in pt.selected_rows:
outputfile = open( row['s_m_title'] + "-opt_freq-conf-" + str(conf_num) + ".com", 'w' )
nmr_outputfile = open( row['s_m_title'] + "-nmr-conf-" + str(conf_num) + '.com', 'w' )
@0ut0fcontrol
0ut0fcontrol / BENZ_BENZ_rep.pdb
Last active February 22, 2020 13:28
show how to rotation molecules (jupyter notebook + nglview + mdtraj + rotation matrix)
MODEL 1
CRYST1 0.000 0.000 0.000 90.00 90.00 90.00 P 65 2 2 12
ATOM 1 C01 FRG A 43 5.084 3.510 1.252 1.00 0.00 C
ATOM 2 1H01 FRG A 43 5.193 2.605 1.831 1.00 0.00 H
ATOM 3 C02 FRG A 43 6.084 3.888 0.377 1.00 0.00 C
ATOM 4 1H02 FRG A 43 6.980 3.294 0.273 1.00 0.00 H
ATOM 5 C03 FRG A 43 5.903 5.006 -0.405 1.00 0.00 C
ATOM 6 1H03 FRG A 43 6.684 5.293 -1.095 1.00 0.00 H
ATOM 7 C04 FRG A 43 4.799 5.797 -0.291 1.00 0.00 C
ATOM 8 1H04 FRG A 43 4.688 6.684 -0.898 1.00 0.00 H