Comments (6)
gene-net1.txt is a matrix and its dimension is 6782*6782, which means interaction between any two genes is recorded in this file.
To obtain a file like this:
- download gene interactions data (eg.GI.txt ) from Humannet v2.0.
- select the genes you are interested in from GI.txt and build a new file.
The format of the new file should like this:
EntrezGeneID1 EntrezGeneID2 interaction_score
10054 10055 5.05335388993672
116150 79947 5.05271998874105
23399 255919 5.04390232648848
2339 2342 5.04149870387255
6389 6390 5.04008076384162
5432 5439 5.02733989558101
593 594 5.02134747384889 - If the number of genes you are interested in is N, you can build a N*N matrix. Each column and row is the list of genes.
- fill the matrix with the new file in step 2.
- Normalized this matrix.
from lncrna-target-gene.
Thanks for your prompt reply, do you need to fill it manually in the fourth step or is there any code that can be implemented?
from lncrna-target-gene.
You need to write a two-layer ‘for’ loop.
from lncrna-target-gene.
Can you provide the program code? I would be very grateful, if it is not convenient, forget it.
from lncrna-target-gene.
This is a demo of the code. You can try to fix it to work in your project.
library(data.table)
GI_new=fread('GI_new.txt',stringsAsFactor=F,data.table=F)
allgene=fread('allgene.txt',stringsAsFactor=F,data.table=F) ##genes you are interested in
A=matrix(0,nrow(allgene),nrow(allgene))
for (i in 1:nrow(allgene)){
for (j in i:nrow(allgene)){
index1=which(GI_new[,1]==allgene[i,1])
index2=which(GI_new[,2]==allgene[j,1])
index=intersect(index1,index2)
if (length(index)==0){
index1=which(GI_new[,2]==allgene[i,1])
index2=which(GI_new[,1]==allgene[j,1])
index=intersect(index1,index2)
}
if (length(index)!=0){
A[i,j]=GI_new[index,3]
A[j,i]=GI_new[index,3]
}
}
}
from lncrna-target-gene.
Thanks so much for your enthusiastic help, which solved one of my difficulties!
from lncrna-target-gene.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lncrna-target-gene.