Skip to content

Instantly share code, notes, and snippets.

View wilkox's full-sized avatar

David Wilkins wilkox

  • Adelaide, Australia
  • 20:47 (UTC +10:30)
View GitHub Profile
@wilkox
wilkox / plot_OTU_table.R
Created June 26, 2014 07:54
Script to plot OTU table
#Load libraries
library(wilkoxmisc)
library(ggplot2)
#Read OTU table
OTUTable <- read.tidy("./yangyang_OTU_table.txt")
#Add relative abundance
OTUTable <- add.relative.abundance(OTUTable)
#Load wilkoxmisc
library(wilkoxmisc)
#OTU Table with taxonomy
OTUTableWithTaxonomy <- "PUT-PATH-HERE"
#List of blank samples
BlankSamples <- c("Blk", "Blk2")
#Read in OTU table and select blank
#!/usr/bin/perl
use Modern::Perl 2014;
use autodie;
$|++;
open FAILED, "<", "./aligned/rep_set_failures.fasta";
open OUT, ">", "rep_set_failures.tidy.txt";
say OUT "OTU";
say "Reading failed rep set sequences...";
#Load wilkoxmisc
library(wilkoxmisc)
#List of paths
OTUTablePath <- "PUT-PATH-HERE"
ContaminantsPath <- "PUT-PATH-HERE"
ChimerasPath <- "PUT-PATH-HERE"
FailedAlignmentPath <- "PUT-PATH-HERE"
OutputPath <- "PUT-PATH-HERE"
OutputPathWithTaxonomy <- "PUT-PATH-HERE"
#!/usr/bin/perl
use Modern::Perl 2014;
use autodie;
use File::CountLines qw(count_lines);
$|++;
my $readsFile = 'PUT-PATH-HERE'; #This is the input read set e.g. forward.fasta
my $prefilterFile = 'PUT-PATH-HERE'; #This is the list of PyNAST failures, something like forward_failures.txt
my $mc1 = 'PUT-PATH-HERE'; #This is final_otu_map.txt
#Required libraries
library(wilkoxmisc)
library(ggplot2)
#Files
BreakdownStatisticsFile <- "PUT-PATH-HERE"
#Read in breakdown
Breakdown <- read.tidy(BreakdownStatisticsFile)
#!/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
#Load wilkoxmisc
library(wilkoxmisc)
#Read in OTU table
OTUTable <- read.tidy("final_otu_table_mc2_w_taxonomy.clean.tidy.txt")
#Separate bacteria and archaea
Bacteria <- OTUTable[which(OTUTable$Kingdom == "Bacteria"), ]
Archaea <- OTUTable[which(OTUTable$Kingdom == "Archaea"), ]
#Files
CleanOTUTablePath <- "PUT-PATH-HERE"
CastCleanOTUTablePath <- "PUT-PATH-HERE" #This will be the output file
#Load libraries
library(wilkoxmisc)
library(reshape2)
#Read in OTU table
OTUCounts <- read.tidy(CleanOTUTablePath)
#!/bin/sh
biom convert -i CAST_OTU_TABLE -o OUTPUT_PATH --table-type="otu table"