Skip to content

Instantly share code, notes, and snippets.

View hkmoon's full-sized avatar

HongKee Moon hkmoon

  • MPI-CBG
  • Dresden
View GitHub Profile
@hkmoon
hkmoon / amchart_in_jupyter.ipynb
Last active January 31, 2024 07:23
amchart in jupyter
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hkmoon
hkmoon / RPlot_ly_jupyter.R
Created October 4, 2019 09:00
R ploty usage
library(plotly)
library("RColorBrewer")
# display.brewer.all()
x <- c("Non-MT", "MT-8", "MT-16")
y <- c(61.88, 6.79, 2.38)
color <- brewer.pal(n = 3, name = "Dark2")
p <- plot_ly(
x = ~x,
export TRINITY="sudo singularity exec /home/vagrant/Trinity-v2.8.4.simg Trinity"
cd sample_data
$TRINITY --samples_file samples.PE.txt --seqType fq --max_memory 1G --output trinity_test_samples_PE
export TRINITY_HOME="singularity exec /home/vagrant/Trinity-v2.8.4.simg Trinity"
mkdir trinityrnaseq
cd trinityrnaseq
git init
git remote add -f origin https://github.com/trinityrnaseq/trinityrnaseq.git
git config core.sparseCheckout true
echo "sample_data/test_Trinity_Assembly" >> .git/info/sparse-checkout
git pull origin master
mv sample_data/test_Trinity_Assembly/* .
@hkmoon
hkmoon / Vagrantfile
Last active August 22, 2019 09:22
Simple Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
####################################################
# You can do this entire process while running on the filesystem you want to resize (yes, it's safe and fully supported). There is no need for rescue CDs or alternate operating systems.
#
@hkmoon
hkmoon / bootstrap.sh
Last active September 10, 2019 11:38
Simple vagrant bootstrap.sh
#!/usr/bin/env bash
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y python-pip python3-pip
pip install numpy biopython
pip3 install numpy biopython
# create Trinity output, DATA, scripts folder
sudo -S -u vagrant mkdir -p /vagrant/output
sudo -S -u vagrant ln -s /vagrant/output output
@hkmoon
hkmoon / vm-resize-hard-disk.md
Created July 1, 2019 11:08 — forked from christopher-hopper/vm-resize-hard-disk.md
Resize a Hard Disk for a Virtual Machine provisioned using Vagrant from a Linux base box to run using VirutalBox.

Resize a Hard Disk for a Virtual Machine

Our Virtual Machines are provisioned using Vagrant from a Linux base box to run using VirutalBox. If the Hard Disk space runs out and you cannot remove files to free-up space, you can resize the Hard Disk using some VirtualBox and Linux commands.

Some assumptions

The following steps assume you've got a set-up like mine, where:

@hkmoon
hkmoon / byobuCommands
Created June 22, 2018 08:36 — forked from jshaw/byobuCommands
Byobu Commands
Byobu Commands
==============
byobu Screen manager
Level 0 Commands (Quick Start)
------------------------------
<F2> Create a new window
@hkmoon
hkmoon / ROIHdf5.java
Created August 9, 2017 07:56
ROI in HDF4ImageLoader
void process(File hdf5, SpimDataMinimal spimData, Interval roi) {
AbstractSequenceDescription<?, ?, ?> sequenceDescription = spimData.getSequenceDescription();
Hdf5ImageLoader hdf5Loader = new Hdf5ImageLoader(hdf5, /* hdf5 partitions */ null, sequenceDescription);
for (TimePoint timepoint : sequenceDescription.getTimePoints().getTimePointsOrdered()) {
for (BasicViewSetup setup : sequenceDescription.getViewSetupsOrdered()) {
RandomAccessibleInterval<UnsignedShortType> img = hdf5Loader.getSetupImgLoader(setup.getId()).getImage(timepoint.getId(), 0); // full res
RandomAccessibleInterval<UnsignedShortType> imgRoi = Views.interval(img, roi);
// process imgRoi here, it will be lazily loaded when accessed
}
}
@hkmoon
hkmoon / Check.java
Created December 14, 2015 15:23
UTF-8 filesystem check
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
/**
* Created by moon on 12/8/15.
*/
public class Check
{