Reading this (Wang et al. 2010), in particular Supp. report 4. Has to do with bootstrapping population estimates using the different enzymes used to find integration sites.
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 sqlite3 | |
import multiprocessing | |
store_results_sql = """ some sql code here """ | |
select_results_sql = """ some other sql code here """ | |
def find_enriched(**kwargs): | |
# do some heavy computation task here | |
results = enrichment_analysis(**kwargs) | |
# sqlite is not ideal for parallel processing, but with a timeout it should be fine |
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/env python | |
import re | |
import json | |
import clint | |
def import_go(gofile='go.json'): | |
try: | |
return json.loads(json.load(open(gofile))) | |
except IOError: |
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
postParams.add(new BasicNameValuePair("longestOnly","false")); | |
postParams.add(new BasicNameValuePair("wholeWordOnly","true")); | |
postParams.add(new BasicNameValuePair("filterNumber", "true")); | |
postParams.add(new BasicNameValuePair("stopWords","protein,gene,disease,disorder,cell,syndrome,CAN")); | |
postParams.add(new BasicNameValuePair("withDefaultStopWords","true")); | |
postParams.add(new BasicNameValuePair("isTopWordsCaseSensitive","false")); | |
postParams.add(new BasicNameValuePair("mintermSize","3")); | |
postParams.add(new BasicNameValuePair("scored", "true")); | |
postParams.add(new BasicNameValuePair("withSynonyms","true")); | |
postParams.add(new BasicNameValuePair("ontologiesToExpand", "")); |
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
public static String fixLinks(String src, Wiki target) { | |
// add a marker to all the links so we can iterate through them (except the ones that point to wikipedia) | |
String src2 = src.replaceAll("\\[\\[(?!(wikipedia))", "[[%"); | |
try { | |
while (src2.contains("[[%")) { | |
// extract the link text | |
int a = src2.indexOf("[[%")+3; // left inner bound |
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
alpha_diversity <- function(df, group.col, freq.col) { | |
# Returns a variety of diversity indices, including the Gini-Simpson index, | |
# the inverse Simpson index, and the Shannon-Weaver index. The SW index is | |
# calculated using the natural logarithm. | |
# | |
# Arguments: | |
# df: a data frame where the rows are species, with a column containing the | |
# grouping variable and another column containing the proportional | |
# abundances of each species | |
# group: the name of the column defining the grouping variable |
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
>denovo1793 | |
GGAGTCTGGGCCGTGTCTCAGTCCCAGTGTGGCCGATCACCCTCTCAGGTCGGCTATGTATCGTCGCCTTGGTGAGCCGTTACCCCACCAACTAGCTAATACAACGCAGGTCCATCTGGTAGTGATGCAATTGCACCTTTTAATTGACTATCATGCAATAGTCAATATTATGCGGTATTAGCTATCGTTTCCAATAGTTATCCCCCGCTACCAGGCAGGTTACCTACGCGTTACTCACCCGTTCGCAACTCATCCAGAGAAGCAAGCTCCTCCTTCAGCGTTCTACTTGCATGTATTAGGCACGCCGCCAGCGTTCGTC | |
>denovo2518 | |
GGAGTTTGGGCCGTGTCTCAGTCCCAATGTGGCCGATCACCCTCTCAGGTCGGCTATGCATCACGGCCTTGGTGAGCCGTTACCTCACCAACTAGCTAATGCACCGCGGGTCCATCCATCAGCAGAAGCTTGCGCCTCTTTTCCTCTTCAAACCATGCGGTTCGAAGACCTATGCGGTTTTAGCATCCGTTTCCGAATGTTATCCCCCTCTGATGGGCAGGTTACCCACGTGTTACTCACCCGTTCGCCACTAGATTGACCAGTGCAAGCACCGGTCGCTCTCGTTCGACTTGCATGTATTAGGCACGCCGCCAGCGTTCGTC | |
>denovo271 | |
GGAGTCTGGGCCGTGTCTCAGTCCCAGTGTGGCCGATCACCCTCTCAGGTCGGCTATGTATCGTCGCCTTGGTGAGCCGTTACCCCACCAACTAGCTAATACAACGCAGGTCCATCTGGTAGTGATGCAATTGCACCTTTTAAGCAAATGTCATGCAACATTTACTGTTATGCGGTATTAGCTATCGTTTCCAATAGTTATCCCCCGNTACCAGGCAGGTTACCTACGCGTTACTCACCCGTTCGCAACTCGTCCAGAAGAGCAAGCTCTCCCTTCAGCGTTCTACTTGCATGTATTAGGCACGCCGCCAGCGTTCGTC | |
>denovo3052 | |
GGAGTCTGGTCCG |
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
# -*- coding: utf-8 -*- | |
""" | |
Uses a context manager to provide a dictionary as a 'namespace' of sorts, | |
allowing you to use dot notation to work with the dictionary. Example: | |
d = {'a': 5, 'b': 10} | |
with named(d) as n: | |
# prints 5 | |
print n.a | |
# reassignment changes both n and d |
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
tell application "Papers" | |
set outFile to "path_to_notebook_folder/library.bib" | |
export ((every publication item) as list) to outFile | |
end tell |