brentp / somalier

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

Inference questions #129

Open solcos opened 10 months ago

solcos commented 10 months ago

Hello,

I've been testing somalier for relatedness and also sex inference.

I have some questions regarding sex and relatedness.

  1. Sex inference: I've noticed that in some samples, the results for sex inference follow the formulas in (https://github.com/brentp/somalier/issues/125) but the result is not 'translated' in the sex column (inferred sex) of the somalier.samples file.

e.g. sex phenotype X_depth_mean X_het X_hom_alt -1 unknown 17.45 1 162

and the formula is --> if stats[i].x_het / stats[i].x_hom_alt < 0.05 and stats[i].x_dp.n > 10:

The results should be male, am I correct? The 'x_dp.n' variable is the 'X_depth_mean' in the samples.tsv? Or do you take into account other parameters?


  1. Relatedness

Regarding relatedness, I've noticed that in "https://github.com/brentp/somalier/wiki/pedigree-inference" to infer the relationships of the samples, you need a minimum of 3 samples "a trio", have relatedness value between 0.4 and 0.6 to $sample, have IBS0 / IBS2 < 0.005 to $sample, and also that the parents can't have a relatedness higher than 0.06.

Why the 0.06 is needed?

Thanks in advance!

Arnau