ExPecto icon indicating copy to clipboard operation
ExPecto copied to clipboard

Replicating features in resources/Xreducedall.2002.npy

Open AvantiShri opened this issue 5 years ago • 2 comments

Hello,

I'm trying to replicate the features in resources/Xreducedall.2002.npy. I am able to get within 99% spearman correlation, but I'm not able to replicate the features exactly. Would you be able to provide the script that was used to produce these features? My attempt at replication is at https://github.com/kundajelab/ExPecto/blob/0a337ec04b451ebdadc62368bec8f05f37b8d6cf/example/Replicate%20ExPecto%20Features.ipynb

AvantiShri avatar Oct 18 '18 23:10 AvantiShri

Hello-

My script loads the chromatin feature predictions and do this

rank = np.arange(100)
Xreducedall = [np.tensordot(Xfor[:,:100,:],np.exp(i*rank),axes=([1],[0])) for i in [-0.01, -0.02, -0.05, -0.1, -0.2] ] + \
[np.tensordot(Xrev[:,:100,:],np.exp(i*rank),axes=([1],[0])) for i in [-0.01, -0.02, -0.05, -0.1, -0.2] ]
Xreducedall=np.concatenate(Xreducedall,axis=1)

Xfor and Xrev are numpy arrays each with dimensions [batch, 100 spatial bins, 2002 features] for downstream and upsteam of TSS respectively. I used lua code to generate Xfor and Xrev at the time but it should be no different from what you can do with pytorch.

Hope this helps! Jian

jzthree avatar Oct 22 '18 18:10 jzthree

@AvantiShri I found if you change this line in block 5 shifts = np.array(list(range(-20000,20000,200)))+100 to shifts = np.array(list(range(-20000,20000,200))), the discrepancy would be almost zero.

szhang0112 avatar Mar 15 '19 19:03 szhang0112