Skip to content

Instantly share code, notes, and snippets.

View meren's full-sized avatar

A. Murat Eren (Meren) meren

View GitHub Profile
https://www.dropbox.com/scl/fi/eg9rki2bld2u24bdjy542/PROTEIN-STRUCURES.pptx?rlkey=exrmkb6pfakunhsfqnokjawpm&dl=0
@meren
meren / anvi-ubuntu-setup.sh
Last active November 1, 2022 12:59
Install anvi'o with all its dependencies on an Ubuntu 14.04 & 16.04
#!/bin/bash
# save this file somewhere on your disk. open your terminal, and go there. then type these commands:
#
# chmod +x anvi-ubuntu-setup.sh
# ./anvi-ubuntu-setup.sh
#
# and then get some coffee, and come back to see whether it's your lucky day.
set -e
#!/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
@meren
meren / gist:f8debee8322f40c2ddde
Last active October 17, 2021 12:17
Making an anvi'o release
#################################################################################
#
# PREPARING RELEASE NOTES FOR A MAJOR RELEASE
#
#################################################################################
# if this is a major release,
# prepare a new logo.
# prepare comprehensive release notes. see examples for release notes here:
# https://github.com/meren/anvio/releases
@meren
meren / simple_for_loop_for_mapping.sh
Last active November 30, 2020 21:47
A simple loop to serially map all samples.
#!/bin/bash
# A simple loop to serially map all samples.
# referenced from within http://merenlab.org/tutorials/assembly_and_mapping/
# how many threads should each mapping task use?
NUM_THREADS=4
for sample in `awk '{print $1}' samples.txt`
do
@meren
meren / get_genes.py
Created August 11, 2020 17:27
Get gene calls and their sequences from an anvi'o contigs database
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)
@meren
meren / gff_parser.py
Last active July 21, 2020 12:58
An update to Antti Karkman's GFF parser. Find the latest version here: https://github.com/karkman/gff_parser
#!/usr/bin/env python
## Antti Karkman
## University of Gothenburg
## antti.karkman@gmail.com
## 2017
import gffutils
import argparse
@meren
meren / gen_primer_match_report.py
Last active June 19, 2020 23:57
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.
# 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
import sys
import IlluminaUtils.lib.fastqlib as u
import IlluminaUtils.lib.fastalib as f
from IlluminaUtils.utils.helperfunctions import reverse_complement
# call this script like this:
#
# python demultiplex.py barcode_to_sample_name_file index_fastq_file quality_filtered_fasta_file
#
# expected file formats are shown below.
@meren
meren / 01-gen-nucmer-jobs.py
Last active July 30, 2019 04:18
Poor man's redundancy removal scripts. Until we incorporate this logic into anvi'o.
#!/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