From c1b667b0dd54942ecaa5a321e8dbf14f75b04b78 Mon Sep 17 00:00:00 2001 From: James Bonfield Date: Tue, 2 May 2023 12:04:05 +0100 Subject: [PATCH] Rename aux tag MZ to MN. See https://github.com/samtools/hts-specs/pull/714 --- sam.c | 4 ++-- test/base_mods/{MM-MZf1.sam => MM-MNf1.sam} | 4 ++-- test/base_mods/{MM-MZf2.sam => MM-MNf2.sam} | 4 ++-- test/base_mods/{MM-MZp.sam => MM-MNp.sam} | 4 ++-- test/base_mods/MM-multi.sam | 2 +- test/base_mods/base-mods.tst | 6 +++--- 6 files changed, 12 insertions(+), 12 deletions(-) rename test/base_mods/{MM-MZf1.sam => MM-MNf1.sam} (84%) rename test/base_mods/{MM-MZf2.sam => MM-MNf2.sam} (84%) rename test/base_mods/{MM-MZp.sam => MM-MNp.sam} (84%) diff --git a/sam.c b/sam.c index 8f135c333..05910cf8a 100644 --- a/sam.c +++ b/sam.c @@ -6225,12 +6225,12 @@ int bam_parse_basemod(const bam1_t *b, hts_base_mod_state *state) { return -1; } - uint8_t *mi = bam_aux_get(b, "MZ"); + uint8_t *mi = bam_aux_get(b, "MN"); if (mi && bam_aux2i(mi) != b->core.l_qseq) { // bam_aux2i with set errno = EINVAL and return 0 if the tag // isn't integer, but 0 will be a seq-length mismatch anyway so // triggers an error here too. - hts_log_error("%s: MM/MZ data length is incompatible with" + hts_log_error("%s: MM/MN data length is incompatible with" " SEQ length", bam_get_qname(b)); return -1; } diff --git a/test/base_mods/MM-MZf1.sam b/test/base_mods/MM-MNf1.sam similarity index 84% rename from test/base_mods/MM-MZf1.sam rename to test/base_mods/MM-MNf1.sam index 35074fd05..f973d274c 100644 --- a/test/base_mods/MM-MZf1.sam +++ b/test/base_mods/MM-MNf1.sam @@ -1,5 +1,5 @@ @SQ SN:I LN:999 -r1 0 I 1 0 36M * 0 0 AGCTCTCCAGAGTCGNACGCCATYCGCGCGCCACCA DF?GCH88.EG8.7@E9G8A?H9.:C?8,@,,9F@A Mm:Z:C+m,2,2,1,4,1;C+h,6,7;N+n,15,2; Ml:B:C,128,153,179,204,230,159,6,215,240 MZ:i:37 +r1 0 I 1 0 36M * 0 0 AGCTCTCCAGAGTCGNACGCCATYCGCGCGCCACCA DF?GCH88.EG8.7@E9G8A?H9.:C?8,@,,9F@A Mm:Z:C+m,2,2,1,4,1;C+h,6,7;N+n,15,2; Ml:B:C,128,153,179,204,230,159,6,215,240 MN:i:37 r1- 16 I 1 0 36M * 0 0 AGCTCTCCAGAGTCGNACGCCATYCGCGCGCCACCA DF?GCH88.EG8.7@E9G8A?H9.:C?8,@,,9F@A Mm:Z:G-m,0,1,4,1,2;G-h,0,7;N-n,17,2; Ml:B:C,230,204,179,153,128,6,159,240,215 r2 0 I 4 0 3S33M * 0 0 AGCTCTCCAGAGTCGNACGCCATYCGCGCGCCACCA DF?GCH88.EG8.7@E9G8A?H9.:C?8,@,,9F@A Mm:Z:C+m,2,2,1,4,1;C+h,6,7;N+n,15,2; Ml:B:C,128,153,179,204,230,159,6,215,240 -r3 0 I 11 0 10S20M6S * 0 0 AGCTCTCCAGAGTCGNACGCCATYCGCGCGCCACCA DF?GCH88.EG8.7@E9G8A?H9.:C?8,@,,9F@A Mm:Z:C+mh,2,2,0,0,4,1;N+n,15,2; Ml:B:C,128,0,153,0,0,159,179,0,204,0,230,6,215,240 MZ:i:36 +r3 0 I 11 0 10S20M6S * 0 0 AGCTCTCCAGAGTCGNACGCCATYCGCGCGCCACCA DF?GCH88.EG8.7@E9G8A?H9.:C?8,@,,9F@A Mm:Z:C+mh,2,2,0,0,4,1;N+n,15,2; Ml:B:C,128,0,153,0,0,159,179,0,204,0,230,6,215,240 MN:i:36 diff --git a/test/base_mods/MM-MZf2.sam b/test/base_mods/MM-MNf2.sam similarity index 84% rename from test/base_mods/MM-MZf2.sam rename to test/base_mods/MM-MNf2.sam index 843f93a1b..a88924122 100644 --- a/test/base_mods/MM-MZf2.sam +++ b/test/base_mods/MM-MNf2.sam @@ -1,5 +1,5 @@ @SQ SN:I LN:999 -r1 0 I 1 0 36M * 0 0 AGCTCTCCAGAGTCGNACGCCATYCGCGCGCCACCA DF?GCH88.EG8.7@E9G8A?H9.:C?8,@,,9F@A Mm:Z:C+m,2,2,1,4,1;C+h,6,7;N+n,15,2; Ml:B:C,128,153,179,204,230,159,6,215,240 MZ:i:36 +r1 0 I 1 0 36M * 0 0 AGCTCTCCAGAGTCGNACGCCATYCGCGCGCCACCA DF?GCH88.EG8.7@E9G8A?H9.:C?8,@,,9F@A Mm:Z:C+m,2,2,1,4,1;C+h,6,7;N+n,15,2; Ml:B:C,128,153,179,204,230,159,6,215,240 MN:i:36 r1- 16 I 1 0 36M * 0 0 AGCTCTCCAGAGTCGNACGCCATYCGCGCGCCACCA DF?GCH88.EG8.7@E9G8A?H9.:C?8,@,,9F@A Mm:Z:G-m,0,1,4,1,2;G-h,0,7;N-n,17,2; Ml:B:C,230,204,179,153,128,6,159,240,215 r2 0 I 4 0 3S33M * 0 0 AGCTCTCCAGAGTCGNACGCCATYCGCGCGCCACCA DF?GCH88.EG8.7@E9G8A?H9.:C?8,@,,9F@A Mm:Z:C+m,2,2,1,4,1;C+h,6,7;N+n,15,2; Ml:B:C,128,153,179,204,230,159,6,215,240 -r3 0 I 11 0 10S20M6S * 0 0 AGCTCTCCAGAGTCGNACGCCATYCGCGCGCCACCA DF?GCH88.EG8.7@E9G8A?H9.:C?8,@,,9F@A Mm:Z:C+mh,2,2,0,0,4,1;N+n,15,2; Ml:B:C,128,0,153,0,0,159,179,0,204,0,230,6,215,240 MZ:f:36 +r3 0 I 11 0 10S20M6S * 0 0 AGCTCTCCAGAGTCGNACGCCATYCGCGCGCCACCA DF?GCH88.EG8.7@E9G8A?H9.:C?8,@,,9F@A Mm:Z:C+mh,2,2,0,0,4,1;N+n,15,2; Ml:B:C,128,0,153,0,0,159,179,0,204,0,230,6,215,240 MN:f:36 diff --git a/test/base_mods/MM-MZp.sam b/test/base_mods/MM-MNp.sam similarity index 84% rename from test/base_mods/MM-MZp.sam rename to test/base_mods/MM-MNp.sam index 836a09725..7bdca0f31 100644 --- a/test/base_mods/MM-MZp.sam +++ b/test/base_mods/MM-MNp.sam @@ -1,5 +1,5 @@ @SQ SN:I LN:999 -r1 0 I 1 0 36M * 0 0 AGCTCTCCAGAGTCGNACGCCATYCGCGCGCCACCA DF?GCH88.EG8.7@E9G8A?H9.:C?8,@,,9F@A Mm:Z:C+m,2,2,1,4,1;C+h,6,7;N+n,15,2; Ml:B:C,128,153,179,204,230,159,6,215,240 MZ:i:36 +r1 0 I 1 0 36M * 0 0 AGCTCTCCAGAGTCGNACGCCATYCGCGCGCCACCA DF?GCH88.EG8.7@E9G8A?H9.:C?8,@,,9F@A Mm:Z:C+m,2,2,1,4,1;C+h,6,7;N+n,15,2; Ml:B:C,128,153,179,204,230,159,6,215,240 MN:i:36 r1- 16 I 1 0 36M * 0 0 AGCTCTCCAGAGTCGNACGCCATYCGCGCGCCACCA DF?GCH88.EG8.7@E9G8A?H9.:C?8,@,,9F@A Mm:Z:G-m,0,1,4,1,2;G-h,0,7;N-n,17,2; Ml:B:C,230,204,179,153,128,6,159,240,215 r2 0 I 4 0 3S33M * 0 0 AGCTCTCCAGAGTCGNACGCCATYCGCGCGCCACCA DF?GCH88.EG8.7@E9G8A?H9.:C?8,@,,9F@A Mm:Z:C+m,2,2,1,4,1;C+h,6,7;N+n,15,2; Ml:B:C,128,153,179,204,230,159,6,215,240 -r3 0 I 11 0 10S20M6S * 0 0 AGCTCTCCAGAGTCGNACGCCATYCGCGCGCCACCA DF?GCH88.EG8.7@E9G8A?H9.:C?8,@,,9F@A Mm:Z:C+mh,2,2,0,0,4,1;N+n,15,2; Ml:B:C,128,0,153,0,0,159,179,0,204,0,230,6,215,240 MZ:i:36 +r3 0 I 11 0 10S20M6S * 0 0 AGCTCTCCAGAGTCGNACGCCATYCGCGCGCCACCA DF?GCH88.EG8.7@E9G8A?H9.:C?8,@,,9F@A Mm:Z:C+mh,2,2,0,0,4,1;N+n,15,2; Ml:B:C,128,0,153,0,0,159,179,0,204,0,230,6,215,240 MN:i:36 diff --git a/test/base_mods/MM-multi.sam b/test/base_mods/MM-multi.sam index 1c7288f50..ac2831bc1 100644 --- a/test/base_mods/MM-multi.sam +++ b/test/base_mods/MM-multi.sam @@ -3,5 +3,5 @@ @CO r2 has them combined together, for example as produced by @CO a joint basecaller which assigns probabilities to all @CO trained events simultaneously. -r1 0 * 0 0 * * 0 0 AGCTCTCCAGAGTCGNACGCCATYCGCGCGCCACCA * Mm:Z:C+m,2,2,1,4,1;C+h,6,7;N+n,15,2; Ml:B:C,128,153,179,204,230,159,6,215,240 MZ:i:36 +r1 0 * 0 0 * * 0 0 AGCTCTCCAGAGTCGNACGCCATYCGCGCGCCACCA * Mm:Z:C+m,2,2,1,4,1;C+h,6,7;N+n,15,2; Ml:B:C,128,153,179,204,230,159,6,215,240 MN:i:36 r2 0 * 0 0 * * 0 0 AGCTCTCCAGAGTCGNACGCCATYCGCGCGCCACCA * Mm:Z:C+mh,2,2,0,0,4,1;N+n,15; Ml:B:C,77,159,103,133,128,108,154,82,179,57,204,31,240 diff --git a/test/base_mods/base-mods.tst b/test/base_mods/base-mods.tst index d246223c8..237f7906c 100644 --- a/test/base_mods/base-mods.tst +++ b/test/base_mods/base-mods.tst @@ -45,6 +45,6 @@ P MM-pileup2.out $pileup_mod < MM-pileup2.sam # Validation testing. We just care about exit status here, but the # test data is a copy of MM-pileup.sam so that suffices too. -P MM-pileup.out $pileup_mod < MM-MZp.sam -F MM-pileup.out $pileup_mod < MM-MZf1.sam -F MM-pileup.out $pileup_mod < MM-MZf2.sam +P MM-pileup.out $pileup_mod < MM-MNp.sam +F MM-pileup.out $pileup_mod < MM-MNf1.sam +F MM-pileup.out $pileup_mod < MM-MNf2.sam