Skip to content

Instantly share code, notes, and snippets.

View rpetit3's full-sized avatar
🐫
I may be slow to respond.

Robert A. Petit III rpetit3

🐫
I may be slow to respond.
View GitHub Profile
# ===========================================================================
#
# 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 / 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
@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 / 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 / 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 / main.nf
Created November 15, 2020 06:24
bactopia-wrapper-nextflow
#! /usr/bin/env nextflow
import groovy.json.JsonSlurper
import groovy.text.SimpleTemplateEngine
import groovy.util.FileNameByRegexFinder
import java.nio.file.Path
import java.nio.file.Paths
import nextflow.util.SysHelper
PROGRAM_NAME = workflow.manifest.name
VERSION = workflow.manifest.version
@rpetit3
rpetit3 / readme.md
Last active December 31, 2020 19:19
Setup NCOV

Started here: https://nextstrain.org/docs/getting-started/introduction

Installation

Installed on Chlamy (behind Emory VPN)

mkdir nextstrain
cd nextstrain
curl http://data.nextstrain.org/nextstrain.yml --compressed -o nextstrain.yml
conda env create -f nextstrain.yml
conda activate nextstrain
@rpetit3
rpetit3 / HCMVL54.fasta
Last active March 2, 2021 14:59
Convert FASTA gene seqeunce to codon with position info
>X17403.1:c80631-76903 Human cytomegalovirus strain AD169 complete genome
ATGTTTTTCAACCCGTATCTGAGCGGCGGCGTGACCGGCGGTGCGGTCGCGGGTGGCCGGCGTCAGCGTT
CGCAGCCCGGCTCCGCGCAGGGCTCGGGCAAGCGGCCGCCACAGAAACAGTTTTTGCAGATCGTGCCGCG
AGGTGTCATGTTCGACGGTCAGACGGGGTTGATCAAGCATAAGACGGGACGGCTGCCTCTCATGTTCTAT
CGAGAGATTAAACATTTGTTGAGTCATGACATGGTTTGGCCGTGTCCTTGGCGCGAGACCCTGGTGGGTC
GCGTGGTGGGACCTATTCGTTTTCACACCTACGATCAGACGGACGCCGTGCTCTTCTTCGACTCGCCCGA
AAACGTGTCGCCGCGCTATCGTCAGCATCTGGTGCCTTCGGGGAACGTGTTGCGTTTCTTCGGGGCCACA
GAACACGGCTACAGTATCTGCGTCAACGTTTTCGGGCAGCGCAGCTACTTTTACTGTGAGTACAGCGACA
CCGATAGGCTGCGTGAGGTCATTGCCAGCGTGGGCGAACTAGTGCCCGAACCGCGGACGCCATACGCCGT
GTCTGTCACGCCGGCCACCAAGACCTCCATCTATGGGTACGGGACGCGACCCGTGCCCGATTTGCAGTGT
@rpetit3
rpetit3 / BaseSpaceRunDownloader_v2.py
Created June 9, 2021 15:55
Script to download projects from BaseSpace
from urllib2 import Request, urlopen, URLError
import json
import math
import sys
import os
import socket
import optparse
def arg_parser():
cwd_dir = os.getcwd()
@rpetit3
rpetit3 / compare-coverages.sh
Last active July 23, 2021 18:48
Comparing Clearlabs reported coverage to observed coverage
#! /usr/bin/env bash
# https://www.ncbi.nlm.nih.gov/nuccore/1798174254
WUHAN=29903
while IFS=$'\t' read -r POSITION SAMPLE_ID ANALYSIS SEQUENCING_COVERAGE ASSEMBLY_COVERAGE; do
if [ "${POSITION}" == "POSITION" ]; then
printf "%s\t%s\t%s\t%s\t%s\n" "sample_id" "clearlabs_cov" "observed_cov" "mapped_coverage" "unmapped_coverage"
else
FASTQ=$(ls fastq/ | grep ${SAMPLE_ID})
if [ -f "fastq/${FASTQ}" ]; then