#!/usr/bin/env Rscript
###############################################################################
# #
# Copyright (c) 2013 J. Craig Venter Institute. #
# All rights reserved. #
# #
###############################################################################
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see . #
# #
###############################################################################
###############################################################################
library('getopt');
params=c(
"input_file", "i", 1, "character",
"output_file", "o", 1, "character",
"max_size", "m", 1, "character", #maximum size of a cluster
"num_clusters", "n", 1, "character" #optimal number of clusters to generate
);
opt=getopt(spec=matrix(params, ncol=4, byrow=TRUE), debug=FALSE);
script_name=unlist(strsplit(commandArgs(FALSE)[4],"=")[1])[2];
usage = paste (
"\nUsage:\n\n", script_name,
"\n",
" -i \n",
" -o