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
rm counties.* | |
rm *csv | |
# England ###################################################################### | |
curl -O -J -L https://www.registers.service.gov.uk/registers/local-authority-eng/download-csv | |
# https://www.datadictionary.nhs.uk/data_dictionary/nhs_business_definitions/l/local_authority_de.asp? | |
# A Local Authority, in relation to England is: | |
## a County Council | |
awk -F',' '$6=="CTY" {print $7}' local-authority-eng.csv >> counties.eng.ls |
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(tidyverse) | |
assemblies=read_tsv('kraken_summary.bond.tsv') | |
short_name <- c( | |
"Bacillus subtilis" = "bs", | |
"Cryptococcus neoformans" = "cn", | |
"Enterococcus faecalis" = "ef", | |
"Escherichia coli" = "ec", | |
"Lactobacillus fermentum" = "lf", |
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
# grab an off the shelf container with cuda9 | |
FROM nvidia/cuda:9.0-devel-ubuntu16.04 | |
# update gcc to gcc-6 as the default gcc-5 is too old | |
RUN apt-get update && apt-get install -y software-properties-common wget git | |
RUN add-apt-repository ppa:ubuntu-toolchain-r/test | |
RUN apt-get update && apt-get install -y gcc-6 g++-6 | |
# update cmake as the default is too old | |
RUN wget -qO- "https://cmake.org/files/v3.15/cmake-3.15.1-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/ |
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
# A little bash script to download our juicy ONT PION data | |
# If this doesn't work for you, express your disappointment to @samstudio8. | |
# Use "EVEN" or "LOG" for $1, eg: `bash get_pion_signal.sh EVEN` | |
MODE=$1 | |
echo "Fetching signal blocks. Don't be afraid to CRTL+C and resume if needed..." | |
for i in {00..25} | |
do | |
echo $i; | |
wget -c https://nanopore.s3.climb.ac.uk/Zymo-PromethION-$MODE-BB-SN_signal.tar.$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
import sys | |
THRESHOLD = 0.25 # reads must have 25% of their k-mers assigned | |
for line in sys.stdin: | |
fields = line.strip().split() | |
kmers_fields = fields[4:] | |
total_kmers = sum([int(x.split(":")[1]) for x in kmers_fields]) | |
unassigned_kmers = sum([int(x.split(":")[1]) for x in kmers_fields if x[0] == "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
PATH=$PATH:/home/ubuntu/ware/blast/ncbi-blast-2.7.1+/bin; | |
kraken2-build --download-taxonomy --threads 24 --db /working/databases/kraken2-test/ | |
kraken2-build --download-library archaea --db /working/databases/kraken2-test/ | |
kraken2-build --download-library bacteria --db /working/databases/kraken2-test/ | |
kraken2-build --download-library fungi --db /working/databases/kraken2-test/ | |
kraken2-build --download-library protozoa --db /working/databases/kraken2-test/ | |
kraken2-build --download-library viral --db /working/databases/kraken2-test/ | |
kraken2-build --download-library UniVec_Core --db /working/databases/kraken2-test/ | |
kraken2-build --threads 24 --build --db /working/databases/kraken2-test/ |
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 fitbit | |
import gather_keys_oauth2 as Oauth2 | |
import datetime | |
CLIENT_ID = 'YOUR CLIENT' | |
CLIENT_SECRET = 'YOUR SECRET' | |
server = Oauth2.OAuth2Server(CLIENT_ID, CLIENT_SECRET) | |
server.browser_authorize() | |
ACCESS_TOKEN = str(server.fitbit.client.session.token['access_token']) |
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
y3 = [86,90,90,68,86,79,79,78,61,62,45,60] | |
y2 = [81,81,79,79,77,73,55,55,86,84,83,81] | |
# 8 modules per band | |
BAND_SIZE = 8 | |
BAND_DELTA = len(y3) - BAND_SIZE | |
# Extract BAND_SIZE best year 3 modules | |
y3_sorted = sorted(y3) | |
band_3 = y3_sorted[-BAND_SIZE:] |
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
""" | |
A scrappy esoteric glue program for Ben because he only really likes databases. | |
Given a tab delimited file where: | |
fields[0] ORF id | |
fields[1] 1-pos Start | |
fields[2] 1-pos End | |
fields[-1] Structural Prediction Code | |
Output a cast dataframe with a line per ORF, describing all structural predictions | |
for that ORF as a single string. Additionally enumerating each viable code's proportion | |
of that string as a percentage. You may alter CODES to add/remove prediction codes |
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
Program received signal SIGSEGV, Segmentation fault. | |
_int_malloc (av=av@entry=0x7ffff7dd6b40 <main_arena>, bytes=bytes@entry=24) at malloc.c:3803 | |
3803 set_head (remainder, remainder_size | PREV_INUSE); | |
(gdb) bt | |
#0 _int_malloc (av=av@entry=0x7ffff7dd6b40 <main_arena>, bytes=bytes@entry=24) at malloc.c:3803 | |
#1 0x00007ffff7a9e950 in __GI___libc_malloc (bytes=24) at malloc.c:2914 | |
#2 0x0000000000400812 in main () |