Skip to content

Instantly share code, notes, and snippets.

View filipsPL's full-sized avatar
💭
🚀 travelling to Mars and back

filips filipsPL

💭
🚀 travelling to Mars and back
View GitHub Profile
@filipsPL
filipsPL / dock_gbsa_rescore.in
Last active September 26, 2019 10:56 — forked from bougui505/dock_gbsa_rescore.in
Template of dock6.9 for GBSA Hawkins rescore of docked molecules. Replace LIG with your mol2 file of docked ligands and REC by your mol2 file for the receptor
conformer_search_type flex
write_fragment_libraries no
user_specified_anchor no
limit_max_anchors no
min_anchor_size 5
pruning_use_clustering yes
pruning_max_orients 1000
pruning_clustering_cutoff 100
pruning_conformer_score_cutoff 100.0
pruning_conformer_score_scaling_factor 1.0
@filipsPL
filipsPL / process_dock6_logs.sh
Last active September 23, 2019 09:40
For all *.logs files in the directory: extracts scores and compound names from dock6 docking logs and puts it to the simple csv file, with the name of the input file.
for f in *.logs;
do echo $f;
echo "compound,score" > `basename $f .logs`.csv;
cat $f | egrep "Molecule:|Grid_Score" | tr -s " " | sed -e ':a;N;$!ba;s/\n Grid_Score: / /g' -e 's/Molecule: //g' | \
tr " " "," >> `basename $f .logs`.csv;
done
@filipsPL
filipsPL / autoweka_process.sh
Created February 28, 2019 12:06
Quick and dirty way of processing log files from autoweka to extract the best classifier found by the system. Results may still need some tuning before supplying to weka experimenter, but in many cases it works out of the box.
#!/bin/bash
# direcotry with log files from autoweka
autowekadir="./"
# weka.classifiers.meta.FilteredClassifier -F "weka.filters.supervised.attribute.AttributeSelection -E \"$eval\" -S \"$selection\"" -S 1 -W $classifier
# best classifier: weka.classifiers.lazy.IBk
# arguments: [-K, 4, -F]
# attribute search: weka.attributeSelection.GreedyStepwise
# attribute search arguments: [-B, -R]
@filipsPL
filipsPL / python+tee.py
Created November 7, 2018 20:29
Function which: 1) runs the command 2) for the specified time (duration) and 3) pipes output to the file AND to screen (live).
import time
from time import strftime
import subprocess
def runForDuration(cmdline, duration, logFile):
teeCommand = ['tee', '-a', logFile ] # quick and dirty hack to get log to file
try:
p1 = subprocess.Popen(cmdline, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
p2 = subprocess.Popen(teeCommand, stdin=p1.stdout)
@filipsPL
filipsPL / list_big_files.sh
Created December 15, 2017 08:37
List files bigger than the given size and optionally compress them
#!/bin/bash
### list files bigger than the given size
### and optionally compress them
filesize=100M # files bigger than this will be listed; default is 100M
for f in `find . -type f -size +$filesize`
do
@filipsPL
filipsPL / maketoc.py
Created September 27, 2017 13:02
Super simple TOC generator from a ready HTML file.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from re import sub
fname = "FAQ.html"
header="<h4>"
outfile = "FAQ+TOC.html"
#-----------------------------------------#
@filipsPL
filipsPL / screen-loop.sh
Created May 5, 2016 08:02
Loop over all screen sessions
#!/bin/bash
for ses in `screen -r | grep "(Detached)"| cut -f 2`; do screen -r "$ses"; done
#!/bin/bash
DATA=`date`
DIR=/usr/local/bin/rrd/pi/rrd/
OUTDIR=/var/www/pi/sysinfo/img/
BAZA=$DIR/temperatura.rrd
var=cisnienie
#!/bin/bash
rrdtool create airq.rrd --step 3600 \
DS:pm10:GAUGE:1800:0:500 \
DS:pm25:GAUGE:1800:0:500 \
RRA:AVERAGE:0.5:1:144 \
RRA:AVERAGE:0.5:3:336 \
RRA:AVERAGE:0.5:144:367 \
RRA:AVERAGE:0.5:1008:250 \
gua
OpenBabel11131516582D
7 7 0 0 0 0 0 0 0 0999 V2000
-0.3090 -0.9511 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
-1.3090 -0.9511 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-1.8968 -1.7601 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
-1.6180 -0.0000 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
-0.8090 0.5878 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
-0.0000 -0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0