Skip to content

Instantly share code, notes, and snippets.

View mnarayan's full-sized avatar

mnarayan mnarayan

View GitHub Profile
@mnarayan
mnarayan / 02-04-2025_AncestryTracing_Vs_Admixture_Population_Stratification.md
Created April 2, 2025 13:38
A conversation on genetic ancestry, race and evolution

User:

It is easy to isolate ancestry using Y haplotype and mitochondrial DNA. How is this different from ancestral admixture and population stratification as studied by geneticists and GWAS studies. And how does genetic ancestry and such lineages differ from social conventions of defining race?

What makes external features of ethnicity identifiable? Why is evolution of such traits similar to or different from other traits that define human cognitive traits? Is it fair to say tha rare denovo variants might get entrenched within a genetically isolated population within the last 2000-3000 years; whereas common traits that confer abilities common to the human cognitive development are far holder ~ evolved under selection pressures over 100s of thousands of years and are relatively stable? Agree or Disagree?

Write an essay. It should be rigorous and thorough and engage with misconceptions that PhD level readers outside of expertise of Broad Institute / EMBL level geneticists.


One of the hallmarks of inter-regional functional coupling (IRFC) using fMRI is the distinctive and reproducible community structure that emerges after partitioning voxels into regions and regions into large scale sub-networks such as that of Yeo et. al. 2011. To the extent that IRFC in functional brain networks from any modality reects capacity for neurophysiological communication, the strength of coupling between two large scale communities, such as the default mode sub-network (DMN) and fronto-parietal control sub-network (FPN) in Fig 1a., is a vital index of possible reconguration of community structure. Changes to community strength may vary between individuals on the healthy to ill spectrum and vary within individuals across mental states or in response to brain stimulation. In this work, we provide a novel measure of community strength, higher order clique conductance (HOCC), inspired by Benson 2016 that takes not only connections but maximal cliques of size k>2 (Fig 1c.) into account. Results from app

@mnarayan
mnarayan / ParSpace1.m
Last active November 3, 2020 18:28
Scripts for "Quantifying and addressing parameter indeterminacy in the classical twin design."
%%%THIS FILE GRAPHS PARAMETER SPACE FROM TWIN DATA SETS
%%%WHENEVER CV(DZ)/CV(MZ)>1/2
%
% All parameter sets within this space are mathematically equally likely
% but are not necessarily biologically equally likely
%
% By Matt Keller
% Nov 26, 2004
%
% For more explanation, see:
@mnarayan
mnarayan / awesome-beamer.md
Last active April 12, 2023 11:39
Modern Beamer Templates
@mnarayan
mnarayan / README.md
Last active October 6, 2022 00:28
Kendall Tau correction for zero-inflation

Pimental's correction for kendall's tau correlation coefficient is given by

Pimental:Proposition 1

@mnarayan
mnarayan / Investigating Canonical Correlations.md
Last active May 4, 2019 16:04
Investigating Canonical Correlations

Summary

Canonical Correlation Analysis is a dimensionality reduction technique to find the subspace that maximizes the correlation between two sets of multivariate features X and Y that share the same number of rows or observations.

Since CCA is a supervised technique it is easy to obtain extremely high canonical correlations that might not generalize due to overfitting.

The script sample_canonical_correlations.m is designed to investigate out-of-sample canonical correlations. If one partitions the number of rows/observations into training and test sets, then one can

    1. do ordinary CCA on the training set
    1. use the canonical variates from the training set to obtain out-of-sample canonical correlations on the test set
    1. Compare in-sample vs. out-of-sample canonical correlations
@mnarayan
mnarayan / hoeffdingsD.m
Created November 21, 2018 01:58
Naive Function computing Hoeffding's D in MATLAB
function [ D ] = hoeffdingsD( x, y )
%Compute's Hoeffding's D measure of dependence between x and y
% inputs x and y are both N x 1 arrays
% output D is a scalar
% The formula for Hoeffding's D is taken from
% http://support.sas.com/documentation/cdl/en/procstat/63104/HTML/default/viewer.htm#procstat_corr_sect016.htm
% Below is demonstration code for several types of dependencies.
% Implementation by Jascha https://stackoverflow.com/a/9322657
%
% % this case should be 0 - there are no dependencies
@mnarayan
mnarayan / ds000031_model.json
Last active October 18, 2018 20:22 — forked from cmaumet/ds114_model.json
BIDS-models for ds000031
{
"name": "ds000031 example",
"description": "An example of connectivity analysis using ds000031",
"input":
{
"task": "rest"
},
"blocks": [
{
"level": "run",
@mnarayan
mnarayan / tutorial-combat.ipynb
Last active October 6, 2022 00:30
Explore Between Site "Batch" Effects in fMRI QC
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mnarayan
mnarayan / sample_canonical_correlation.m
Created October 19, 2017 02:52
How to compute canonical variates and canonical correlations across training and test splits
function [cca_rho cca_v cca_cv] = sample_canonical_correlation(X,Y,varargin)
% SAMPLE_CANONICAL_CORRELATION
%
% Usage: [rho] = sample_canonical_correlation(X,Y, R_X, R_Y)
%
% Inputs:
% - X is the test set data matrix of n_samples x p features
% - Y is the test set data matrix of n_samples x r features
% - options.W_X is the linear projection matrix for X
% - options.W_Y is a linear projection matrix for Y