Skip to content

BR: HMMRATAC fails due to SAM validation error? #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hisplan opened this issue Mar 1, 2020 · 9 comments
Closed

BR: HMMRATAC fails due to SAM validation error? #49

hisplan opened this issue Mar 1, 2020 · 9 comments

Comments

@hisplan
Copy link

hisplan commented Mar 1, 2020

Describe the bug

HMMRATAC fails with this error message:

Exception in thread "main" net.sf.samtools.SAMFormatException: SAM validation error: ERROR: Record 292169, Read name A00519:269:H7FM2DRXX:1:1218:5303:31219, Zero-length read without FZ, CS or CQ tag
	at net.sf.samtools.SAMUtils.processValidationErrors(SAMUtils.java:448)
	at net.sf.samtools.BAMFileReader$BAMFileIterator.advance(BAMFileReader.java:541)
	at net.sf.samtools.BAMFileReader$BAMFileIterator.next(BAMFileReader.java:522)
	at net.sf.samtools.BAMFileReader$BAMFileIterator.next(BAMFileReader.java:481)
	at net.sf.samtools.BAMFileReader$BAMQueryFilteringIterator.advance(BAMFileReader.java:750)
	at net.sf.samtools.BAMFileReader$BAMQueryFilteringIterator.next(BAMFileReader.java:720)
	at net.sf.samtools.BAMFileReader$BAMQueryFilteringIterator.next(BAMFileReader.java:673)
	at net.sf.samtools.SAMFileReader$AssertableIterator.next(SAMFileReader.java:672)
	at net.sf.samtools.SAMFileReader$AssertableIterator.next(SAMFileReader.java:650)
	at WigMath.pileup.makeBlock(pileup.java:228)
	at WigMath.pileup.build(pileup.java:205)
	at WigMath.pileup.<init>(pileup.java:70)
	at HMMR_ATAC.Main_HMMR_Driver.main(Main_HMMR_Driver.java:270)

Here is the actual reads that HMMRATAC complained about:

$ samtools view possorted_bam.bam | grep -F "A00519:269:H7FM2DRXX:1:1218:5303:31219"
A00519:269:H7FM2DRXX:1:1218:5303:31219	69	chr6	148759869	0	*	=	148759869	0	*	*	MC:Z:12S37M	AS:i:0	XS:i:0	CR:Z:GGTGAAGCACTGTCGG	CY:Z:FF:F,FFFFFFFFFFF	CB:Z:GGTGAAGCACTGTCGG-1	BC:Z:CTTTCGAC	QT:Z::FFFFFFF	TR:Z:TGTCTCTTATACACATCTCCGAGCCCACGAGACCTTTCGACATCTCGTAT	TQ:Z:FFFFFFFFF:FFFFF:FFFFFFFFFFFFFFFFFFFFFFFFFFFF,:FFFF	GP:i:-1	MP:i:1211301816	MQ:i:22	RG:Z:atac_pbmc_500_v1:MissingLibrary:1:H7FM2DRXX:1
A00519:269:H7FM2DRXX:1:1218:5303:31219	137	chr6	148759869	22	12S37M	=	148759869	0	GGGGGGGGTTTTAAAAAAAAAAAAAACCAAAACAAACAAAAAAAAAAAC	FF,FF:,:,,F,,,,,:F:::F,,,,,F:,,:,,,:,F,:,:,,,F::,	NM:i:0	MD:Z:37	AS:i:37	XS:i:32	XA:Z:chr13,+32718338,17S32M,0;chr3,-57922436,5S32M12S,0;chrX,-147034285,5S32M12S,0;chr3,-184460874,2S35M12S,1;chr20,-52312303,9S30M10S,0;	CR:Z:GGTGAAGCACTGTCGG	CY:Z:FF:F,FFFFFFFFFFF	CB:Z:GGTGAAGCACTGTCGG-1	BC:Z:CTTTCGAC	QT:Z::FFFFFFF	GP:i:1211301816	MP:i:-1	MQ:i:0	RG:Z:atac_pbmc_500_v1:MissingLibrary:1:H7FM2DRXX:1

To Reproduce

Only using these absolutely mandatory parameters: --bam, --index, --genome, and --output. Nothing else.

The dataset is 10x's public datasets: 500 PBMC from a healthy donor.

System (please complete the following information):

  • Open JDK 8
  • HMMRATAC v1.2.9

Thanks for your help.

@EvanTarbell
Copy link
Collaborator

Thanks for your comment. It seems that this is one of two places where i use samtools to read a bam file. Although in the other place i use a try/catch block to avoid these format errors, i forgot to add such a block to this particular piece of code. i will add that and release a new version that should solve this issue for you. I should be able to do this soon

@hisplan
Copy link
Author

hisplan commented Mar 2, 2020

Thanks for your prompt response! Looking forward to trying this out.

EvanTarbell pushed a commit that referenced this issue Mar 3, 2020
@EvanTarbell
Copy link
Collaborator

Version 1.2.10 should fix this issue. Let me know if it works for you.

@hisplan
Copy link
Author

hisplan commented Mar 4, 2020

Thanks! Will try out and let you know.

@hisplan
Copy link
Author

hisplan commented Mar 11, 2020

Thanks. It worked!

@hisplan hisplan closed this as completed Mar 11, 2020
@zyaiqy
Copy link

zyaiqy commented Nov 26, 2022

Hello, I also have this problem in version 1.2.10, the specific code is as follows:
Exception in thread "main" net.sf.samtools.SAMFormatException: SAM validation error: ERROR: Record 1, Read name A01758:140:HLVFVDSX3:3:2551:23439:35008, Zero-length read without FZ, CS or CQ tag
at net.sf.samtools.SAMUtils.processValidationErrors(SAMUtils.java:448)
at net.sf.samtools.BAMFileReader$BAMFileIterator.advance(BAMFileReader.java:541)
at net.sf.samtools.BAMFileReader$BAMFileIndexIterator.(BAMFileReader.java:648)
at net.sf.samtools.BAMFileReader.createIndexIterator(BAMFileReader.java:598)
at net.sf.samtools.BAMFileReader.query(BAMFileReader.java:352)
at net.sf.samtools.SAMFileReader.query(SAMFileReader.java:363)
at HMMR_ATAC.pullLargeLengths.read(pullLargeLengths.java:112)
at HMMR_ATAC.pullLargeLengths.(pullLargeLengths.java:61)
at HMMR_ATAC.Main_HMMR_Driver.main(Main_HMMR_Driver.java:219)
The following is a specific read of the report:
(samtools) ubuntu@VM-0-12-ubuntu:~/data$ samtools view LJL-6M-1-fin.bam | grep -F "A01758:140:HLVFVDSX3:3:2551:23439:35008"
A01758:140:HLVFVDSX3:3:2551:23439:35008 99 1 583 42 146M = 663 229 * *
A01758:140:HLVFVDSX3:3:2551:23439:35008 147 1 663 42 145M = 583 -229 * *

Thanks for your help.

@wzcc-hub
Copy link

Hello, I also have this problem in version 1.2.10, the specific code is as follows: Exception in thread "main" net.sf.samtools.SAMFormatException: SAM validation error: ERROR: Record 1, Read name A01758:140:HLVFVDSX3:3:2551:23439:35008, Zero-length read without FZ, CS or CQ tag at net.sf.samtools.SAMUtils.processValidationErrors(SAMUtils.java:448) at net.sf.samtools.BAMFileReader$BAMFileIterator.advance(BAMFileReader.java:541) at net.sf.samtools.BAMFileReader$BAMFileIndexIterator.(BAMFileReader.java:648) at net.sf.samtools.BAMFileReader.createIndexIterator(BAMFileReader.java:598) at net.sf.samtools.BAMFileReader.query(BAMFileReader.java:352) at net.sf.samtools.SAMFileReader.query(SAMFileReader.java:363) at HMMR_ATAC.pullLargeLengths.read(pullLargeLengths.java:112) at HMMR_ATAC.pullLargeLengths.(pullLargeLengths.java:61) at HMMR_ATAC.Main_HMMR_Driver.main(Main_HMMR_Driver.java:219) The following is a specific read of the report: (samtools) ubuntu@VM-0-12-ubuntu:~/data$ samtools view LJL-6M-1-fin.bam | grep -F "A01758:140:HLVFVDSX3:3:2551:23439:35008" A01758:140:HLVFVDSX3:3:2551:23439:35008 99 1 583 42 146M = 663 229 * * A01758:140:HLVFVDSX3:3:2551:23439:35008 147 1 663 42 145M = 583 -229 * *

Thanks for your help.

have encountered the same problem and I would like to ask if you have solved it?

@simontimmins
Copy link

Just to add, I have also come across this same error

@chklee30
Copy link

chklee30 commented Oct 9, 2024

Were you able to figure this out @zyaiqy? I have the exact same error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants