Commit 6300f777 authored by Tatiana Rocher's avatar Tatiana Rocher

option -X <nb> added : segments nb clones then stop

parent 87f9642c
......@@ -3,10 +3,9 @@
WindowExtractor::WindowExtractor(): out_segmented(NULL), out_unsegmented(NULL), out_affects(NULL){}
WindowsStorage *WindowExtractor::extract(OnlineFasta *reads, MultiGermline *multigermline,
size_t w,
map<string, string> &windows_labels) {
map<string, string> &windows_labels, int stop_after) {
init_stats();
WindowsStorage *windowsStorage = new WindowsStorage(windows_labels);
......@@ -16,10 +15,12 @@ WindowsStorage *WindowExtractor::extract(OnlineFasta *reads, MultiGermline *mult
Germline *germline = *it ;
nb_reads_germline[germline->code] = 0;
}
while (reads->hasNext()) {
int stop=0;
while (reads->hasNext() && stop < stop_after) {
reads->next();
nb_reads++;
stop++;
if (out_affects) {
*out_affects << reads->getSequence();
......
......@@ -46,7 +46,7 @@ class WindowExtractor {
*/
WindowsStorage *extract(OnlineFasta *reads, MultiGermline *multigermline,
size_t w,
map<string, string> &windows_labels);
map<string, string> &windows_labels, int stop_after);
/**
* @return the average length of sequences whose segmentation has been classified as seg
......
......@@ -188,6 +188,9 @@ void usage(char *progname)
<< " -y <nb> maximal number of clones computed with a representative ('" << NO_LIMIT << "': no limit) (default: " << DEFAULT_MAX_REPRESENTATIVES << ")" << endl
<< " -z <nb> maximal number of clones to be segmented ('" << NO_LIMIT << "': no limit, do not use) (default: " << DEFAULT_MAX_CLONES << ")" << endl
<< " -A reports and segments all clones (-r 0 -% 0 -y " << NO_LIMIT << " -z " << NO_LIMIT << "), to be used only on very small datasets" << endl
////MODIF_TAT
<< " -X <nb> number of clones segmented, have to be combined with -A ('" << NO_LIMIT << "' : no limit) (default: " <<WARN_MAX_CLONES << ")" << endl
/////END_TAT
<< endl
<< "Fine segmentation options (second pass, see warning in doc/algo.org)" << endl
......@@ -284,6 +287,10 @@ int main (int argc, char **argv)
float ratio_reads_clone = DEFAULT_RATIO_READS_CLONE;
// int average_deletion = 4; // Average number of deletion in V or J
///MODIF_TAT
int max_clones_segmented = WARN_MAX_CLONES;
/// END_TAT
float ratio_representative = DEFAULT_RATIO_REPRESENTATIVE;
unsigned int max_auditionned = DEFAULT_MAX_AUDITIONED;
......@@ -313,7 +320,9 @@ int main (int argc, char **argv)
//$$ options: getopt
while ((c = getopt(argc, argv, "AhaiIg:G:V:D:J:k:r:vw:e:C:f:l:c:m:M:N:s:b:Sn:o:L%:y:z:uUK3")) != EOF)
//// MODIF_TAT : ajouter X: dans c
while ((c = getopt(argc, argv, "AX:haiIg:G:V:D:J:k:r:vw:e:C:f:l:c:m:M:N:s:b:Sn:o:L%:y:z:uUK3")) != EOF)
switch (c)
{
......@@ -472,6 +481,12 @@ int main (int argc, char **argv)
max_clones = -1 ;
break ;
////MODIF_TAT
case 'X':
max_clones_segmented = atoi(optarg);
break;
///END_TAT
case 'l':
windows_labels_file = optarg;
break;
......@@ -880,8 +895,9 @@ int main (int argc, char **argv)
we.setAffectsOutput(out_affects);
}
WindowsStorage *windowsStorage = we.extract(reads, multigermline, w, windows_labels);
////MODIF_TAT : + max-clone-segmented
WindowsStorage *windowsStorage = we.extract(reads, multigermline, w, windows_labels, max_clones_segmented);
///END_TAT
windowsStorage->setIdToAll();
size_t nb_total_reads = we.getNbReads();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment