caleblareau / mgatk

mgatk: mitochondrial genome analysis toolkit
http://caleblareau.github.io/mgatk
MIT License
101 stars 27 forks source link

Assume sorted bam #37

Closed cnk113 closed 3 years ago

cnk113 commented 3 years ago

This should be safe to assume?

caleblareau commented 3 years ago

@cnk113 I'm happy to look into this PR, but I'm curious

cnk113 commented 3 years ago

The sorted bam file was a bug I seem to be getting for some reason, and looking at the snakefile it seems the bams are already sorted (through pysam.sort) so it ended up working and shouldn't lead to any problems. This was the output of one of the temp_bam (after pysam.sort) files which throws this issue.

Exception in thread "main" picard.PicardException: This program requires input that are either coordinate or query sorted (according to the header, or at least ASSUME_SORT_ORDER and the content.) 
Found ASSUME_SORT_ORDER=null and header sortorder=unsorted                                                                                                                                                                            
at picard.sam.markduplicates.MarkDuplicates.doWork(MarkDuplicates.java:294)                                                                                                                                      
at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:295)                                                                                                                                   
at picard.cmdline.PicardCommandLine.instanceMain(PicardCommandLine.java:103)                                                                                                                                     
at picard.cmdline.PicardCommandLine.main(PicardCommandLine.java:113)

As for the del error when I try to follow your walkthrough I get an error for using a reserved keyword in the import statement. This is all in python3.7

caleblareau commented 3 years ago

I've implemented this in v0.6.3 that will appear on PyPi tomorrow morning-- thanks for the suggestion