Skip to content

Instantly share code, notes, and snippets.

View wilkox's full-sized avatar

David Wilkins wilkox

  • Adelaide, Australia
  • 11:25 (UTC +10:30)
View GitHub Profile
# Libraries
library(readr)
library(SpiecEasi)
library(phyloseq)
library(tibble)
library(igraph)
library(dplyr)
library(stringr)
library(tidyr)
library(ggplot2)
# Libraries
library(readr)
library(SpiecEasi)
library(phyloseq)
library(tibble)
library(igraph)
library(dplyr)
library(stringr)
library(tidyr)
library(ggplot2)
#!/usr/bin/perl
use Modern::Perl 2014;
use autodie;
use Term::ProgressBar;
use File::CountLines qw(count_lines);
$|++;
# Inputs
my $OTUPath = './otu_list.txt';
#!/usr/bin/perl
use Modern::Perl 2014;
use autodie;
use Term::ProgressBar;
use File::CountLines qw(count_lines);
$|++;
# Inputs
my $OTUPath = './otu_list.txt';
# This ‘if’ block only runs if no directory named ‘source_predictions’ exists
# already
if [ ! -d "source_predictions" ]; then \
# Create a ‘source_predictions’ directory
mkdir source_predictions; \
fi # ‘fi’ means ‘end of the if block’
# Look for files in the $ROOTDIR/maps directory using the unix ‘find’ command,
# and run a loop over these files, assigning the name of the file to the
#!/usr/bin/perl
use Modern::Perl 2014;
use autodie;
$|++;
# Store sequence
my $seq;
# Read from argument or from STDIN
#!/usr/bin/perl
# This script reads from standard input or a filename supplied as an argument,
# and writes to standard output. So an example usage:
# perl select_reads_by_length.pl sample123.fasta > sample123_filtered.fasta
use Modern::Perl 2014;
use autodie;
use experimental 'smartmatch';
$|++;
#!/usr/bin/perl
use Modern::Perl 2014;
use autodie;
use File::CountLines qw(count_lines);
$|++;
my $forwardFile = "forward.fasta";
say "Processing $forwardFile...";
my %sequences;
@wilkox
wilkox / draw_network_diagram.R
Created September 24, 2014 01:38
Draw coabundance network
#Libraries
library(network)
library(sna)
#Load sample metadata
Samples <- read.tidy("../samples/samples.txt")
#Routine to do coabundance plot for given factor level(s)
do.plot <- function(Description) {
@wilkox
wilkox / calculate_pseudo_p_values.sh
Created September 24, 2014 01:37
Calculate pseudo p-values
#!/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