View get_genes.py
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 anvio.dbops import ContigsSuperclass | |
# if your args object contains a `contigs_db` entry in its | |
# namespace all you don't need the following two lines and | |
# you can directly pass it to the ContigsSuperclass. | |
import argparse | |
args = argparse.Namespace(contigs_db="INFANT-GUT-TUTORIAL/SPLITAH/E_facealis/CONTIGS.db") | |
# get an instance of the contigs super: | |
contigs_db = ContigsSuperclass(args) |
View gff_parser.py
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 | |
## Antti Karkman | |
## University of Gothenburg | |
## antti.karkman@gmail.com | |
## 2017 | |
import gffutils | |
import argparse |
View anvi-script-gen-alluvial
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 | |
# lousy script that works with the outputs of `anvi-export-collection` | |
# to reconcstruct the fate of contigs for a given algorithm and bin and | |
# spit out some text to be visualized on https://app.rawgraphs.io/ | |
import sys | |
from collections import OrderedDict |
View fastalib.py
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 -*- | |
# pylint: disable=line-too-long | |
# v.140713 | |
"""A very lightweight FASTA I/O library""" | |
import io | |
import sys | |
import gzip | |
import numpy | |
import hashlib |
View summarize_blast_results.py
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 | |
# Click 'Download > Multiple-file JSON' from NCBI search results page, | |
# unzip it, run this script in it without any parameters, get the | |
# markdown formatted table. | |
import json | |
import glob | |
# poor man's whatever: |
View Oligotyping_Dockerfile_v2.1.sh
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 ubuntu:xenial | |
ENV OLIGOTYPING_VERSION 2.1 | |
ENV DEBIAN_FRONTEND noninteractive | |
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9 | |
RUN apt-get update | |
RUN apt-get install locales | |
RUN locale-gen en_US.UTF-8 |
View for_steve.py
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
>>> n = 21 | |
>>> (n * n - n) / 2 | |
210 | |
>>> | |
>>> l = ['Cys', 'Asp', 'Ser', 'Gln', 'Lys', 'Trp', 'Pro', 'Thr', 'Ile', 'Ala', 'Phe', 'Gly', 'His', 'STP', 'Leu', 'Arg', 'Met', 'Glu', 'Asn', 'Tyr', 'Val'] | |
>>> len(l) | |
21 | |
>>> len(set(sorted([''.join(sorted([t[0], t[1]])) for t in list(itertools.product(l, l)) if t[0] != t[1]]))) | |
210 | |
>>> |
View gen_primer_match_report.py
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
# run this script like this: | |
# | |
# python gen_primer_match_report.py primers.txt sequences.txt | |
# | |
# it will generate a report file called `primer_matches_report.txt` | |
# | |
# example primers file (TAB-delimited, no spaces): | |
# | |
# name pair direction sequence | |
# PolF P1 F TGCGAYCCSAARGCBGACTC |
View external-genomes.txt
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
name contigs_db_path | |
Bacteroides_fragilis_2334 Bacteroides_fragilis_2334.db | |
Bacteroides_fragilis_2346 Bacteroides_fragilis_2346.db | |
Bacteroides_fragilis_2347 Bacteroides_fragilis_2347.db | |
Escherichia_albertii_6917 Escherichia_albertii_6917.db | |
Escherichia_coli_6920 Escherichia_coli_6920.db | |
Escherichia_coli_9038 Escherichia_coli_9038.db | |
Prevotella_dentalis_19591 Prevotella_dentalis_19591.db | |
Prevotella_denticola_19594 Prevotella_denticola_19594.db | |
Prevotella_intermedia_19600 Prevotella_intermedia_19600.db |
View boxes.R
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 Rscript | |
library(reshape) | |
library(ggplot2) | |
# set the work directory | |
setwd('~/Downloads') | |
# matrix-boxplots.txt should be a three-column, TAB-delimited matrix with a header for 'region', 'haplotype', and 'ratio'. | |
m <- data.frame(read.table('matrix-boxplots.txt', header = TRUE, sep="\t")) |
NewerOlder