Skip to content

Apparent bug with mpileup -aa #2227

Description

@pouyak

There appears to be a bug with the reference base reported by mpileup -aa in certain situations.

With the newest samtools (1.22), the following:

tr '|' '\t' > test.sam << EOF
@SQ|SN:S1|LN:2
@SQ|SN:S2|LN:1
@SQ|SN:S3|LN:1
X1|0|S1|1||1M|*|||A|*
X2|0|S2|1||1M|*|||A|*
X3|0|S2|1||1M|*|||A|*
X4|0|S3|1||1M|*|||A|*
EOF

cat > test.fasta << EOF
>S1
TG
>S2
G
>S3
G
EOF

samtools mpileup -aa -f test.fasta test.sam

Produces output that contains a non-ascii character in place of the reference base (on the second line:

[mpileup] 1 samples in 1 input files
S1      1       T       1       ^!A$    ~
S1      2               0       *       *
S2      1       G       2       ^!A$^!A$        ~~
S3      1       G       1       ^!A$    ~

Prior to #2019 the reference base would be N, which while wrong did not break downstream pipelines as much.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions