Skip to content

Commit

Permalink
Remove LazyLoad. Uploaded to CRAN.
Browse files Browse the repository at this point in the history
  • Loading branch information
zaynabhammoud committed Jun 2, 2021
1 parent 5e592cf commit e44938b
Show file tree
Hide file tree
Showing 18 changed files with 99 additions and 102 deletions.
3 changes: 1 addition & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: mully
Type: Package
Title: Create, Modify and Visualize Multi-Layered Networks
Version: 2.1.32
Version: 2.1.33
Author: Zaynab Hammoud
Maintainer: Zaynab Hammoud <[email protected]>
Description: Allows the user to create graph with multiple layers. The user can also modify the layers, the nodes, and the edges. The graph can also be visualized.
Expand All @@ -12,7 +12,6 @@ URL: https://github.com/frankkramer-lab/mully
BugReports: https://github.com/frankkramer-lab/mully/issues
License: GPL (>= 2)
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.1.1
Imports:
igraph,
Expand Down
5 changes: 2 additions & 3 deletions mully.Rcheck/00_pkg_src/mully/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: mully
Type: Package
Title: Create, Modify and Visualize Multi-Layered Networks
Version: 2.1.30
Version: 2.1.33
Author: Zaynab Hammoud
Maintainer: Zaynab Hammoud <[email protected]>
Description: Allows the user to create graph with multiple layers. The user can also modify the layers, the nodes, and the edges. The graph can also be visualized.
Expand All @@ -12,10 +12,9 @@ URL: https://github.com/frankkramer-lab/mully
BugReports: https://github.com/frankkramer-lab/mully/issues
License: GPL (>= 2)
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.1.1
Imports: igraph, rgl, randomcoloR, shape
Suggests: knitr, rmarkdown
VignetteBuilder: knitr
NeedsCompilation: no
Packaged: 2020-12-15 15:27:32 UTC; Administrator
Packaged: 2021-06-02 11:02:54 UTC; Administrator
2 changes: 1 addition & 1 deletion mully.Rcheck/00_pkg_src/mully/R/mully_constructor.R
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ print.mully<-function(x,...){
if(!is.na(x$name)){
cat(paste(" -- ",x$name))
}
if(x$iLayer==0){
if(dim(x$layers)[1]==0){
cat("\nEmpty Graph")
return()
}
Expand Down
12 changes: 9 additions & 3 deletions mully.Rcheck/00_pkg_src/mully/R/mully_edge.R
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,16 @@ removeEdge <- function(g, nodeStart, nodeDest,attributes=NA, multi=FALSE) {
class(g) = c("mully",class(g))
return(g)
}

df=cbind(as.data.frame(list(V1=nodeStart,V2=nodeDest),stringsAsFactors = FALSE),as.data.frame(attributes))
df1=cbind(as.data.frame(list(V1=nodeDest,V2=nodeStart),stringsAsFactors = FALSE),as.data.frame(attributes))
allEdges=getEdgeAttributes(g,nodeStart,nodeDest)
df=as.data.frame(list(V1=nodeStart,V2=nodeDest),stringsAsFactors = FALSE)
df1=as.data.frame(list(V1=nodeDest,V2=nodeStart),stringsAsFactors = FALSE)

if(!is.na(attributes)){
df=cbind(df,as.data.frame(attributes))
df1=cbind(df1,as.data.frame(attributes))
colnames(df)=c(c("V1","V2",names(attributes)))
colnames(df1)=c(c("V1","V2",names(attributes)))
}

c1=getIDCommonDF(allEdges,df)
c2=getIDCommonDF(allEdges,df1)
Expand Down
5 changes: 3 additions & 2 deletions mully.Rcheck/00_pkg_src/mully/R/mully_layer.R
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ removeLayer <- function(g, name,trans=FALSE) {
stop("Invalid Arguments")
}
for (layer in name) {
if (!isLayer(g, name)) {
layer=tolower(layer)
if (!isLayer(g, layer)) {
message(paste(c(
"Layer ", layer, " Does Not Exist and will be skipped"
)))
Expand All @@ -148,7 +149,7 @@ removeLayer <- function(g, name,trans=FALSE) {
nodes = getLayer(g, layer)$name
for(j in 1:length(nodes))
g <- removeNode(g, nodes[j],trans)
g$layers=g$layers[-which(g$layers$Name==name),]
g$layers=g$layers[-which(g$layers$NameLower==layer),]
}
return(g)
}
Expand Down
22 changes: 1 addition & 21 deletions mully.Rcheck/00_pkg_src/mully/R/mully_node.R
Original file line number Diff line number Diff line change
Expand Up @@ -178,32 +178,12 @@ getNodeAttributes<-function(g,nameNode,layerByName=FALSE){
stop("Node Does not Exist")
}
return(attributes[which(attributes$name==nameNode),])

}


getIDCommonDF<-function(df,df1){
dfNames=colnames(df)
df1Names=colnames(df1)
for(name in dfNames){
if(!name%in%df1Names){
ltemp=list(NA)
names(ltemp)=c(name)
dftemp=as.data.frame(ltemp)
df1=cbind(df1,dftemp)
}
}

for(name in df1Names){
if(!name%in%dfNames){
ltemp=list(NA)
names(ltemp)=c(name)
dftemp=as.data.frame(ltemp)
df=cbind(df,dftemp)
}
}
#Get the common rows
common=merge.data.frame(df,df1,stringsAsFactors = FALSE)
common=merge.data.frame(df,df1)
#No Common Rows
if(dim(common)[1]==0){
return(NULL)
Expand Down
62 changes: 39 additions & 23 deletions mully.Rcheck/00_pkg_src/mully/R/mully_visualization.R
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,14 @@ plot3d <- function(g, layers = TRUE,
vertex.label=NA,vertex.label.color = NA,vertex.plac="circle",
edge.color=NA,edge.width=5,
edge.arrow.size=10,edge.arrow.width=1) {
#Check if Graph is Empty
if(dim(g$layers)[1]==0){
stop("This mully Graph is empty.")
}
#Check if Graph has no nodes
if(length(V(g))==0){
stop("This mully Graph has no nodes.")
}
rgl.open()
rgl.bg(
sphere = TRUE,
Expand Down Expand Up @@ -192,25 +200,28 @@ plot3d <- function(g, layers = TRUE,
originalColors=assignedColors[which(!is.na(assignedColors))]
if(length(originalColors)!=0)
V(g)[which(!is.na(assignedColors))]$color=originalColors
#Add edge colors
if (is.null(E(g)$color))
E(g)$color = NA
if(is.na(edge.color)){
edgecolors = c()
AllEdges = getEdgeAttributes(g)
for (i in 1:dim(AllEdges)[1]) {
#Pre-assigned color
if(!is.na(E(g)$color[i]))
edgecolors=c(edgecolors,E(g)$color[i])
V1 = V(g)[which(V(g)$name == AllEdges[i, 1])]
V2 = V(g)[which(V(g)$name == AllEdges[i, 2])]
if (V1$n == V2$n)
edgecolors = c(edgecolors, V1$color)
else
edgecolors = c(edgecolors, "black")
edgecolors=NULL
if(length(E(g))!=0){
#Add edge colors
if (is.null(E(g)$color))
E(g)$color = NA
if(is.na(edge.color)){
edgecolors = c()
AllEdges = getEdgeAttributes(g)
for (i in 1:dim(AllEdges)[1]) {
#Pre-assigned color
if(!is.na(E(g)$color[i]))
edgecolors=c(edgecolors,E(g)$color[i])
V1 = V(g)[which(V(g)$name == AllEdges[i, 1])]
V2 = V(g)[which(V(g)$name == AllEdges[i, 2])]
if (V1$n == V2$n)
edgecolors = c(edgecolors, V1$color)
else
edgecolors = c(edgecolors, "black")
}
edge.color=edgecolors
}
}
edge.color=edgecolors
}

layout = get3DLayout(g,vertex.plac)

Expand All @@ -232,8 +243,12 @@ plot3d <- function(g, layers = TRUE,
rgl::aspect3d(1, 1, 1)
#Add layers
if (layers == TRUE) {
layout1 = layout[order(V(g)$n), ]
layout1=as.matrix(layout)
if(dim(layout1)[1]>1){
layout1 = layout[order(V(g)$n), ]
}
clrs = unique(V(g)$color[order(V(g)$n)])
clrs=clrs[-which(clrs%in%assignedColors)]
temp = 1
iColr=1
for (i in 1:dim(g$layers)[1]) {
Expand All @@ -242,10 +257,11 @@ plot3d <- function(g, layers = TRUE,
nNodes = length(which(V(g)$n == idLayer))
if(nNodes==0)
next
coord = layout1[temp:(temp + nNodes - 1), ]
if(nNodes==1)
coord = t(as.matrix(layout1[temp, ]))
plane = suppressWarnings(get3DPlane(coord, g$iLayer,nNodes))
else
coord = as.matrix(layout1[temp:(temp + nNodes - 1), ])
plane = suppressWarnings(get3DPlane(coord, dim(g$layers)[1],nNodes))
rgl.planes(
0,
b = plane[2],
Expand Down Expand Up @@ -300,8 +316,8 @@ get3DLayout <- function(g,plac) {
z = unlist(dfLayout$z)
))
}
getEquationPlane <- function(x1, y1, z1, x2, y2, z2, x3, y3, z3)
{
getEquationPlane <- function(x1, y1, z1, x2, y2, z2, x3, y3, z3){

a1 = x2 - x1

b1 = y2 - y1
Expand Down
10 changes: 3 additions & 7 deletions mully.Rcheck/00check.log
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@
* using option '--as-cran'
* checking for file 'mully/DESCRIPTION' ... OK
* checking extension type ... Package
* this is package 'mully' version '2.1.30'
* this is package 'mully' version '2.1.33'
* package encoding: UTF-8
* checking CRAN incoming feasibility ... WARNING
* checking CRAN incoming feasibility ... Note_to_CRAN_maintainers
Maintainer: 'Zaynab Hammoud <[email protected]>'

Insufficient package version (submitted: 2.1.30, existing: 2.1.30)

Days since last update: 0
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
Expand Down Expand Up @@ -66,4 +62,4 @@ Files 'README.md' or 'NEWS.md' cannot be checked without 'pandoc' being installe
* checking for non-standard things in the check directory ... OK
* checking for detritus in the temp directory ... OK
* DONE
Status: 1 WARNING, 1 NOTE
Status: 1 NOTE
20 changes: 10 additions & 10 deletions mully.Rcheck/Rdlatex.log
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ LaTeX Font Warning: Font shape `OML/zi4/m/n' undefined
(Font) for symbol `textless' on input line 21.


Overfull \hbox (17.78166pt too wide) in paragraph at lines 47--51
Overfull \hbox (17.78166pt too wide) in paragraph at lines 46--50
\OT1/cmr/m/n/10 pack-age is im-ple-mented as a part of [the Mul-ti-path Project
](https://www.sys-med.de/en/junior-

Overfull \hbox (237.55087pt too wide) in paragraph at lines 47--51
Overfull \hbox (237.55087pt too wide) in paragraph at lines 46--50
\OT1/cmr/m/n/10 research-groups/multipath/) di-rected by [Dr. Frank Kramer](htt
ps://www.uni-augsburg.de/de/fakultaet/fai/informatik/prof/misit/mitarbeiter/)
[1{c:/Users/Administrator/AppData/Roaming/TinyTeX/texmf-var/fonts/map/pdftex/up
Expand Down Expand Up @@ -163,7 +163,7 @@ t/fonts/type1/public/amsfonts/cm/cmsl10.pfb><c:/Users/Administrator/AppData/Roa
ming/TinyTeX/texmf-dist/fonts/type1/public/amsfonts/cm/cmss12.pfb><c:/Users/Adm
inistrator/AppData/Roaming/TinyTeX/texmf-dist/fonts/type1/public/amsfonts/cm/cm
ti10.pfb>
Output written on Rd2.pdf (15 pages, 146154 bytes).
Output written on Rd2.pdf (15 pages, 145504 bytes).
Transcript written on Rd2.log.
This is makeindex, version 2.15 [TeX Live 2020/W32TeX] (kpathsea + Thai support).
Scanning input file Rd2.idx....done (40 entries accepted, 0 rejected).
Expand Down Expand Up @@ -291,11 +291,11 @@ LaTeX Font Warning: Font shape `OML/zi4/m/n' undefined

(./Rd2.toc [1{c:/Users/Administrator/AppData/Roaming/TinyTeX/texmf-var/fonts/ma
p/pdftex/updmap/pdftex.map}])
Overfull \hbox (17.78166pt too wide) in paragraph at lines 47--51
Overfull \hbox (17.78166pt too wide) in paragraph at lines 46--50
\OT1/cmr/m/n/10 pack-age is im-ple-mented as a part of [the Mul-ti-path Project
](https://www.sys-med.de/en/junior-

Overfull \hbox (237.55087pt too wide) in paragraph at lines 47--51
Overfull \hbox (237.55087pt too wide) in paragraph at lines 46--50
\OT1/cmr/m/n/10 research-groups/multipath/) di-rected by [Dr. Frank Kramer](htt
ps://www.uni-augsburg.de/de/fakultaet/fai/informatik/prof/misit/mitarbeiter/)
[2] [3] [4] [5] [6] [7] [8] [9] [10] [11]
Expand Down Expand Up @@ -331,7 +331,7 @@ t/fonts/type1/public/amsfonts/cm/cmsl10.pfb><c:/Users/Administrator/AppData/Roa
ming/TinyTeX/texmf-dist/fonts/type1/public/amsfonts/cm/cmss12.pfb><c:/Users/Adm
inistrator/AppData/Roaming/TinyTeX/texmf-dist/fonts/type1/public/amsfonts/cm/cm
ti10.pfb>
Output written on Rd2.pdf (17 pages, 152397 bytes).
Output written on Rd2.pdf (17 pages, 151740 bytes).
Transcript written on Rd2.log.
This is makeindex, version 2.15 [TeX Live 2020/W32TeX] (kpathsea + Thai support).
Scanning input file Rd2.idx....done (40 entries accepted, 0 rejected).
Expand Down Expand Up @@ -459,11 +459,11 @@ LaTeX Font Warning: Font shape `OML/zi4/m/n' undefined

(./Rd2.toc [1{c:/Users/Administrator/AppData/Roaming/TinyTeX/texmf-var/fonts/ma
p/pdftex/updmap/pdftex.map}])
Overfull \hbox (17.78166pt too wide) in paragraph at lines 47--51
Overfull \hbox (17.78166pt too wide) in paragraph at lines 46--50
\OT1/cmr/m/n/10 pack-age is im-ple-mented as a part of [the Mul-ti-path Project
](https://www.sys-med.de/en/junior-

Overfull \hbox (237.55087pt too wide) in paragraph at lines 47--51
Overfull \hbox (237.55087pt too wide) in paragraph at lines 46--50
\OT1/cmr/m/n/10 research-groups/multipath/) di-rected by [Dr. Frank Kramer](htt
ps://www.uni-augsburg.de/de/fakultaet/fai/informatik/prof/misit/mitarbeiter/)
[2] [3] [4] [5] [6] [7] [8] [9] [10] [11]
Expand Down Expand Up @@ -494,8 +494,8 @@ t/fonts/type1/public/amsfonts/cm/cmsl10.pfb><c:/Users/Administrator/AppData/Roa
ming/TinyTeX/texmf-dist/fonts/type1/public/amsfonts/cm/cmss12.pfb><c:/Users/Adm
inistrator/AppData/Roaming/TinyTeX/texmf-dist/fonts/type1/public/amsfonts/cm/cm
ti10.pfb>
Output written on Rd2.pdf (17 pages, 153210 bytes).
Output written on Rd2.pdf (17 pages, 152519 bytes).
Transcript written on Rd2.log.
Saving output to 'mully-manual.pdf' ...
Done
You may want to clean up by 'rm -Rf C:/Users/ADMINI~1/AppData/Local/Temp/RtmpoVsoqC/Rd2pdf3a4876c4985'
You may want to clean up by 'rm -Rf C:/Users/ADMINI~1/AppData/Local/Temp/Rtmp0iBLYm/Rd2pdf3d4848d85445'
11 changes: 6 additions & 5 deletions mully.Rcheck/mully-Ex.Rout
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ mully -- MyFirstMully
4 dr3 g2 mutates and causes
5 d3 dr3 treats
> getLayer(g,"gene")
+ 2/8 vertices, named, from 3cba9c9:
+ 2/8 vertices, named, from 59f30b3:
[1] g1 g2
>
>
Expand Down Expand Up @@ -413,7 +413,7 @@ mully -- MyFirstMully
4 dr3 g2 mutates and causes
5 d3 dr3 treats
> getNode(g,"g1")
+ 1/8 vertex, named, from 3cd42ee:
+ 1/8 vertex, named, from 5a0b3db:
[1] g1
>
>
Expand Down Expand Up @@ -720,8 +720,9 @@ mully -- MyFirstMully
> removeLayer(g,"gene",trans=TRUE)
mully -- MyFirstMully
3 Layers:
[1] ID Name NameLower
<0 rows> (or 0-length row.names)
ID Name NameLower
2 2 Drug drug
3 3 Disease disease

6 Nodes:
name n type effect desc
Expand Down Expand Up @@ -803,7 +804,7 @@ mully -- MyFirstMully
> cleanEx()
> options(digits = 7L)
> base::cat("Time elapsed: ", proc.time() - base::get("ptime", pos = 'CheckExEnv'),"\n")
Time elapsed: 2.86 0.34 3.24 NA NA
Time elapsed: 2.49 0.31 2.99 NA NA
> grDevices::dev.off()
null device
1
Expand Down
Binary file modified mully.Rcheck/mully-Ex.pdf
Binary file not shown.
26 changes: 13 additions & 13 deletions mully.Rcheck/mully-Ex.timings
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
name user system elapsed
addEdge 0.03 0.02 0.03
addLayer 0.01 0.00 0.01
addNode 0.01 0.01 0.03
addEdge 0.05 0.00 0.05
addLayer 0 0 0
addNode 0.03 0.00 0.03
exportCSV 0 0 0
getEdgeAttributes 0.03 0.00 0.04
getIDEdge 0.03 0.00 0.03
getIDNode 0.03 0.00 0.03
getEdgeAttributes 0.03 0.00 0.03
getIDEdge 0.02 0.00 0.01
getIDNode 0.02 0.00 0.02
getLayer 0.03 0.00 0.03
getLayersCount 0 0 0
getNode 0.03 0.00 0.03
getNodeAttributes 0.02 0.00 0.01
getNodeAttributes 0.03 0.00 0.03
isLayer 0 0 0
mully 0 0 0
plot.mully 0.11 0.00 0.11
plot3d 0.34 0.05 0.44
print.mully 0.03 0.00 0.03
removeEdge 0.03 0.00 0.03
removeLayer 0.01 0.00 0.02
removeNode 0.01 0.00 0.01
plot.mully 0.08 0.00 0.11
plot3d 0.18 0.05 0.39
print.mully 0.02 0.00 0.01
removeEdge 0.02 0.00 0.01
removeLayer 0.01 0.00 0.01
removeNode 0.03 0.00 0.03
Loading

0 comments on commit e44938b

Please sign in to comment.