Can crumble give cram output with bam input?
wangshun1121 opened this issue · 5 comments
I wonder, can crumble give cram output when input is bam or sam? Using command as following:
crumble -v -9 -O cram Input.bam Output.cram
Well, I know that reference genome is needed when converting bam to cram. Then, does crumble accept reference genome anywhere? For example in -O
like -O cram,reference=hg19.fa
?
Yes, it should operate much like samtools does so -O cram,reference=foo.fa
can work. I just tested this on a SAM file without MD5sum reference information in the headers. Alternatively you can output to SAM/BAM and pipe into samtools or scramble to do the file format conversion.
Edit: note this is also how you can enable lossy rename names, eg -O cram,reference=foo.fa,lossy_names=1
.
I tried following code:
crumble -z -v -9 -O cram,reference=./Reference/Homo_sapiens_assembly19.fasta GiaB.HG001.withDup.chr19.bam GiaB.HG001.withDup.chr19.9.cram
but failed:
--- Crumble v0.8.2: parameters ---
reduce qual: yes
indel STR mul: 1.00
indel STR add: 2
SNP STR mul: 0.00
SNP STR add: 0
Qual low 5, used for discrepant bases in high conf call
Qual high 40, used for matching bases in high conf call
Keep if mqual <= 0
Calls without mqual: disabled.
Calls with mqual, keep qual if:
SNP < 70, indel < 125, discrep > 1.50
Low mqual perc = 1.000000
Ins length perc = 1.000000
indel ov perc = 0.000000
overdepth factor = 999.000000
P-block level = 8
[E::load_ref_portion] Malformed reference file
Failed to write file header
Is the reference file actually malformed?
Does samtools view -O cram,reference=./Reference/Homo_sapiens_assembly19.fasta -o GiaB.HG001.withDup.chr19.9.cram GiaB.HG001.withDup.chr19.bam
work?
I tried to reindexed my genome using samtools fadix
, it seems OK this time.
Thank you for help!
Great, thanks for the update. Closing this issue.