Thanks @Pierre for your reply. I tried to run below command as suggested by histat2 manual:
./hisat2-2.2.1-Linux_x86_64/hisat2-2.2.1/hisat2 --no-spliced-alignment --no-unal --rg-id ID:D10_S24_L001 --rg SM:D10_S24_L001 --rg PL:ILLUMINA --rg PM:HISEQ -p 2 -x reference.fasta -1 ./Data/D1.fastq.gz -2 ./Data/D2.fastq.gz -S D10.sam
It does not throw any error but still does not generate sam file. before using --rg-id and --rg tags it would be able to generate sam files but after editing like this it does not give any error. The logs in both cases are something similar to below:
33583125 reads; of these: 33583125 (100.00%) were paired; of these: 33565755 (99.95%) aligned concordantly 0 times 17370 (0.05%) aligned concordantly exactly 1 time
0 (0.00%) aligned concordantly >1 times ---- 33565755 pairs aligned concordantly 0 times; of these: 4324 (0.01%) aligned discordantly 1 time ---- 33561431 pairs aligned 0 times concordantly or discordantly; of these: 67122862 mates make up the pairs; of these: 67107582 (99.98%) aligned 0 times 15280 (0.02%) aligned exactly 1 time 0 (0.00%) aligned >1 times0.09% overall alignment rate
I am not sure what is wrong in my command as it does not produce any error nor any sam output file.
output should be name ./Output/D.g.vcf if you're using a GVCF mode.
If you don't want to rerun the alignment, you can use picard AddOrReplaceReadGroups. However, GATK recommends adding read groups at the alignment step, as Pierre suggested.