Commit 23c8fc28 authored by Mathieu Giraud's avatar Mathieu Giraud

vidjil.cpp: handle -x/-X options inside OnlineFasta

parent e1d6fc15
......@@ -337,8 +337,8 @@ 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
int max_reads_processed = -1;
int max_reads_processed_sample = -1;
int max_reads_processed = NO_LIMIT_VALUE;
int max_reads_processed_sample = NO_LIMIT_VALUE;
float ratio_representative = DEFAULT_RATIO_REPRESENTATIVE;
unsigned int max_auditionned = DEFAULT_MAX_AUDITIONED;
......@@ -879,11 +879,19 @@ int main (int argc, char **argv)
//////////////////////////////////
//$$ Read sequence files
int only_nth_read = 1 ;
if (max_reads_processed_sample != NO_LIMIT_VALUE)
{
only_nth_read = nb_sequences_in_fasta(f_reads) / max_reads_processed_sample;
max_reads_processed = max_reads_processed_sample ;
cout << "Processing every " << only_nth_read << "th read" << endl ;
}
OnlineFasta *reads;
try {
reads = new OnlineFasta(f_reads, 1, read_header_separator);
reads = new OnlineFasta(f_reads, 1, read_header_separator, max_reads_processed, only_nth_read);
} catch (const invalid_argument e) {
cerr << ERROR_STRING << "Vidjil cannot open reads file " << f_reads << ": " << e.what() << endl;
exit(1);
......@@ -989,14 +997,6 @@ int main (int argc, char **argv)
//////////////////////////////////
//$$ Kmer Segmentation
int only_nth_read = 1 ;
if (max_reads_processed_sample > 0)
{
only_nth_read = nb_sequences_in_fasta(f_reads) / max_reads_processed_sample;
max_reads_processed = max_reads_processed_sample ;
cout << "Processing every " << only_nth_read << "th read" << endl ;
}
cout << endl;
cout << "Loop through reads, looking for windows" << endl ;
......
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