Skip to content

Instantly share code, notes, and snippets.

@michaelfagan
Created November 2, 2019 19:37
Show Gist options
  • Save michaelfagan/f16516c20f9e83f7ae66f005268e424a to your computer and use it in GitHub Desktop.
Save michaelfagan/f16516c20f9e83f7ae66f005268e424a to your computer and use it in GitHub Desktop.
Hide DNA matches on Ancestry and 23andMe below a threshold for the ratio of total shared DNA to longest segment
javascript:var mint=42;var minr=12;if (location.href.indexOf('23andme')!==-1) {$('#peeps li').each(function(){var e=$(this).find('.b3:last');var m=e.text().trim().match(/([^%]+)[^\d]+(\d+)/);var n=parseInt(m[2]);var t=parseFloat(m[1])*75;var r=t/n;if(t<mint||r<minr){$(this).hide()}else{e.prepend('Ratio '+Math.round(r*100)/100+', ')}})}else {
$('match-entry').each(function(){var b=$(this).find('.dnaGrayDark');var s=b.text().match(/(\d+)[^\d]+(\d+)/);var t=parseInt(s[1]);var r = t/parseInt(s[2]);if(t<mint||r<minr){$(this).hide()}else{b.prepend('<strong>Ratio '+Math.round(r*100)/100+'</strong> ')}})}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment