Skip to content

Instantly share code, notes, and snippets.

View mnarayan's full-sized avatar

mnarayan mnarayan

View GitHub Profile
@mnarayan
mnarayan / all_biomarkers_by_institute.html
Last active November 13, 2025 21:56
NIH Biomarker Research Funding Analysis (Oct 2024)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>All Biomarker Research: Top 10 Institutes by Total Funding</title>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/chart.umd.min.js"></script>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
@mnarayan
mnarayan / keyboard-shortcuts.md
Created October 9, 2025 21:01
Productivity keyboard shortcuts for ML/Stats researchers working with R, Python, and RunPod

Productivity Keyboard Shortcuts for ML/Stats Research

Tailored for ML/Stats PhD researchers working with R, Python, and RunPod infrastructure

Cursor Editor Shortcuts

Code Navigation & Editing

Shortcut Action
Ctrl+P Quick file open
@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.


@mnarayan
mnarayan / README.md
Last active November 18, 2025 19:34
NIH Reporter Summary of Biomarker Funding

Summary of Annual NIH Spending on projects about "biomarkers"

Fiscal Year Projects Total Funding Sub Projects Sub Project Funding
2004 1527 $537,186,990 439 $33,041,900
2005 1712 $619,361,134 240 $47,405,035
2006 1618 $647,500,503 321 $71,519,867
2007 551 $274,341,084 204 $39,386,589
2008 736 $357,470,326 233 $54,909,641
2009 3573 $1,679,909,537 1058 $269,653,399

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