Giter Site home page Giter Site logo

Comments (6)

zty2009 avatar zty2009 commented on August 18, 2024

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:

  1. download gene interactions data (eg.GI.txt ) from Humannet v2.0.
  2. 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
  3. 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.
  4. fill the matrix with the new file in step 2.
  5. Normalized this matrix.

from lncrna-target-gene.

Salmi9 avatar Salmi9 commented on August 18, 2024

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.

zty2009 avatar zty2009 commented on August 18, 2024

You need to write a two-layer ‘for’ loop.

from lncrna-target-gene.

Salmi9 avatar Salmi9 commented on August 18, 2024

Can you provide the program code? I would be very grateful, if it is not convenient, forget it.

from lncrna-target-gene.

zty2009 avatar zty2009 commented on August 18, 2024

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.

Salmi9 avatar Salmi9 commented on August 18, 2024

Thanks so much for your enthusiastic help, which solved one of my difficulties!

from lncrna-target-gene.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.