Skip to content

ndaniels/cluster-barcodes

Repository files navigation

cluster-barcodes

This is a simple tool for clustering genetic barcodes associated with named samples.

It assumes an input file which is tab-delimited, whose first field contains a sample identifier and whose second field contains a genetic barcode. Bases labelled 'N' and 'X' represent 'no call' and 'multiple call' respectively.

Output is in DOT format, which can be read by Graphviz or Omnigraffle, among other tools.

Clusters are based on exact barcode matches; each node in the graph represents a set of samples with identical barcodes. Nodes with ambiguous (containing 'X' or 'N') barcodes are colored red. Barcodes with >1 'N' or >5 ('X' + 'N') are dropped. Edges are drawn between nodes whose barcodes have a Hamming distance of exactly 1 ('N' and 'X' entries do not count towards Hamming distance).

Two kinds of clusters are possible: by barcode (-c option), and by barcode/year (-l option, longitudinal clustering).

Barcode clustering can also be run with weighted edges (-w option), where the weight is the Hamming distance between clusters, whenever that distance is less than or equal to some threshold. Currently this is hardcoded to a threshold of 3.

In longitudinal clustering, 'N' and 'X' entries DO count towards Hamming distance.

Usage: cluster-barcodes [-l|-c|-w] input.txt output.dot

Build instructions

  • You must have the GHC haskell compiler. Haskell Platform is recommended.
  • From the source directory, run cabal install

About

Simple tool to cluster genetic barcodes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published