<commit_before>diff -rupN -x Xcode -x .git bwa/bwamem.c bwa-mod/bwamem.c
--- bwa/bwamem.c	2015-07-08 13:14:28.000000000 -0400
+++ bwa-mod/bwamem.c	2015-08-06 16:19:33.000000000 -0400
@@ -933,6 +933,24 @@ void mem_aln2sam(const mem_opt_t *opt, c
 			ksprintf(str, "\tpa:f:%.3f", (double)p->score / p->alt_sc);
 	}
 	if (p->XA) { kputsn("\tXA:Z:", 6, str); kputs(p->XA, str); }
+	if ((p->flag & 4) == 0) {
+		kputsn("\tZT:Z:", 6, str);
+		kputw(p->pair_score, str);
+		kputc(',', str);
+		kputw(p->pair_sub, str);
+		kputc(',', str);
+		kputw(p->sub_n, str);
+		kputc(',', str);
+		kputw(p->pair_nsub, str);
+		kputc(',', str);
+		kputw((int)(p->frac_rep * 1000.0), str);
+		kputc(',', str);
+		kputw((int)(p->pair_frac_rep * 1000.0), str);
+		kputc(',', str);
+		kputw((int)(p->seedcov * 1000.0), str);
+		kputc(',', str);
+		kputw((int)(p->pair_seedcov * 1000.0), str);
+	}
 	if (s->comment) { kputc('\t', str); kputs(s->comment, str); }
 	if ((opt->flag&MEM_F_REF_HDR) && p->rid >= 0 && bns->anns[p->rid].anno != 0 && bns->anns[p->rid].anno[0] != 0) {
 		int tmp;
@@ -1131,6 +1149,11 @@ mem_aln_t mem_reg2aln(const mem_opt_t *o
 	a.pos = pos - bns->anns[a.rid].offset;
 	a.score = ar->score; a.sub = ar->sub > ar->csub? ar->sub : ar->csub;
 	a.is_alt = ar->is_alt; a.alt_sc = ar->alt_sc;
+	a.seedcov = ((float)ar->seedcov) / l_query;
+	a.frac_rep = ar->frac_rep;
+	a.sub_n = ar->sub_n;
+	a.pair_score = a.pair_sub = a.pair_nsub = 0;
+	a.pair_frac_rep = a.pair_seedcov = 0.;
 	free(query);
 	return a;
 }
diff -rupN -x Xcode -x .git bwa/bwamem.h bwa-mod/bwamem.h
--- bwa/bwamem.h	2015-07-08 13:14:28.000000000 -0400
+++ bwa-mod/bwamem.h	2015-08-06 16:18:00.000000000 -0400
@@ -94,6 +94,9 @@ typedef struct { // This struct is only 
 	char *XA;        // alternative mappings
 
 	int score, sub, alt_sc;
+	float seedcov, pair_seedcov;
+	int sub_n, pair_score, pair_sub, pair_nsub;
+	float frac_rep, pair_frac_rep;
 } mem_aln_t;
 
 #ifdef __cplusplus
diff -rupN -x Xcode -x .git bwa/bwamem_pair.c bwa-mod/bwamem_pair.c
--- bwa/bwamem_pair.c	2015-07-08 13:14:28.000000000 -0400
+++ bwa-mod/bwamem_pair.c	2015-08-06 16:18:28.000000000 -0400
@@ -346,6 +346,21 @@ int mem_sam_pe(const mem_opt_t *opt, con
 				aa[i][n_aa[i]++] = g[i];
 			}
 		}<commit_msg>sticking all the features in ZT:Z<commit_after>diff -rupN -x Xcode -x .git bwa/bwamem.c bwa-mod/bwamem.c
--- bwa/bwamem.c	2015-07-08 13:14:28.000000000 -0400
+++ bwa-mod/bwamem.c	2015-08-16 20:10:52.000000000 -0400
@@ -942,6 +942,32 @@ void mem_aln2sam(const mem_opt_t *opt, c
 		for (i = tmp; i < str->l; ++i) // replace TAB in the comment to SPACE
 			if (str->s[i] == '\t') str->s[i] = ' ';
 	}
+	if ((p->flag & 4) == 0) {
+		kputsn("\tZT:Z:", 6, str);
+		kputw(p->score, str); // same as AS:i
+		kputc(',', str);
+		if(p->sub >= 0) {
+			kputw(p->sub, str);
+		} else {
+			kputsn("NA", 2, str);
+		}
+		kputc(',', str);
+		kputw(p->pair_score, str);
+		kputc(',', str);
+		kputw(p->pair_sub, str);
+		kputc(',', str);
+		kputw(p->sub_n, str);
+		kputc(',', str);
+		kputw(p->pair_nsub, str);
+		kputc(',', str);
+		kputw((int)(p->frac_rep * 1000.0), str);
+		kputc(',', str);
+		kputw((int)(p->pair_frac_rep * 1000.0), str);
+		kputc(',', str);
+		kputw((int)(p->seedcov * 1000.0), str);
+		kputc(',', str);
+		kputw((int)(p->pair_seedcov * 1000.0), str);
+	}
 	kputc('\n', str);
 }
 
@@ -1131,6 +1157,11 @@ mem_aln_t mem_reg2aln(const mem_opt_t *o
 	a.pos = pos - bns->anns[a.rid].offset;
 	a.score = ar->score; a.sub = ar->sub > ar->csub? ar->sub : ar->csub;
 	a.is_alt = ar->is_alt; a.alt_sc = ar->alt_sc;
+	a.seedcov = ((float)ar->seedcov) / l_query;
+	a.frac_rep = ar->frac_rep;
+	a.sub_n = ar->sub_n;
+	a.pair_score = a.pair_sub = a.pair_nsub = 0;
+	a.pair_frac_rep = a.pair_seedcov = 0.;
 	free(query);
 	return a;
 }
diff -rupN -x Xcode -x .git bwa/bwamem.h bwa-mod/bwamem.h
--- bwa/bwamem.h	2015-07-08 13:14:28.000000000 -0400
+++ bwa-mod/bwamem.h	2015-08-06 16:18:00.000000000 -0400
@@ -94,6 +94,9 @@ typedef struct { // This struct is only 
 	char *XA;        // alternative mappings
 
 	int score, sub, alt_sc;
+	float seedcov, pair_seedcov;
+	int sub_n, pair_score, pair_sub, pair_nsub;
+	float frac_rep, pair_frac_rep;
 } mem_aln_t;
 
 #ifdef __cplusplus
diff -rupN -x Xcode -x .git bwa/bwamem_pair.c bwa-mod/bwamem_pair.c
--- bwa/bwamem_pair.c	2015-07-08 13:14:28.000000000 -0400
+++ bwa-mod/bwamem_pair.c	2015-08-06 16:18:28.000000000 -0400
@@ -346,6 +346,21 @@ int mem_sam_pe(const mem_opt_t *opt, con
 				aa[i][n_aa[i]++] = g[i];
 			}
 		}
{'fraction_non_alphanumeric': 0.22879291251384273, 'fraction_numerical': 0.1009966777408638, 'mean_word_length': 3.388726919339164, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 65, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 12, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3819408', 'n_tokens_mistral': 2623, 'n_tokens_neox': 2262, 'n_words': 412}