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
<?xml version="1.0" encoding="utf-8"?> | |
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" default-locale="en-US"> | |
<info> | |
<title>Human Mutation</title> | |
<link href="http://onlinelibrary.wiley.com/journal/10.1002/(ISSN)1098-1004/homepage/ForAuthors.html" rel="documentation"/> | |
<id>http://www.zotero.org/styles/human-mutation</id> | |
<link href="http://www.zotero.org/styles/human-mutation" rel="self"/> | |
<updated>2012-07-06T16:31:32+00:00</updated> | |
<author> | |
<name>Matthew Shirley</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
<?xml version="1.0" encoding="utf-8"?> | |
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0"> | |
<info> | |
<title>F1000 Research</title> | |
<id>http://www.zotero.org/styles/f1000-research</id> | |
<link href="http://www.zotero.org/styles/vancouver" rel="independent-parent"/> | |
<link href="http://f1000research.com/author-guidelines/" rel="documentation"/> | |
<author> | |
<name>Courtney Shirley</name> | |
<email>[email protected]</email> |
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 | |
# per-directory history | |
shopt -s histappend # always append to history, don't replace | |
export PROMPT_COMMAND="builtin history -a;$PROMPT_COMMAND" # write to history file at every new prompt | |
export HISTTIMEFORMAT="%m/%d/%y %T " | |
alias cd='cd_with_local_history' | |
alias history='cat $HOME/.bash_history' | |
export HISTFILE="$PWD/.bash_cwd_history_$USER" | |
function cd_with_local_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
Python 2.7.5 (default, Oct 9 2013, 20:09:30) | |
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.2.78)] on darwin | |
>>> x = range(100) | |
>>> random.seed(1) | |
>>> print([random.choice(x) for i in range(10)]) | |
[13, 84, 76, 25, 49, 44, 65, 78, 9, 2] | |
>>> random.seed(1) | |
>>> print([choice(x) for i in range(10)]) | |
[13, 84, 76, 25, 49, 44, 65, 78, 9, 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
def choice(self, seq): | |
"""Choose a random element from a non-empty sequence.""" | |
return seq[int(self.random() * len(seq))] # raises IndexError |
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
import random | |
def choice(seq): | |
"""Choose a random element from a non-empty sequence. | |
This function produces consistent results from Python2.7 to 3.3 | |
in contrast to random.choice(). """ | |
return seq[int(random.random() * len(seq))] |
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
rule sam_to_bam: | |
input: "{dataset}.sam" | |
output: "{dataset}.bam" | |
shell: "module load sharedapps samtools; samtools view -@ 8 -bSo {output} {input}" | |
rule bam_index: | |
input: "{dataset}.bam" | |
output: "{dataset}.bam.bai" | |
shell: "module load sharedapps samtools; samtools index {input} {output}" |
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
import urllib2 | |
from bs4 import BeautifulSoup | |
from icalendar import Calendar, Event | |
import pytz | |
from datetime import datetime, timedelta | |
def scrape_scical(): | |
data = urllib2.urlopen('http://www.hopkinsmedicine.org/scical/').read() | |
soup = BeautifulSoup(data) | |
cal = Calendar() | |
cal.add('prodid', '-//Hopkins Science Calendar//mattshirley.com/scical//') |
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
prefix=/home/matt/.local | |
exec_prefix=${prefix} | |
includedir=${prefix}/include | |
libdir=${exec_prefix}/lib | |
Name: freetype2 | |
Description: The freetype2 library | |
Version: 2.5.3 | |
Cflags: -I${includedir}/freetype2 | |
Libs: -L${libdir} -lfreetype |
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
from pyfaidx import Fasta | |
with open("regions.txt") as regions, Fasta("sequence.fasta") as fasta: | |
for line in regions: | |
fields = line.rstrip().split() | |
rname, start, end = fields[4:7] | |
repeat = ' '.join(fields[9:11]) | |
seq = fasta[rname][int(start)-1:int(end)-1] | |
print(seq.name + repeat) | |
print(seq.seq) |
OlderNewer