Skip to content

Instantly share code, notes, and snippets.

View soh-i's full-sized avatar

Soh Ishiguro soh-i

View GitHub Profile
@soh-i
soh-i / ggcyto.R
Last active September 19, 2022 17:19
FACS plot with user-defined gate
library(CytoML)
library(flowWorkspace)
library(ggcyto)
xmlfile <- 'gate.xml' # Gating-ML xml file generated by Cytobank
fcsFiles <- list.files(pattern='.fcs', path='./FCS/', full.names=TRUE)
gs <- cytobank2GatingSet(xmlfile, fcsFiles)
fs <- getData(gs, "P1") # FCS file object filtered by P1 gate (live cell)
P2 <- getGate(gs, "P2") # P2 gate object (EGFP gate)
@soh-i
soh-i / plot.R
Created April 5, 2018 01:38
Plotting gated FACS data
library(ggplot2)
library(RColorBrewer)
d <- read.csv('BC4-R1-1.fcs_spill_applied_AID_BC_Cell_P1.txt', sep='\t', header=T, skip=1)
names(d) <- c('Event', 'FSC', 'SCC', 'FITC')
myPalette <- colorRampPalette(rev(brewer.pal(11, "Spectral")), space="Lab")
g <- ggplot(d, aes(y=FSC, x=FITC)) +
geom_hex(bins=128) +
☕ Aichan ☕ >> python setup.py develop
# pysam: cython is available - using cythonize if necessary
# pysam: htslib mode is shared
# pysam: HTSLIB_CONFIGURE_OPTIONS=--disable-lzma
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
@soh-i
soh-i / to_json.pl
Created October 9, 2016 11:18
Data::Dumper output to JSON
#!/usr/bin/env perl
use strict;
use warnings;
use JSON;
use Data::Dumper;
my $file = shift or die('Input Data::Dumper output');
my $data = do $file;
@soh-i
soh-i / blast.py
Created May 4, 2016 04:25
Blast parser
class BlastOut(object):
def __init__(self, line):
col = line.strip().split()
self.col_string = line.strip()
self.q = col[0]
self.s = col[1]
self.identity = float(col[2])
self.alignment_len = int(col[3])
self.mismatches = int(col[4])
self.gap_open = int(col[5])
@soh-i
soh-i / LLR.R
Created December 6, 2015 13:47
LLR
pval.to.qual <- function(p) {
return(-10*log10(p))
}
qual.to.pval <- function(q) {
return(10^(-q/10))
}
LLR <- function(p, n, x) {
@soh-i
soh-i / imagej.java
Created November 29, 2015 02:04
Opening images by ImageJ
// Soh Ishiguro
import ij.ImagePlus;
import ij.io.Opener;
public class Main {
public static ImagePlus openImage(String filepath) {
Opener op = new Opener();
return op.openImage(filepath);
}
@soh-i
soh-i / seq.py
Last active November 3, 2015 09:48
Random sequence generator and basic regexp
import random
import re
def generate_random_sequence(seq_length=20, n=10):
"""
Random sequence generator.
Args:
seq_length: Int #sequence length
n: Int #total number of sequences
@soh-i
soh-i / lscp.sh
Created October 9, 2015 06:16
Find it, then copy it to another place!
ls | grep filename_you_want_to_move | xargs -J% cp -f % place_where_you_want
@soh-i
soh-i / random_seq.py
Created October 2, 2015 07:29
Generate random sequence
import random
n_code = {0: "A", 1: "T", 2: "C", 3: "G"}
print "".join(map(lambda _: n_code[random.randint(0, 3)], range(0, 20)))