Entering edit mode
6.2 years ago
sambioinfo2018
▴
20
Dear All,
I have a bam file aligned to a reference genome. I would like to know if there is a way to calculate the over all length of aligned genome.
Thanks in advance. Sam.
Thanks Bastien. Is this the command to do so:
bedtools genomecov -ibam bamfile.bam -bga -g genomelength.txt
More something like this (get the depth at each position):
From the output file (output_depth.txt), count the number of line with NOT 0 in the 3rd column (with awk for example) divided by the number of line in the file. You will get the percentage of reference positions covered by at least one read.