#!/bin/sh
$ screen -r
Cannot open your terminal '/dev/pts/15' - please check.
$ script /dev/null
$ screen -r
works
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/bash | |
# usage: x11sudo.sh username | |
su - $1 -c 'xauth list' | grep `echo $DISPLAY | cut -d ':' -f 2| cut -d '.' -f 1 | sed -e 's/^/:/'`|xargs -n 3 xauth add |
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
#include <cstdlib> | |
#include <iostream> | |
using namespace std; | |
int main(int argc, char **argv) { | |
if(argc < 3) { | |
cout << "Usage: " << argv[0] << " <n> <m> <s>" << endl; | |
cout << "Generates <n> random numbers to stdout max value <m> using seed <s>" << endl; | |
return -1; | |
} |
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> | |
<html> | |
<head> | |
<script src="https://code.jquery.com/jquery-2.1.4.js"></script> | |
<script> | |
// call the api and update | |
for(var i=0; i<5; i++) { | |
setTimeout(function() { |
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 | |
bgzip -dc $1 | sed -e 's/^\([^#].*\)/chr\1/' | bgzip -c > `basename $1 .vcf.gz`.mod.vcf.gz |
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
#for i in GIANT*.txt; do LC_ALL=c sort -k1,1 $i > `basename $i .txt`.sort.bed; done; | |
export LC_ALL=c | |
parallel "join -1 4 -2 1 -t $'\t' snp144.sort.bed {} > {.}.joined.bed" ::: GIANT*sort.bed | |
parallel "cat {} | awk '{print \$2,\"\t\",\$3,\"\t\",\$4,\"\t\",\$1,\"\t\",\$8}' > {.}.final.bed" ::: *joined.bed | |
parallel "sort -k1,1 -k2,2n {} > {.}.final.sorted.bed" ::: *.final.bed | |
parallel "bgzip {}; tabix {}.gz" ::: *.final.sorted.bed | |
#for i in {1..22};do tabix GIANT_BMI_Speliotes2010_publicrelease_HapMapCeuFreq.sort.bed.gz chr$i > GIANT_BMI_Speliotes2010_publicrelease_HapMapCeuFreq.chr$i.bed; bgzip GIANT_BMI_Speliotes2010_publicrelease_HapMapCeuFreq.chr$i.bed; tabix GIANT_BMI_Speliotes2010_publicrelease_HapMapCeuFreq.chr$i.bed.gz; done; |
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
<html> | |
<head> | |
<title>JBrowse render GWAS</title> | |
<link rel="stylesheet" type="text/css" href="css/genome.css"> | |
<script type="text/javascript" src="src/dojo/dojo.js" data-dojo-config="async: 1, baseUrl: './src'"></script> | |
<script type="text/javascript" src="src/JBrowse/init.js"></script> | |
<script> | |
require({ |
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
library("seqinr") | |
refseq=read.fasta('../Code/Amel_variants/Amel_4.5_scaffolds.fa') | |
wiggle_output <- file("output5.wig", "a") | |
printf("track type=print wiggle_0 name=fileName description=fileName\n",file=wiggle_output) | |
window_size=2000 | |
refseq_names=names(refseq) | |
for(i in 1:length(refseq)) { | |
fasta=refseq[[i]] |
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
9d8 | |
< #include <functional> | |
32c31 | |
< bool operator()(FILE* fp, const std::pair<std::tr1::reference_wrapper<const string>, std::tr1::reference_wrapper<const vector<annot> > > value) const { | |
--- | |
> bool operator()(FILE* fp, const std::pair<const string&, const vector<annot> >& value) const { | |
35c34,35 | |
< const unsigned char size = value.first.get().length(); | |
--- | |
> assert(value.first.length() <= UCHAR_MAX); |
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
# given a list of song durations, split them into two parts of equal length using knapsack | |
songs=list("drugs"=6*60+40,"error"=5*60+36,"stepvhen"=5*60+17,"infinity"=6*60+13, | |
"pete"=2*60+38,"Zalh"=7*60+3,"morpheus"=5*60+4,"cleartone"=6*60+5, | |
"dedmeth"=6*60+32,"orthodox"=2*60+18,"xeph"=4*60+12,"amelia where are"=6*60+58) | |
half.cassette <- local ( | |
function (target) { |