I used this following command owing to the fact that samples was not being recognized by samtools
samtools view -H Purple-Haze_65692e0c-9d41-4d15-abeb-a768ce4b17d9_marked_marked.bam | grep "^@SQ" | cut -f2 | cut -d':' -f2 | sort | uniq | cat -n
the output is following
1 chr01
2 chr02
3 chr03
4 chr04
5 chr05
6 chr06
7 chr07
8 chr08
9 chr09
10 chr10
11 chr11
12 scaffold1
13 scaffold10
14 scaffold100
15 scaffold101
so what do you suggest now? As for option --sample-name in gatk, I am a bit confused about how to mention this in code. can you please guide here?