Hey there Devon.
That makes sense (of course, since you know what you are talking about), i visually checked my used bam files, and the problem is after the alignment, say, all of the ones who work well have 10 information columns after the alignment section, these columns are the next ones in a troubleless file:
x0:i:1 x1:i:0 MD:z:XXXX RG:z:XXXX XG:i:0 NM:i:0 XM:i:0 X0:i0 XP:i:1 XT:A:U
As i checked the file with the trouble, i realized it is lacking the colum with the "XP:i:1" tag. As you said, it is strange, since i downloaded the file directly from the source, and i just sorted, indexed, and retrieved a strand, i really don't think the problem was with my processing protocol, but it is still a good question to have in mind, on which preprocessing step this happened.
I'll run the code you suggest, i just have one question, do the reheader option fixes automatically the lacking information in the bam file?, or do i somehow have to add the column manually? .. if so, i am thinking something with
awk
or maybe
sed
, which would be a bit more challenging for me.
Thank you for the feedback