This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
weightedMedian <-function(v){ | |
median(rep(v, times = v)) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/awk | |
BEGIN { | |
} | |
{ | |
if($1!~/^>/) | |
{ | |
sum += length | |
} | |
} | |
END { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#$ -S /bin/bash | |
pwd | |
hostname | |
date | |
echo arg1=$1 | |
sleep 20 | |
date |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass[a4paper]{article} | |
\title{Sweave Example 1} | |
\author{Friedrich Leisch} | |
\begin{document} | |
\maketitle | |
In this example we embed parts of the examples from the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> | |
<!-- vim: set ft=html | |
Use the following R command to sweave this file: | |
Sweave("example2.snw",driver=RweaveHTML()) | |
!--> | |
<<label=zebra,echo=FALSE,eval=TRUE>>= | |
source("brew-zebra.R") | |
@ | |
<html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ clj | |
Clojure 1.3.0 | |
(use 'clojure.contrib.classpath) | |
FileNotFoundException Could not locate clojure/contrib/classpath__init.class or clojure/contrib/classpath.clj on classpath: clojure.lang.RT.load (RT.java:430) | |
user=> (classpath) | |
CompilerException java.lang.RuntimeException: Unable to resolve symbol: classpath in this context, compiling:(NO_SOURCE_PATH:2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
# Perform a google search | |
doc = Nokogiri::XML(open('http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=snp&id=7574865&report=XML&mode=xml')) | |
# Print out each link using a CSS selector | |
doc.search('Rs Assembly Component MapLoc FxnSet').each do |link| | |
puts link.attribute('mrnaAcc').to_s + '.' +link.attribute('mrnaVer').to_s | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% vim: set filetype=rnoweb | |
% hoge.Rnw | |
\documentclass[a4paper]{article} | |
\usepackage[a4paper,margin=20mm]{geometry} | |
\usepackage[utf8]{inputenc} | |
\begin{document} | |
\begin{center} | |
<<>>= | |
plot(1:10) | |
@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/ruby | |
require 'ensembl' | |
include Ensembl::Core | |
DBConnection.connect('homo_sapiens', 60) | |
my_gene = Gene.find_by_name('BRCA2') | |
puts my_gene.name + "\t" + my_gene.slice.to_s | |
my_variations = my_gene.slice.get_valiation_features | |
puts my_variations.length.to_s + "\t" + my_variations[0].variation_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# original in http://d.hatena.ne.jp/syou6162/20080801/1217528370 | |
url <- "http://research.microsoft.com/en-us/um/people/cmbishop/PRML/webdatasets/curvefitting.txt" | |
curvefitting <- read.csv(file=url, sep=" ",head=F) | |
colnames(curvefitting)<-c("x","t") | |
takousiki <- function(n){ |
OlderNewer