Skip to content

Instantly share code, notes, and snippets.

View icaoberg's full-sized avatar

icaoberg icaoberg

View GitHub Profile
@icaoberg
icaoberg / tensorflow.sh
Created January 8, 2018 21:28
Example - Using TensorFlow
#!/bin/bash
#SBATCH -p gpu
#SBATCH -e tensorflow.%j.err
#SBATCH -o tensorflow.%j.out
#SBATCH -t 48:00:00
#SBATCH -n 1
#SBATCH --mem=32G
#SBATCH --gres=gpu:1
#so we can use modules
@icaoberg
icaoberg / sshow
Created July 25, 2017 03:37
Simple script that displays the stdout of a running job in SLURM
#!/bin/bash
scontrol show jobid $1 | grep StdOut | cut -d"=" -f2 | xargs tail
@icaoberg
icaoberg / little_women.py
Created December 29, 2016 04:00
Word cloud from the text of Little Women
from os import path
import os
from scipy.misc import imread
import matplotlib.pyplot as plt
import random
import urllib
from wordcloud import WordCloud, STOPWORDS
@icaoberg
icaoberg / twitter-trends-argentina.py
Last active June 19, 2017 04:08
Get Top 50 Twitter trends from Argentina
@icaoberg
icaoberg / script.sh
Last active June 14, 2016 15:51
Check if file img1.tif exists
FILE=img1.tif
if [ -f $FILE ]; then
echo "File "$FILE" exists."
else
echo "File "$FILE" does not exist."
exit -1
fi
@icaoberg
icaoberg / script.m
Created March 7, 2016 22:16
Create a new project and a dataset in OMERO using OMERO Matlab #OMERO.matlab-5.2.2-ice35-b17
addpath( 'OMERO.matlab-5.2.2-ice35-b17' )
server = 'localhost';
port = 4064;
username = 'murphylab';
password = 'murphylab';
client = loadOmero( server, port );
session = client.createSession( username, password );
@icaoberg
icaoberg / graph.dot
Created February 16, 2016 06:04
Using GraphViz-like tools for MATLAB on demo2D00
digraph demo2D00_calls {
rankdir="LR"
node [shape=box, color=blue]
demo2D00 -> ml_initparam;
demo2D00 -> slml2img;
AdjustResolutions -> tp_stretch3d;
AverageEnergy -> est_curv;
CompressLib -> packableObject;
Greedy3D_integration_compressed -> Greedy3D_compressed_default_options;
Greedy3D_integration_compressed -> Greedy3D_single_step_compressed;
@icaoberg
icaoberg / script.sh
Last active February 13, 2016 05:24
Install BioPython 1.6.6 in a virtual environment on the CBD cluster
#!/bin/bash
##make virtual environment
virtualenv --system-site-packages .
##activate virtual environment
source ./bin/activate
#get biopython
pip install -U biopython
@icaoberg
icaoberg / script.sh
Created February 13, 2016 04:45
Biopython 1.65 example #slurm
#!/bin/bash
##this is an example described in section 2.4.1
##http://biopython.org/DIST/docs/tutorial/Tutorial.html#htoc10
wget -nc http://biopython.org/DIST/docs/tutorial/examples/ls_orchid.fasta
echo "
from Bio import SeqIO
for seq_record in SeqIO.parse("ls_orchid.fasta", "fasta"):
@icaoberg
icaoberg / script.sh
Last active February 10, 2016 20:30
Install R 3.2.3 in your home directory in the CBD cluster #slurm
#!/bin/bash
## Ivan E. Cao-Berg (icaoberg@scs.cmu.edu)
## Copyright (C) 2016
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published
## by the Free Software Foundation; either version 2 of the License,
## or (at your option) any later version.
##