Closed fellen31 closed 4 months ago
Hi @fellen31, can you give me a file I can use to test this out? I'll see if I can somehow do this using HTSJDK :)
Thanks for the file! However I don't get the error you posted when trying this out myself. Do you have an example of the code you used?
Hm, I'm trying to snapshot the reads, or md5s.
The error I get is:
-[genomic-medicine-sweden/nallo] Pipeline completed successfully
Stop plugin 'nf-validation@1.1.3'
htsjdk.samtools.SAMFormatException: SAM validation error: ERROR::READ_GROUP_NOT_FOUND:Record 1, Read name m84039_230117_233243_s1/163973658/ccs, RG ID on SAMRecord not found in header: 92af947f/0--0
FAILED (262.751s)
Assertion failed:
1 of 100 assertions failed
Assertion failed:
1 of 100 assertions failed
at com.askimed.nf.test.lang.extensions.GlobalMethods.assertAll(GlobalMethods.java:48)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.invoke(StaticMetaMethodSite.java:44)
at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.callStatic(StaticMetaMethodSite.java:100)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:55)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:217)
at main_nf$_run_closure1$_closure3$_closure62.doCall(main.nf.test:164)
at main_nf$_run_closure1$_closure3$_closure62.doCall(main.nf.test)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:274)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1030)
at groovy.lang.Closure.call(Closure.java:427)
at groovy.lang.Closure.call(Closure.java:406)
at com.askimed.nf.test.lang.TestCode.execute(TestCode.java:16)
at com.askimed.nf.test.lang.pipeline.PipelineTest.execute(PipelineTest.java:135)
at com.askimed.nf.test.core.TestExecutionEngine.execute(TestExecutionEngine.java:214)
at com.askimed.nf.test.commands.RunTestsCommand.execute(RunTestsCommand.java:184)
at com.askimed.nf.test.commands.AbstractCommand.call(AbstractCommand.java:43)
at com.askimed.nf.test.commands.AbstractCommand.call(AbstractCommand.java:18)
at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
at picocli.CommandLine.access$1300(CommandLine.java:145)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2352)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2346)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2311)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
at picocli.CommandLine.execute(CommandLine.java:2078)
at com.askimed.nf.test.App.run(App.java:44)
at com.askimed.nf.test.App.main(App.java:51)
Nextflow stdout:
Nextflow stderr:
FAILURE: Executed 1 tests in 262.759s (1 failed)
Aha I tried it with .getHeader()
. That seems to work, but .getReads()
fails. I'll see what I can do about it
Although it does look like you are missing a readgroup ID in your header that's present in the reads. I'm not sure this is intended?
Yes, there is a readgroup present in the reads that's not in the header. I actually didn't know it was there before I tried no snapshot the reads. No downstream tools (including samtools) complains though, and the SAM format doesn't strictly require a RG line in the header.
Allright I'm currently testing out a way to set the stringency of the HTSJDK validation which should allow you to ignore these errors. I'll let you know once that works :)
Hi can you try it out with this new (unreleased) version?
Just add this option to the bam()
function: bam(..., stringency: 'lenient')
(You can also set it to 'silent'
if you also don't want the warnings
Then run the new plugin using this command:
nf-test test --plugins nft-bam-0.2.1.jar <your other options>
@fellen31 any news on this? This new feature is ready to release once you can confirm that it works on your side :)
I’ll have a look today!
Looks good!
Awesome! I'll release this then :)
Thank you!
release v0.3.0 contains these changes
Hi, I'm trying to use nft-bam on some files where the read group does not exist in the header. Would it be possible for nft-bam to ignore this error?