I am doing some coverage analysis on deep sequencing human genome. I first align to the whole hg38 genome, then split bam to each chrom, and collect metrics on bam for each chom. I first split using samtools. and then tried bamtools.
samtools: samtools view -bo ${pair_id}.\\\$chr.bam $bam \\\$chr
bamtools:bamtools split -in $bam -reference
When I collect metrics I am using the reference fasta from each chrom. The picard metrics complains the index dictionary size is different: Sequence dictionaries are not the same size (25, 1). The picard method I used is: MarkDuplicates, CollectAlignmentSummaryMetrics, CollectGcBiasMetrics, CollectInsertSizeMetrics, CollectWgsMetrics.
My data is really huge, 70G for a sample, that is why I would like to split when doing the picard metrics. Seems picard metrics collection use a lot of memory. So for the 70G human fastq(30X), how big the memory is needed for running picard wgs metrics?
How can I deal with this? Can I modify the split bam header? How to do it? Or not split it into chromosmes, rather, using an interval list when collecting the metrics? will that use less memory?