Well... My god have to fix a lot things before Im able to call my snps
I got my bam file directly from fastq using BBMap (thanks to genomax)
Of course my bam file is not sorted and no index, so I do...
samtools sort out.bam sorted.bam samtools index sorted.bam sorted.bai
Then I continue at next step
java -jar /home/cri/Desktop/GATK/GenomeAnalysisTK.jar -T RealignerTargetCreator -R hg19.fa -I sorted.bam -o sorted.intervals
and I get this error message
Error details: SAM file doesn't have any read groups defined in the header. The GATK no longer supports SAM files without read groups
and I use this code to fix it
java -jar /home/cri/Desktop/picard1/AddOrReplaceReadGroups.jar I=sorted.bam O=header.bam RGLB=LIBRARY RGPL="Ion Torrent" RGPU=RUN RGSM=SAMPLE RGCN=BCM
Then I try again
java -jar /home/cri/Desktop/GATK/GenomeAnalysisTK.jar -T RealignerTargetCreator -R hg19.fa -I header.bam -o header.intervals
Then I get another error (i jump to error to error... ^" )
ERROR MESSAGE: Invalid command line: Cannot process the provided BAM/CRAM file(s) because they were not indexed. The GATK does offer limited processing of unindexed BAM/CRAMs in --unsafe mode, but this feature is unsupported -- use it at your own risk!
I realize my bai file was called before sorted.bai so I rename to header.bai...didn't work either, then I index again my header.bam
samtools index header.bam header.bai
and Identify target regions for realignment finally works....
why I need to do twice the index?