Skip to content

Instantly share code, notes, and snippets.

A. Murat Eren meren

Block or report user

Report or block meren

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View fastalib.py
# -*- 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
#!/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
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
>>> 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
>>>
@meren
meren / gen_primer_match_report.py
Last active Jul 13, 2017
Generate a report for primer matching statistics (here you will find the Python program, two example input files (nifH gene primers and full-length nifH genes), and an example terminal output). You will need to have anvi'o installed on your system to run it. For questions: meren at uchicago.edu or tdelmont at uchicago.edu.
View gen_primer_match_report.py
# 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
@meren
meren / external-genomes.txt
Last active Jun 8, 2017
Phylogenomic tutorial helper files
View external-genomes.txt
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
#!/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"))
@meren
meren / Dockerfile_v5.5.sh
Last active May 1, 2019
Docker file for anvi'o versions
View Dockerfile_v5.5.sh
FROM ubuntu:xenial
ENV ANVIO_VERSION 5.5
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update
RUN apt-get install locales
RUN locale-gen en_US.UTF-8
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
@meren
meren / 01-gen-nucmer-jobs.py
Last active Jul 30, 2019
Poor man's redundancy removal scripts. Until we incorporate this logic into anvi'o.
View 01-gen-nucmer-jobs.py
#!/usr/bin/env python
# you run this first:
#
# python 01-gen-nucmer-jobs.py affiliations.txt MAGs_input_dir
#
import os
import sys
import anvio.fastalib as u
View ryans_pan_script.sh
#!/bin/bash
set -e
if [ "$#" -ne 1 ]; then
echo "You need to give a project name as an argument to this script (and it better be a single, short and descriptive word without funny characters). For instance, CMX_PAN_v5 would be a good one."
exit -1
fi
PROJECT=$1
You can’t perform that action at this time.