Skip to content

Instantly share code, notes, and snippets.

View wilkox's full-sized avatar

David Wilkins wilkox

  • Adelaide, Australia
  • 03:34 (UTC +10:30)
View GitHub Profile
@wilkox
wilkox / run_SparCC.sh
Created September 24, 2014 01:36
Run SparCC
#!/bin/bash
#
#PBS -l nodes=1:ppn=16
#PBS -j oe
#PBS -k oe
date
#Set base dir and SparCC path
if [ `hostname` == "Davids-MacBook-Air.local" ]; then
@wilkox
wilkox / prepare_tables_for_sparcc.R
Created September 24, 2014 01:36
Prepare OTU tables for SparCC
#Prepare output directories
system("rm -rf OTU_tables")
system("mkdir OTU_tables")
#Load OTU table
OTUTable <- read.tidy.dt("../picked_OTUs_winter_forward/final_otu_table_mc2.clean.tidy.txt")
#Load sample metadata
Samples <- read.tidy("../samples/samples.txt")
#!/usr/bin/perl
use Modern::Perl 2014;
use autodie;
use Getopt::Long;
use File::Slurp qw(read_file);
$|++;
my $USAGE = q/USAGE:
perl select_OTUs_and_samples.pl -m <map file> -o <list of OTUs> -s <list of samples> -f <reads fasta file> -u <output fasta file>
#Load OTU table
OTUTable <- read.tidy("../picked_OTUs_forward/final_otu_table_mc2_w_taxonomy.clean.tidy.txt")
#Add sample data
Samples <- read.tidy("../samples/samples.txt")
OTUTable <- merge(OTUTable, Samples[c("Sample", "Location", "Type")], by = "Sample", all.x = TRUE)
#Select skin/surface samples
OTUTable <- OTUTable[which(OTUTable$Type %in% c("Skin", "Surface")), ]
#Libraries
library(wilkoxmisc)
#Global variables
OTUTablePath <- "PUT-PATH-HERE" #This is the OTU table with taxonomy
ContaminantOTUPath <- "PUT-PATH-HERE" #This is the list of contaminant OTUs
PlotPath <- "PUT-PATH-HERE" #This is where the plot will be written, should end in .pdf
BlankSamples <- c("Blk", "Blk2") #These are the blank samples
#Read in OTU table
@wilkox
wilkox / classify_contaminants.R
Created July 14, 2014 01:32
Classify contaminants by lineage
#Libraries
library(wilkoxmisc)
#Global variables
OTUTablePath <- "PUT-PATH-HERE" #This is the OTU table with taxonomy
ContaminantOTUPath <- "PUT-PATH-HERE" #This is where the list of contaminant OTUs will be written
ContaminantLineagePath <- "PUT-PATH-HERE" #This is where the list of contaminant lineages will be written
BlankSamples <- c("Blk", "Blk2") #These are the blank samples
CutoffValue <- 0.01 #This is the threshold relative abundance for a lineage to be a contaminant
Sample Digester Substrate Year Replicate
GZ-cell-35-1 GZ Cellulose 2 1
GZ-cell-35-2 GZ Cellulose 2 2
GZ-cell-35-3 GZ Cellulose 2 3
GZ-cell-35-4 GZ Cellulose 2 4
GZ-cell-35-gDNA GZ Cellulose 1
GZ-xylan-35-1 GZ Xylan 2 1
GZ-xylan-35-2 GZ Xylan 2 2
GZ-xylan-35-3 GZ Xylan 2 3
GZ-xylan-35-4 GZ Xylan 2 4
#SampleID BarcodeSequence LinkerPrimerSequence
ADMa2BHBSPR
ADMa2SWCWINT
ADMa2RMCWINT
ADMa2BHBWINT
ADMa2TFBWINT
ADMa3ZLPWIN
ADMa2TFBSPR
ADMa2BLKWINT
ADMa2SWCSPR
#!/bin/bash
#
#PBS -l nodes=compute-1-19:ppn=16
#PBS -j oe
#PBS -k oe
date
#Set base directory
if [ `hostname` == "Davids-MacBook-Air.local" ]; then
#!/bin/bash
#
#PBS -l nodes=1:ppn=16
#PBS -j oe
#PBS -k oe
date
#Set base dir
if [ `hostname` == "Davids-MacBook-Air.local" ]; then