Last data update: 2014.03.03

R: compares two given networks (original and augmented,...
complete_restartR Documentation

compares two given networks (original and augmented, presented as undirected graphs) using a path analysis

Description

This function is equivalent to the complete_network function, but it uses a fixed number of pathways to be investigated, which are divided in groups to allow restarting or better dispatching of tasks in a cluster environment.

Usage

	complete_restart(g1,g2,
					     taxnames,
					     resultfile='result.txt',
					     size=1000,
					     start=1,
					     end=0,
					     maxdistance=0,
					     maxtime=3600,
					     maxnode=0,
					     verbose=FALSE,
					     file='log.txt',
					     maxcores=1
					)

Arguments

g1

the original network X

g2

the augmented network Y with additional nodes (all the original nodes from X must be present in the augmented network Y)

taxnames

the taxon name of the nodes added to the original graph (default: we select all nodes that are not in g1)

resultfile

filename to which results are saved after each group (default='result.txt')

size

the number of paths to investigate at each iteration of the algorithm (default=1000)

start

the starting group of path lengths to investigate (default=1)

end

the ending group of path lengths to investigate (default=0 i.e. run until the end)

maxnode

the maximum number of augmented nodes in network Y to take into account (default=0, no maximum number of augmented nodes to take into account)

maxtime

the maximum search time per pathway (default=3600 seconds)

maxdistance

the maximum search distance to the added nodes in network Y (default=0, no maximum distance for augmented nodes to take into account)

verbose

flag to save into a file additionnal informations regarding the obtained paths (default=FALSE, the file name should be indicated)

file

filename to save the additionnal informations

maxcores

maximum number of cores to use (default=1, use 0 to use half of the total cores available )

Value

This function returns the number of paths of each category : Shortcuts, Detours, Dead ends, Equal paths and disconnected nodes.
If some of the augmented nodes are not visited because of the limits defined by maxnode, maxtime or maxdistance, a path can also be classified as 'Detour or Dead End'.

The format of the resultfile is as follow (tab-separated-value):
Columns:
1. Group number
2. Disconnected nodes
3. Shortcuts
4. Egals
5. Detours
6. Dead ends
7. Undefined detour or dead end*
8. Total path evaluated
9. User time (seconds)
10. System time (seconds)
11. Real time (seconds)
12. Disconnected total (up to this group)
13. Shortcut total (up to this group)
14. Egal total (up to this group)
15. Detour total (up to this group)
16. Dead end total (up to this group)
17. Undefined total (up to this group)
18. Total path evaluated (up to this group)
19. Total user time (up to this group)
20. Total system time (up to this group)
21. Total real time (up to this group)

Examples

## Searching the sample data (containing 11 original nodes and 3 augmented nodes)
data(Sample_1)
## Run from group number 1 to 2
complete_restart(g1,g2,size=5, start=1,end=2)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(SDDE)
Loading required package: igraph

Attaching package: 'igraph'

The following objects are masked from 'package:stats':

    decompose, spectrum

The following object is masked from 'package:base':

    union

Loading required package: doParallel
Loading required package: foreach
Loading required package: iterators
Loading required package: parallel
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/SDDE/complete_restart.Rd_%03d_medium.png", width=480, height=480)
> ### Name: complete_restart
> ### Title: compares two given networks (original and augmented, presented
> ###   as undirected graphs) using a path analysis
> ### Aliases: complete_restart
> 
> ### ** Examples
> 
> ## Searching the sample data (containing 11 original nodes and 3 augmented nodes)
> data(Sample_1)
> ## Run from group number 1 to 2
> complete_restart(g1,g2,size=5, start=1,end=2)
Total 55 pathways to evaluated divided into 12 groups.
====================================
Run parameters:
Taxnames:  
Group size: 5 
Start group: 1 
End group: 2 
Maxdistance: 0 
Maxtime: 3600 
Maxnode: 0 
Maxcores: 1 
====================================
Networks statistics:
Network characteristics:
Total of new nodes in network Y: 3 
Number of edges in network Y: 17 
Number of nodes in network Y: 14 
Number of nodes in network X: 11 
Total of pathways to investigate: 55 
Clustering coefficient network Y: 0 
Clustering coefficient network X: 0 
Average degree <U+00B1> std in network Y: 2.428571 <U+00B1> 1.01635 
Average degree <U+00B1> std in network X: 2 <U+00B1> 0.8944272 
Average path length in network Y: 2.119403 
Average path length in network X: 2.162162 
Number of clusters in network Y: 2 
Number of clusters in network X: 2 
Average cluster size <U+00B1> std in network Y: 7 <U+00B1> 7.071068 
Average cluster size <U+00B1> std in network X: 5.5 <U+00B1> 4.949747 
Nodes distribution in network Y (first row taxa, second row count):
 1  2 
11  3 
====================================
Running group 1 of 12  (total time 0.46  sec.)
Running group 2 of 12  (total time 0.349  sec.)
  disconnected nodes shortcuts equals detours dead ends Dead ends or detour
1                  2         1      2       5         0                   0
  total user time system time real time
1    10     0.308       0.008     0.809
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>