Skip to content

Commit

Permalink
Added connected components output as discussed in #13. Updated sphere…
Browse files Browse the repository at this point in the history
…s clustering centroid selection (not yet optimal). Changed Eduard's e-mail address in src files. Added article citation to README files.
  • Loading branch information
ezorita committed Mar 18, 2016
1 parent 445e909 commit 87cf36d
Show file tree
Hide file tree
Showing 7 changed files with 235 additions and 60 deletions.
7 changes: 7 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -268,3 +268,10 @@ VII. References
[2] Needleman, S.B. and Wunsch, C.D. (1970), 'A general method applicable
to the search for similarities in the amino acid sequence of two
proteins' J. Mol. Biol., 48 (3), 443-53.

VIII. Citation
--------------

If you use our software, please cite:

Zorita E, Cusco P, Filion GJ. 2015. Starcode: sequence clustering based on all-pairs search. Bioinformatics 31 (12): 1913-1919.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,3 +289,10 @@ VII. References
[2] Needleman, S.B. and Wunsch, C.D. (1970), 'A general method applicable
to the search for similarities in the amino acid sequence of two
proteins' J. Mol. Biol., 48 (3), 443-53.

VIII. Citation
--------------

If you use our software, please cite:

Zorita E, Cusco P, Filion GJ. 2015. [Starcode: sequence clustering based on all-pairs search.](http://bioinformatics.oxfordjournals.org/content/31/12/1913.abstract) Bioinformatics 31 (12): 1913-1919.
24 changes: 20 additions & 4 deletions src/main-starcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
**
** File authors:
** Guillaume Filion (guillaume.filion@gmail.com)
** Eduard Valera Zorita (ezorita@mit.edu)
** Eduard Valera Zorita (eduardvalera@gmail.com)
**
** License:
** This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -45,11 +45,14 @@ char *USAGE =
" general options:\n"
" -d --dist: maximum Levenshtein distance (default auto)\n"
" -t --threads: number of concurrent threads (default 1)\n"
" -r --cluster-ratio: minumum cluster size ratio (default 5)\n"
" -s --sphere: sphere clustering (default message passing)\n"
" -q --quiet: quiet output (default verbose)\n"
" -v --version: display version and exit\n"
"\n"
" cluster options: (default algorithm: message passing)\n"
" -r --cluster-ratio: minumum cluster size ratio (message passing, default 5)\n"
" -s --sphere: use sphere clustering algorithm\n"
" -c --connected-comp: print connected components\n"
"\n"
" input/output options (single file, default)\n"
" -i --input: input file (default stdin)\n"
" -o --output: output file (default stdout)\n"
Expand Down Expand Up @@ -125,6 +128,7 @@ main(
static int vb_flag = 1;
static int cl_flag = 0;
static int id_flag = 0;
static int cp_flag = 0;

// Unset flags (value -1).
int dist = -1;
Expand Down Expand Up @@ -152,6 +156,7 @@ main(
{"non-redundant", no_argument, &nr_flag, 1 },
{"quiet", no_argument, &vb_flag, 0 },
{"sphere", no_argument, &sp_flag, 's'},
{"connected-comp", no_argument, &cp_flag, 'c'},
{"version", no_argument, 0, 'v'},
{"dist", required_argument, 0, 'd'},
{"cluster-ratio", required_argument, 0, 'r'},
Expand All @@ -164,7 +169,7 @@ main(
{0, 0, 0, 0}
};

c = getopt_long(argc, argv, "1:2:d:hi:o:qst:r:v",
c = getopt_long(argc, argv, "1:2:d:hi:o:qcst:r:v",
long_options, &option_index);

// Done parsing //
Expand Down Expand Up @@ -249,6 +254,10 @@ main(
sp_flag = 1;
break;

case 'c':
cp_flag = 1;
break;

case 't':
if (threads < 0) {
threads = atoi(optarg);
Expand Down Expand Up @@ -347,10 +356,17 @@ main(
say_usage();
return EXIT_FAILURE;
}
if (sp_flag && cp_flag) {
fprintf(stderr, "%s --sphere and --connected-comp are "
"incompatible\n", ERRM);
say_usage();
return EXIT_FAILURE;
}

// Set output type. //
int output_type;
if (nr_flag) output_type = PRINT_NRED;
else if (cp_flag) output_type = COMPONENTS_OUTPUT;
else if (sp_flag) output_type = SPHERES_OUTPUT;
else output_type = DEFAULT_OUTPUT;

Expand Down
Loading

0 comments on commit 87cf36d

Please sign in to comment.