I am having problems processing a BAM file with UnifiedGenotyper. It says at the beginning that "java.lang.Character cannot be cast to java.lang.String". I have run this to validate the format: java -jar ./picard-tools-2.1.1/picard.jar ValidateSamFile I=prueba2.bam MODE=SUMMARY
I get this error: Exception in thread "main" java.lang.ClassCastException: java.lang.Character cannot be cast to java.lang.String at htsjdk.samtools.SAMRecord.isValid(SAMRecord.java:2000) at htsjdk.samtools.SAMRecord.isValid(SAMRecord.java:1854) at htsjdk.samtools.SamFileValidator.validateSamRecordsAndQualityFormat(SamFileValidator.java:274) at htsjdk.samtools.SamFileValidator.validateSamFile(SamFileValidator.java:200) at htsjdk.samtools.SamFileValidator.validateSamFileSummary(SamFileValidator.java:128) at picard.sam.ValidateSamFile.doWork(ValidateSamFile.java:187) at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:209) at picard.cmdline.PicardCommandLine.instanceMain(PicardCommandLine.java:95) at picard.cmdline.PicardCommandLine.main(PicardCommandLine.java:105)
Samtools is perfectly able to read it. The error seem to have arisen after rescaling base qualities according to DNA damage patterns (using mapDamage) because the BAM before is perfectly digested by GATK. Any hint on how can I fix this?
Many thanks Federico
The stacktrace shows that there is a problem with the read group RG: https://github.com/samtools/htsjdk/blob/master/src/java/htsjdk/samtools/SAMRecord.java#L2000
Can you please show us the RG line(s) in the sam header and one SAM line with that group please.
This is what I have in the header:
Then, for the mapped reads I have things like:
etc
Do you see a problem there? Thanks! Federico
Unless you have a good reason to do so, I would suggest to use Haplotypecaller. Unifiedgenotypecaller is outdated.
@decoserwouter he/she never said he/she was using Unifiedgenotypecaller