Skip to content

Instantly share code, notes, and snippets.

@saketkc
saketkc / eggipfy.sh
Created May 17, 2012 22:40
Eggifying the source code in your repo
## Installing Virtual Environment and Eggifying your source code for OERPub
Go to your Repo : cd <repo_name>
and then :
virtualenv --no-site-packages .
./bin/easy_install -U ZopeSkel
./bin/paster create --list-templates
./bin/paster create -t nested_namespace <repo_name>
This will create and empty egg for your repo !
@saketkc
saketkc / google_docs_upload_api_python.py
Created June 6, 2012 10:00
Google Docs Upload Python API
import gdata.docs.data
import gdata.docs.client
import gdata.docs.service
import gdata.client
import gdata.docs.client
import os
import stat
import mimetypes
from google_api_config import CONSUMER_KEY
from google_api_config import CONSUMER_SECRET
#!/usr/bin/env python
'''
Automatically estimate insert size of the paired-end reads for a given SAM/BAM file.
Usage: getinsertsize.py <SAM file> or samtools view <BAM file> | getinsertsize.py -
Author: Wei Li
'''
from __future__ import print_function
import sys;
@saketkc
saketkc / panama.xml
Last active December 18, 2015 00:29
<tool id="panama1" name="panama" version="1.0.0">
<requirements>
<requirement type="package">panama</requirement>
</requirements>
<description>eQTL Analysis using PANAMA(http://ml.sheffield.ac.uk/qtl/panama/)</description>
<command>
panama $expression_data $snp_data; mv PANAMA_results.csv output1
</command>
<inputs>
<param name="expression_data" type="data" format="text" label="Select Expression Data" />
@saketkc
saketkc / panama_run.py
Created June 10, 2013 12:32
Python wrapper for PANAMA tool in Galaxy
#!/usr/bin/env python
"""
Run panama on expression and snp data
usage: panama_run.py [options]
--exp_data: Expression data CSV file
--snp_data: SNP data file
--output1: Output CSV dataset
"""
import optparse, os, sys, subprocess, tempfile, shutil
@saketkc
saketkc / panama.xml
Created June 10, 2013 12:32
Panama.xml
<tool id="panama1" name="panama" version="1.0.0">
<requirements>
<requirement type="package">panama</requirement>
</requirements>
<description>eQTL Analysis using PANAMA(http://ml.sheffield.ac.uk/qtl/panama/)</description>
<command interpreter="python">
panama_run.py --exp_data=$expression_data --snp_data=$snp_data --output1=$output1
</command>
<inputs>
<param name="expression_data" type="data" format="text" label="Select Expression Data" />
library(limma)
Cy5 <- "F635 Median"
Cy5b <- "B635 Mean"
targets <- readTargets("Grade2_targets.csv")
f <- factor(targets$Condition, levels = unique(targets$Condition))
design <- model.matrix(~0 + f)
cont.matrix <- makeContrasts(Grade2vsControl=Grade2-Control, levels=design)
colnames(design) <- levels(f)
RG <- read.maimages( targets$FileName,
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
FileName Condition
Control_H-02_2000153953.gpr Control
Control_H-25_2000153952.gpr Control
Control_H-35_2000153943.gpr Control
Control_H-58_2000153935.gpr Control
Control_HC-25_2000153932.gpr Control
Grade II_CF 10729_2000154012.gpr Grade2
Grade II_CF 20468_2000153947.gpr Grade2
Grade II_CF 29538_2000154020.gpr Grade2
Grade II_CF 8551_2000153940.gpr Grade2
@saketkc
saketkc / 0_reuse_code.js
Last active May 23, 2016 17:35
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
name: multiz
channels: !!python/object/new:ruamel_yaml.comments.CommentedSeq
listitems:
- bioconda
- r
- defaults
state: !!python/tuple
- _yaml_format: !!python/object:ruamel_yaml.comments.Format
_flow_style: false
_yaml_line_col: !!python/object:ruamel_yaml.comments.LineCol