Skip to content

Instantly share code, notes, and snippets.

View meren's full-sized avatar

A. Murat Eren (Meren) meren

View GitHub Profile
#!/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 20:24
Docker file for anvi'o versions
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 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
#!/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
diff --git a/anvio/bottleroutes.py b/anvio/bottleroutes.py
index 6953f0a..400901d 100644
--- a/anvio/bottleroutes.py
+++ b/anvio/bottleroutes.py
@@ -224,7 +224,9 @@ def charts(d, split_name, show_outlier_SNVs=False):
layers = sorted(d.p_meta['samples'])
+ print('AM I OK? :(')
coverage_values_dict = d.split_coverage_values.get(split_name)
#!/bin/bash
# RUN THIS SCRIPT LIKE THIS:
#
# /groups/merenlab/merens-master-script-for-pangenomics.shx PROJECT_NAME E_MAIL
#
#
# This is how the samples.txt must look like (don't use anything but underscore character for sample names):
# sample fasta
# S_01 fasta-01.fa
# let's assume we have two FASTA files for two samples:
#
# sample_01: fasta_01.fa
# sample_02: fasta_02.fa
#
# genrating trna profile dtabases for each sample:
trna-profile fasta_01.fa --name sample_01 -o sample_01.db
trna-profile fasta_01.fa --name sample_01 -o sample_01.db
#!/bin/bash
# CALL THIS SCRIPT WITH A PROJECT NAME PARAMETER
set -e
PROJECT_NAME=$1
if [ ! -f "samples.txt" ]
then
@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
diff --git a/anvio/merger.py b/anvio/merger.py
index 1986e88..614f0b4 100644
--- a/anvio/merger.py
+++ b/anvio/merger.py
@@ -247,6 +247,8 @@ class MultipleRuns:
sample_profile_db = dbops.ProfileDatabase(runinfo['profile_db'], quiet = True)
sample_gene_profiles = sample_profile_db.db.get_table_as_dict(tables.gene_coverages_table_name, tables.gene_coverages_table_structure)
for g in sample_gene_profiles.values():
+ if not g['mean_coverage']:
+ g['mean_coverage'] = 0