Skip to content

Instantly share code, notes, and snippets.

View hnishi's full-sized avatar
🏠
Working from home

hnishi hnishi

🏠
Working from home
View GitHub Profile
/********************************************************************
integ(1/(x+1))dx [0,1] = 0.6931 // > 0.5
integration method by Monte calro
Probability (0 to 1) * Area (Maximum value) = Answer
to calculate probability
if ( integrand > maximum value of the integrand within the range )
usually if( f(x) > a*y ), x and y are random value, and a is maxima
********************************************************************/
#!/bin/csh
################################################################################
# function : ln_pdb
# description :
# link mdx.out.pdb into pdb_out/
#
################################################################################
#set mdn = `more ./current_md_num`
#set nvs = `more ./current_vst_num`
# 4-D plot
splot "c1c2c3c4str.dat" using 1:2:3:4 palette
pause -1
#"""
#from pymol.cgo import * # get constants
#from pymol import cmd
#
#obj = [
# BEGIN, LINES,
# COLOR, 1.0, 1.0, 1.0,
#
# VERTEX, 0.0, 0.0, 0.0,
# VERTEX, 1.0, 0.0, 0.0,
print "pymol_setting_structure.py v1.0"
from pymol.cmd import *
### NICE GRAPHICS
set_color("oxygen", [1.0,0.4,0.4])
set_color("nitrogen", [0.5,0.5,1.0])
remove("solvent")
#show("spheres")
util.cbaw()
bg_color("white")
#!/usr/bin/env python
# Tell PyMOL we don't want any GUI features.
# It runs PyMol fullscreen stereo, and disables the internal gui.
import __main__
__main__.pymol_argv = [ 'pymol', '-qei' ] #$ pymol -qei
# Importing the PyMOL module will create the window.
import pymol
import sys
import pymol
stdout = sys.stdout
stderr = sys.stderr
pymol.finish_launching(['pymol', '-xiq'])
sys.stdout = stdout
sys.stderr = stderr
#!/bin/bash
#awk 'NR==1{print $1}' inp.dat
#num=8
num=$(wc -l inp.dat|awk '{print $1}')
dir=/work1/hnishi/4thTrial/ama2/md/md28
ref=/work1/hnishi/4thTrial/ama2/inp_data/cut_3547.pdb
for((i=1;i<=$num;i++))
do
print "pymol_view.py v1.2.0"
#try:
from pymol.cmd import *
#except:
import glob
fff = glob.glob('*.pdb')
print fff
func = lambda a:a.split('.')[0]
fff = map(func,fff)
print fff
@hnishi
hnishi / np_std.py
Created March 9, 2016 09:15
calculate standard deviation
import numpy as np
data = np.loadtxt("list")
len(data)
import sys
import os
#os.system("head zzz")
data2 = []
for i,j in enumerate(data):
#print i[4]
#print j