@@ -192,7 +192,7 @@ void IBatch::report_distances(strstream& batch_stream)
192192 }
193193}
194194
195- void IBatch::place_sequences (strstream& batch_stream)
195+ void IBatch::place_sequences (strstream& batch_stream, bool tabular )
196196{
197197 for (bix = 0 ; bix < batch_size; ++bix) {
198198 const char * seq = seq_batch[bix].data ();
@@ -205,11 +205,11 @@ void IBatch::place_sequences(strstream& batch_stream)
205205 summarize_matches (imers_or, imers_rc);
206206 batch_stream.precision (STRSTREAM_PRECISION );
207207 batch_stream << std::fixed;
208- report_placement (batch_stream);
208+ report_placement (batch_stream, tabular );
209209 }
210210}
211211
212- void IBatch::report_placement (strstream& batch_stream)
212+ void IBatch::report_placement (strstream& batch_stream, bool tabular )
213213{
214214 if (node_to_minfo.size () == 0 || !(no_filter || (mi_closest->get_leq_tau (tau) > 1.0 ))) {
215215 return ;
@@ -218,12 +218,16 @@ void IBatch::report_placement(strstream& batch_stream)
218218 minfo_sptr_t mi_pp = mi_closest;
219219 mi_pp->chisq = 0 ;
220220
221- batch_stream << " \t\t\t {\" n\" : [\" " << identifer_batch[bix] << " \" ], \" p\" : [" ;
221+ if (!tabular) batch_stream << " \t\t\t {\" n\" : [\" " << identifer_batch[bix] << " \" ], \" p\" : [" ;
222222 if (node_to_minfo.size () == 1 ) {
223223 if (summarize) {
224224 node_to_wcount[nd_pp] += 1.0 ;
225225 } else {
226- batch_stream << PLACEMENT_FIELD (nd_pp, mi_pp) << " ]},\n " ;
226+ if (tabular) {
227+ batch_stream << identifer_batch[bix] << " \t " << TABULAR_FIELD (nd_pp, mi_pp) << " \n " ;
228+ } else {
229+ batch_stream << PLACEMENT_FIELD (nd_pp, mi_pp) << " ]},\n " ;
230+ }
227231 }
228232 return ;
229233 }
@@ -281,11 +285,15 @@ void IBatch::report_placement(strstream& batch_stream)
281285 if (summarize) {
282286 node_to_wcount[nd_pp] += 1.0 / nd_v.size ();
283287 } else {
284- if (i > 0 ) batch_stream << " ," ;
285- batch_stream << " \n\t\t\t\t " << PLACEMENT_FIELD (nd_pp, mi_pp);
288+ if (i > 0 && !tabular) batch_stream << " ," ;
289+ if (tabular) {
290+ batch_stream << identifer_batch[bix] << " \t " << TABULAR_FIELD (nd_pp, mi_pp) << " \n " ;
291+ } else {
292+ batch_stream << " \n\t\t\t\t " << PLACEMENT_FIELD (nd_pp, mi_pp);
293+ }
286294 }
287295 }
288- if (!summarize) {
296+ if (!summarize && !tabular ) {
289297 batch_stream << " ]\n\t\t\t },\n " ;
290298 }
291299 } else {
@@ -302,7 +310,11 @@ void IBatch::report_placement(strstream& batch_stream)
302310 if (summarize) {
303311 node_to_wcount[nd_pp] += 1.0 ;
304312 } else {
305- batch_stream << PLACEMENT_FIELD (nd_pp, mi_pp) << " ]},\n " ;
313+ if (tabular) {
314+ batch_stream << identifer_batch[bix] << " \t " << TABULAR_FIELD (nd_pp, mi_pp) << " \n " ;
315+ } else {
316+ batch_stream << PLACEMENT_FIELD (nd_pp, mi_pp) << " ]},\n " ;
317+ }
306318 }
307319 }
308320}
0 commit comments