Sha256: 8fb7902882e7dcc31916d81d5d2abf806716fc4e259b3ccbcb5edf706e78af0c

Contents?: true

Size: 1.29 KB

Versions: 37

Compression:

Stored size: 1.29 KB

Contents

#!/bin/bash

set -e
set -x

# Hierarchical OTU clustering
# Austin G. Davis-Richardson
# <harekrishna at gmail dot com>
# http://github.com/audy/lederhosen

reads='sorted.fasta'
out='h_clustering'

mkdir -p $out

# initial clustering at 80%
lederhosen cluster --input=$reads --output=$out/clusters_0.80.uc --identity=0.80

# filter UC file
lederhosen uc_filter --input=$out/clusters_0.80.uc --output=$out/clusters_0.80.uc.filtered --reads=1 --samples=1

# get reads for each cluster
mkdir -p $out/split_80
lederhosen split --clusters=$out/clusters_0.80.uc.filtered --reads=$reads --out-dir=$out/split_80/

# now cluster each of those at 90%
for fasta in $out/split_80/*.fasta
do

  # sort (awww, do I really have to do this again?)
  lederhosen sort --input=$fasta --output=$fasta.sorted

  # cluster
  lederhosen cluster --input=$fasta.sorted --output=$fasta.uc --identity=0.90

  # split
  split=$out/split_80.90_$(basename $fasta .fasta)
  lederhosen split --clusters=$fasta.uc --reads=$fasta --out-dir=$split
done

# Do it again at 95%
for fasta in $out/split_80/split_*_90.fasta/*.fasta
do
  # cluster
  lederhosen cluster --input=$fasta --output=$fasta.uc --identity=90

  # split
  split=$outdir/80.90.$fasta.fasta
  mkdir -p $split
  lederhosen split --clusters=$fasta.uc --reads=$input --out-dir=$split
done

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
lederhosen-1.0.1 examples/hierarchical_clustering.sh
lederhosen-1.0.0 examples/hierarchical_clustering.sh
lederhosen-0.5.7 examples/hierarchical_clustering.sh
lederhosen-0.5.6 examples/hierarchical_clustering.sh
lederhosen-0.5.5 examples/hierarchical_clustering.sh
lederhosen-0.5.4 examples/hierarchical_clustering.sh
lederhosen-0.5.2 examples/hierarchical_clustering.sh
lederhosen-0.5.1 examples/hierarchical_clustering.sh
lederhosen-0.5.0 examples/hierarchical_clustering.sh
lederhosen-0.4.0 examples/hierarchical_clustering.sh
lederhosen-0.3.9 examples/hierarchical_clustering.sh
lederhosen-0.3.8 examples/hierarchical_clustering.sh
lederhosen-0.3.7 examples/hierarchical_clustering.sh
lederhosen-0.3.6 examples/hierarchical_clustering.sh
lederhosen-0.3.5 examples/hierarchical_clustering.sh
lederhosen-0.3.4 examples/hierarchical_clustering.sh
lederhosen-0.3.3 examples/hierarchical_clustering.sh
lederhosen-0.3.2 examples/hierarchical_clustering.sh
lederhosen-0.3.1 examples/hierarchical_clustering.sh
lederhosen-0.3.0 examples/hierarchical_clustering.sh