Skip to content

Instantly share code, notes, and snippets.

View rpetit3's full-sized avatar
🦬
Yo!

Robert A. Petit III rpetit3

🦬
Yo!
View GitHub Profile
@rpetit3
rpetit3 / setup-bactopia-aws.sh
Last active January 18, 2022 22:38
Bactopia AWS Notes
# The Base AMI should be an ECS-optimized Amazon Linux 2 AMI
# Create the AMI with ~30-50GB of storage to allow for programs and temporary storage.
sudo yum install -y bzip2 wget git emacs
# Install AWS CLI to ${HOME}
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh -b -f
~/miniconda3/bin/conda init bash
source ~/.bashrc
@rpetit3
rpetit3 / basic_breseq.nf
Last active December 9, 2019 18:11
Example workflow for Breseq using Nextflow
#!/usr/bin/env nextflow
// Input parameters
params.genbank = "./NRS384.gbk"
params.fastq = "fastq_files"
params.pattern = "N*P{1,2}_trim.fq.gz"
params.outdir = "breseq_analysis_results"
// Reference and paired read channels
fastq_file_path = "$params.fastq/${params.pattern}"
@rpetit3
rpetit3 / singularity-setup.sh
Created October 24, 2019 10:11
Setup of Singularity on local servers
sudo apt-get update && sudo apt-get install -y \
build-essential \
libssl-dev \
uuid-dev \
libgpgme11-dev \
squashfs-tools \
libseccomp-dev \
pkg-config \
git \
cryptsetup-bin \
@rpetit3
rpetit3 / narsa-coverage.R
Created September 12, 2019 12:58
plotting narsa coverages
library("ggplot2")
files <-dir("/home/rpetit/projects/narsa/remaps/coverages_agr", pattern =".txt")
for(iin1:length(files)) {
name <-gsub("-cov.txt$", "", files[i])
# Read Coverage File
file_path =paste0("/home/rpetit/projects/narsa/remaps/coverages_agr/", files[i])
coverage <-read.table(file_path, sep="\t", header=FALSE)
colnames(coverage) <-c("reference", "position", "coverage")
max_x =nrow(coverage)
max_y =max(coverage$coverage) + 10
# ===========================================================================
#
# PUBLIC DOMAIN NOTICE
# National Center for Biotechnology Information
#
# This software/database is a "United States Government Work" under the
# terms of the United States Copyright Act. It was written as part of
# the author's official duties as a United States Government employee and
# thus cannot be copyrighted. This software/database is freely available
# to the public for use. The National Library of Medicine and the U.S.
@rpetit3
rpetit3 / staphopia.nf
Created October 20, 2017 13:30
Nextflow workflow
#!/usr/bin/env nextflow
params.output = null
params.sample = null
params.fq1 = null
params.fq2 = null
params.cpu = 1
params.coverage = 100
params.is_paired = false
params.no_length_filter = false
@rpetit3
rpetit3 / rufus-cleanup.py
Created October 18, 2017 23:08
Ruffus version of FASTQ clean up
#! /usr/bin/env python
"""Clean up an input FASTQ file."""
import sys
from ruffus import *
from staphopia.helpers.time_job import time_job
from staphopia.tasks import fastq, shared
parser = cmdline.get_argparse(description='Cleanup FASTQ files')
@rpetit3
rpetit3 / Snakefile
Created October 18, 2017 23:06
FASTQ cleanup using Snakemake
PATH = '/home/rpetit/staphopia/apps/analysis-pipeline'
sample = 'N315_R1'
rule all:
input:
'analyses/fastq-stats/{sample}.cleanup.fastq.json'.format(
sample=sample
)
rule bbduk_phix:
@rpetit3
rpetit3 / elasticsearch.default
Last active January 11, 2017 22:32
Staphopia Elasticsearch Defaults(/etc/default/elasticsearch)
################################
# Elasticsearch
################################
# Elasticsearch home directory
ES_HOME=/usr/share/elasticsearch
# Elasticsearch Java path
#JAVA_HOME=
@rpetit3
rpetit3 / elasticsearch.yml
Last active January 11, 2017 22:38
Staphopia elasticsearch.yml For Data Nodes
# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
# Before you set out to tweak and tune the configuration, make sure you
# understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please see the documentation for further information on configuration options: