Skip to content

Instantly share code, notes, and snippets.

@gilesc
Created July 6, 2021 19:47
Show Gist options
  • Save gilesc/07bc4e8d23a007b79d0a3f895be5b321 to your computer and use it in GitHub Desktop.
Save gilesc/07bc4e8d23a007b79d0a3f895be5b321 to your computer and use it in GitHub Desktop.
import pandas as pd
import numpy as np
import patsy
import wrenlab.R.wrap.DESeq2
def fn():
X = pd.DataFrame(np.random.randint(10000, size=(12, 1000)))
D = pd.DataFrame({
"V1": [0,0,0,0,0,0,1,1,1,1,1,1],
"V2": [0,1,0,1,0,1,0,1,0,1,0,1]
})
D = patsy.dmatrix("V1 + V2 + V1:V2", D, return_type="dataframe")
return wrenlab.R.wrap.DESeq2.fit(D,X,"V1")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment