KolmogorovLab / hapdup

Pipeline to convert a haploid assembly into diploid
Other
90 stars 10 forks source link

Option to set minimap2 -I flag #13

Closed fellen31 closed 1 year ago

fellen31 commented 2 years ago

Hi,

Ran into this error while trying to run hapdup:

[2022-03-08 10:23:36] INFO: Running: flye-minimap2 -ax asm5 -t 10 -K 5G <PATH>/assembly.fasta <PATH>/hapdup/flye_hap_1/polished_1.fasta 2>/dev/null | flye-samtools sort -m 4G -@4 > <PATH>/hapdup/structural/liftover_hp1.bam
[E::sam_parse1] missing SAM header
[W::sam_read1] Parse error at line 2
samtools sort: truncated file. Aborting
Traceback (most recent call last):
  File "/usr/local/bin/hapdup", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/dist-packages/hapdup/main.py", line 245, in main
    subprocess.check_call(" ".join(minimap_cmd), shell=True)
  File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'flye-minimap2 -ax asm5 -t 10 -K 5G <PATH>/assembly.fasta <PATH>/hapdup/flye_hap_1/polished_1.fasta 2>/dev/null | flye-samtools sort -m 4G -@4 > <PATH>/hapdup/structural/liftover_hp1.bam' returned non-zero exit status 1.

I suspect it could be because of the default minimap2 -I flag being too small (4G)? If this is the case, maybe an option to specify this could be added, or adjust it automatically depending on genome size?

Thanks!

mikolmogorov commented 2 years ago

Very likely that's why, will take a look soon.

Mikhail

fellen31 commented 2 years ago

Can confirm changing -I fixed the problem.

mikolmogorov commented 2 years ago

Thanks. I added the fix to this docker image: mkolmogo/hapdup:0.6-iss13. And it will be incorporated into the next release.