Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replicating features in resources/Xreducedall.2002.npy #9

Open
AvantiShri opened this issue Oct 18, 2018 · 2 comments
Open

Replicating features in resources/Xreducedall.2002.npy #9

AvantiShri opened this issue Oct 18, 2018 · 2 comments

Comments

@AvantiShri
Copy link

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

@jzthree
Copy link
Collaborator

jzthree commented Oct 22, 2018

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

@szhang0112
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants