title: "Template for writing scientific papers in R markdown" author: "Petr Keil, [email protected]" date: "11/1/2015" output: pdf_document: fig_caption: yes keep_tex: yes number_sections: yes html_document:
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
#Directories | |
SOURCEDIR := sources | |
FASTQDIR := fastq | |
DECODEDDIR := decoded | |
BAMDIR := bam | |
SCRIPTDIR := scripts | |
TRIMMEDDIR := trimmed | |
#Parameters | |
MIN_LENGTH := 15 |
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("plyr") | |
library("XML") | |
library("ggplot2") | |
#Concatenate SQL-style | |
concat<-function(...,sep="",collapse=NULL){ | |
strings<-list(...) | |
#NULL, NA | |
if( | |
all(unlist(llply(strings,length))>0) |
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
function mycd() | |
{ | |
#if this directory is writable then write to directory-based history file | |
#otherwise write history in the usual home-based history file | |
tmpDir=$PWD | |
echo "#"`date '+%s'` >> $HISTFILE | |
echo $USER' has exited '$PWD' for '$@ >> $HISTFILE | |
builtin cd "$@" # do actual cd | |
if [ -w $PWD ]; then export HISTFILE="$PWD/.dir_bash_history"; touch $HISTFILE; chmod --silent 777 $HISTFILE; | |
else export HISTFILE="$HOME/.bash_history"; |
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
#!/usr/bin/perl | |
use strict; | |
use Carp; | |
use Carp::Assert; | |
use Getopt::Std; | |
use File::Slurp; | |
my %opt; | |
my $opt_string = 'o:d:rh'; |
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
#!/usr/bin/perl | |
use strict; | |
use Getopt::Std; | |
use LWP::UserAgent; | |
use HTTP::Request::Common; | |
my %opt; | |
my $opt_string = 'hcms'; | |
getopts( "$opt_string", \%opt ) or &usage(); |
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
#!/usr/bin/expect -f | |
#Upload a file to an Aspera server, filling in the passphrase field | |
#Usage: ./autopass.sh mybigassfile | |
set arg1 [lindex $argv 0] | |
set timeout -1 | |
spawn ascp -i sra-rsakey-putty.ppk -k 1 -Qr -l300M $arg1 [email protected]:protected/ | |
expect "Passphrase for key \"rsa-key-blahblah\":" | |
send "mypassword\r" | |
expect "Completed" | |
#add the file you successfully uploaded to a log |
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 chrom chromStart chromEnd ix n size type bridge | |
0 chr1 124535434 142535434 1271 N 18000000 heterochromatin no | |
23 chr1 121535434 124535434 1270 N 3000000 centromere no | |
76 chr1 3845268 3995268 47 N 150000 contig no | |
85 chr1 13219912 13319912 154 N 100000 contig no | |
89 chr1 17125658 17175658 196 N 50000 clone yes | |
101 chr1 29878082 30028082 337 N 150000 contig no | |
188 chr1 120697156 120747156 1263 N 50000 clone yes | |
188 chr1 120936695 121086695 1265 N 150000 contig no | |
188 chr1 121485434 121535434 1269 N 50000 clone no |
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
default: vcffilesdone | |
clean: | |
rm disease_loci/*/*vcf | |
rm vcffilesdone | |
#gene cards list of known disease loci | |
diseaseloci.html: | |
curl http://www.genecards.org/cgi-bin/listdiseasecards.pl?type=full > diseaseloci.html | |
#scrape loci |
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
#!/usr/bin/perl | |
use LWP::UserAgent; | |
use HTTP::Request::Common; | |
my $userAgent = LWP::UserAgent->new(timeout => 1800); #a half-hour | |
my $request = POST 'http://mitomaster.mitomap.org/cgi-bin/websrvc.cgi', [ | |
gb => $ARGV[0], | |
fileType => 'id', | |
output => 'hsd' |
OlderNewer