brentp / somalier

fast sample-swap and relatedness checks on BAMs/CRAMs/VCFs/GVCFs... "like damn that is one smart wine guy"
MIT License
270 stars 35 forks source link

Scaled mean depth on X - how to calculate? #132

Closed parkjooyoung99 closed 10 months ago

parkjooyoung99 commented 10 months ago

I am trying to reproduce the plot below with my somalier output. However, I could not find the exact method on how the axis are defined.

Would there be someone who have solved this?? Thanks!

image
brentp commented 10 months ago

Hi, somalier uses this to get scaled mean depth on x:

2 * stats[i].x_dp.mean / stats[i].gtdp.mean

so it takes the mean depth on X and divides by the mean depth on the autosome for sites that met the depth cutoff. Then multiplies by 2 so we get e.g. ~2 for female and ~1 for male.