Limited-time offer! Save up to 50% Off | Solutions starting at $6 each  

data = read.csv('CancerPatient.csv').

Added on - 15 Nov 2021

Trusted by +2 million users,
1000+ happy students everyday
Showing pages 1 to 4 of 11 pages
data = read.csv('CancerPatient.csv')
>
> #extracting the top 10 rows from the imported data
> dim(data)
[1] 20661 4
> cp=data[1:10,]
> head(cp)
mRNA microRNA weight role
1 OBFC1 hsa-mir-383 0.2250745 gain
2 SHROOM2 hsa-mir-130a 0.3535406 gain
3 GABBR2 hsa-mir-452 0.3048922 loss
4 ZNF90 hsa-mir-452 0.2964542 loss
5 GIGYF1 hsa-mir-3653 0.2580920 gain
6 MICALL1 hsa-mir-375 0.2958907 gain
> library(igraph)
> # subsetting the rows that shows networking
> y = data.frame(cp$microRNA,cp$role)
> #conveting it to matrix
> net =graph.data.frame(y,directed = T)
> as.matrix(net)
IGRAPH 7c1688d DN-- 11 10 --
+ attr: name (v/c)
+ edges from 7c1688d (vertex names):
[1] hsa-mir-383 ->gain hsa-mir-130a->gain hsa-mir-452 ->loss hsa-mir-452 ->loss
[5] hsa-mir-3653->gain hsa-mir-375 ->gain hsa-mir-30e ->gain hsa-mir-744 ->gain
[9] hsa-mir-215 ->loss hsa-mir-204 ->loss
> #obtaining the vertices of the matrix
> V(net)
+ 11/11 vertices, named, from 7c1688d:
[1] hsa-mir-383 hsa-mir-130a hsa-mir-452 hsa-mir-3653 hsa-mir-375
[6] hsa-mir-30e hsa-mir-744 hsa-mir-215 hsa-mir-204 gain
[11] loss
> #obtaining the edges of the matrix
> E(net)
+ 10/10 edges from 7c1688d (vertex names):
[1] hsa-mir-383 ->gain hsa-mir-130a->gain hsa-mir-452 ->loss hsa-mir-452 ->loss
[5] hsa-mir-3653->gain hsa-mir-375 ->gain hsa-mir-30e ->gain hsa-mir-744 ->gain
[9] hsa-mir-215 ->loss hsa-mir-204 ->loss
> V(net)$label =V(net)$name
>
> #plotting the network of the data
> set.seed(123)
> plot(net,
+ vertex.color =rainbow(52),
+
+ edge.arrow.size =0.3,
+ layout=layout.fruchterman.reingold)
> #obtaining the measurements
> data1 <- graph.data.frame(data, directed=F)
> degree(net)
hsa-mir-383 hsa-mir-130a hsa-mir-452 hsa-mir-3653 hsa-mir-375 hsa-mir-30e
1 1 2 1 1 1
hsa-mir-744 hsa-mir-215 hsa-mir-204 gain loss
1 1 1 6 4
> eigen_centrality(net)
$`vector`
hsa-mir-383 hsa-mir-130a hsa-mir-452 hsa-mir-3653 hsa-mir-375 hsa-mir-30e
0.4082483 0.4082483 0.6232186 0.4082483 0.4082483 0.4082483
hsa-mir-744 hsa-mir-215 hsa-mir-204 gain loss
0.4082483 0.3116093 0.3116093 1.0000000 0.7632838
$value
[1] 2.44949
$options
$options$`bmat`
[1] "I"
$options$n
[1] 11
$options$which
[1] "LA"
$options$nev
[1] 1
$options$tol
[1] 0
$options$ncv
[1] 0
$options$ldv
[1] 0
$options$ishift
[1] 1
$options$maxiter
[1] 1000
desklib-logo
You’re reading a preview
Preview Documents

To View Complete Document

Click the button to download
Subscribe to our plans

Download This Document