Skip to content

Commit

Permalink
version 3.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
A.J. Muñoz-Pajares authored and gaborcsardi committed Feb 27, 2015
1 parent 9cfc31c commit b95f7ba
Show file tree
Hide file tree
Showing 12 changed files with 132 additions and 80 deletions.
12 changes: 6 additions & 6 deletions DESCRIPTION
Expand Up @@ -2,16 +2,16 @@ Package: sidier
Type: Package
Title: Substitution and Indel Distances to Infer Evolutionary
Relationships
Version: 3.0
Date: 2014-10-20
Version: 3.0.1
Date: 2015-02-27
Author: A. Jesus Muñoz Pajares
Maintainer: A.J. Muñoz-Pajares <ajesusmp@ugr.es>
Depends: R (>= 2.10.1)
Depends: R (>= 3.1.2)
Imports: ape, network, igraph, gridBase, grid, ggmap, ggplot2
Encoding: UTF-8
Description: sidier is a library and R package for evolutionary reconstruction based on substitutions and insertion-deletion (indels) analyses in a distance-based framework.
Description: Evolutionary reconstruction based on substitutions and insertion-deletion (indels) analyses in a distance-based framework.
License: GPL-2
Packaged: 2014-11-18 17:13:02 UTC; ajesusmp
Packaged: 2015-02-27 11:45:53 UTC; ajesusmp
NeedsCompilation: no
Repository: CRAN
Date/Publication: 2014-11-18 18:42:14
Date/Publication: 2015-02-28 01:23:26
22 changes: 11 additions & 11 deletions MD5
@@ -1,6 +1,6 @@
643064b6b164cd775bb45e9df3afcab2 *DESCRIPTION
06b9b775b33f9b15f873e60b492f26c8 *DESCRIPTION
9887b0790b845201f27be77e87b3592a *NAMESPACE
db93749b73aaea88cc30fe25a752048a *NEWS
4c47fb2d41a6d3b0d64b0d5a2b5fd918 *NEWS
3ae3b56ed216f175472563038ee1a871 *R/BARRIEL.R
befd4a83910f6b28924724aa7151738b *R/FIFTH.R
8d22dbc99309f167780ff255544bed5e *R/FindHaplo.R
Expand All @@ -11,22 +11,22 @@ c7350a1ba650dcb71d5db0e30660cb11 *R/MCIC.R
749ccb5cb584927d1a4861f392471f38 *R/SIC.R
1d73e61b64a2288c9feee69455b504d2 *R/colour.scheme.R
0c241d9d86699c0dd49a34ea6a00ab71 *R/distance.comb.R
4c378e8aafa305099aa83470467497d6 *R/double.plot.R
56aff92966df068852e26a703dd32390 *R/double.plot.R
ef9ad8c0ecf80072b769d5176810ec60 *R/mergeNodes.R
5f73601975f24fdcac77d9e94f185a01 *R/mutation.network.R
847233bc8004aadfcd660cffe47dd343 *R/mutation.network.R
5d3d8cb60e38b85dbbe3def9f0b86d38 *R/mutationSummary.R
5148056729d2ab5cbdeb6a84c2dc4f4e *R/nt.gap.comb.R
6afe9c4b875e823df60fd3d8e7ed0b69 *R/perc.thr.R
540500bd00866348007b19caceb918a0 *R/pie.network.R
f35c54bc7b4310a2f919d09b5880bd6a *R/perc.thr.R
bb83df8a267a4ff5069ef681c1836a86 *R/pie.network.R
b96adbec0e52e220d2594085b9e6824b *R/pop.dist.R
c145fcca709586ffdae41a6bfb5e093b *R/simplify.network.R
32b50883e7ff3a443bcb68150cd180c7 *R/simuEvolution.R
599a67713f42f4bb1b776dd119278b78 *R/single.network.R
d54889884ace07a8fb17cc9d59701912 *R/spatial.plot.R
3e0e85a1c37a88d94dc4ed4e85e77bdb *R/spatial.plot.R
96ef0e4246eba718daea6a8907831abb *R/zero.thr.R
463ee712d3be151aecc85cafc1b0e2c5 *data/Example_Spatial.plot_Alignment.txt.gz
d0fe3215091811496faa765b2485dcd3 *data/ex_Coords.txt.gz
0ab41afdbc6649261402881576b0bed3 *data/ex_alignment1.rda
fd4026e3179f286c4fee5dada0f20740 *data/ex_alignment1.rda
68344bed64454a54c9a9816dea0dda1d *inst/CITATION
6640546f0c607df1d3dc30449cfb4773 *man/BARRIEL.Rd
354713152bc5c48a3ee1841ae16f03b4 *man/Example_Spatial.plot_Alignment.Rd
Expand All @@ -40,7 +40,7 @@ c4dbd0b111e0a182942a6c2dd9d64c1c *man/SIC.Rd
87546425ce864d9c5d355fa0fc92e2ad *man/alignExample.Rd
700ccacc7cff59ecc5315e7401505d9d *man/colour.scheme.Rd
e447cb903fe99b491d78e91aa7cb0d21 *man/distance.comb.Rd
2828281cb312ed1403c520996a10d193 *man/double.plot.Rd
d378cd006ab6641d888a086cc3136f06 *man/double.plot.Rd
89a1067d3a1403c8c5368b656f7b5874 *man/ex_Coords.Rd
659ea75e6d521f86b3c6020fe43a0cb3 *man/ex_alignment1.Rd
6e19af4eca42b7c01a7e5c765b702235 *man/mergeNodes.Rd
Expand All @@ -50,9 +50,9 @@ ca6358b5d7c00607648b35c027d8b6c1 *man/mutationSummary.Rd
6e01efc0862707af942d68a6c62133ba *man/perc.thr.Rd
9c80d5f694684136a9cdce9d3fb4d661 *man/pie.network.Rd
a606d8ad6be893478f210076e48d6592 *man/pop.dist.Rd
c89732eee1b46f62bb9d72e1acf41fad *man/sidier-package.Rd
ae9c787a05dbf46ad908811ba6cbc47a *man/sidier-package.Rd
094758711c58c8e8d36db7e23b61fdb3 *man/simplify.network.Rd
52f560a4e241b00e2c0f5c34da199ee0 *man/simuEvolution.Rd
48eb6095f0c0badb4f7ebd45b978b1fd *man/single.network.Rd
a0745525d489242cb167a97bb0dbdbe0 *man/spatial.plot.Rd
c72d6da9aa21a2a6eb86dc239a8c54ba *man/spatial.plot.Rd
e4b23ea086a23d742797b91ba5e4380a *man/zero.thr.Rd
10 changes: 10 additions & 0 deletions NEWS
@@ -1,3 +1,13 @@

=========
sidier 3.0.1
=========

Released February 27, 2015

.Functions giving an error for matrices showing off-diagonal zeros have changed. Now these function gives a warning only if no percolation threshold is found.
.double.plot now includes depicting nodes according to haplotype modules

=========
sidier 3.0
=========
Expand Down
32 changes: 19 additions & 13 deletions R/double.plot.R
@@ -1,17 +1,19 @@
double.plot <-
function(align=NA,indel.method="MCIC",substitution.model="raw", pairwise.deletion=TRUE,network.method.mut="percolation",network.method.pie="percolation",range=seq(0,1,0.01), addExtremes=FALSE,alpha.mut="info",alpha.pie="info",combination.method.mut="Corrected", combination.method.pie="Corrected",na.rm.row.col.mut=FALSE,na.rm.row.col.pie=FALSE, save.distance.mut=FALSE, save.distance.name.mut="DistanceMatrix_threshold_Mutations.txt", save.distance.pie=FALSE, save.distance.name.pie="DistanceMatrix_threshold_Pies.txt", bgcol=NA, label.col.mut="black", label.col.pie="black",label.mut=NA,label.pie=NA,label.sub.str.mut=NA,label.sub.str.pie=NA,colInd="red", colSust="black",lwd.mut=1,InScale=1, SuScale=1, lwd.edge=1.5,cex.mut=1,cex.label.mut=1,cex.label.pie=1,cex.vertex=1, main=c("Haplotypes","Populations"),NameIniPopulations=NA, NameEndPopulations=NA, NameIniHaplotypes=NA,NameEndHaplotypes=NA, cex.pie=1, HaplosNames=NA,offset.label=1.5)
function(align=NA,indel.method="MCIC",substitution.model="raw", pairwise.deletion=TRUE,network.method.mut="percolation",network.method.pie="percolation",range=seq(0,1,0.01), addExtremes=FALSE,alpha.mut="info",alpha.pie="info",combination.method.mut="Corrected", combination.method.pie="Corrected",na.rm.row.col.mut=FALSE,na.rm.row.col.pie=FALSE, save.distance.mut=FALSE, save.distance.name.mut="DistanceMatrix_threshold_Mutations.txt", save.distance.pie=FALSE, save.distance.name.pie="DistanceMatrix_threshold_Pies.txt", modules=FALSE, modules.col=NA, bgcol=NA, label.col.mut="black", label.col.pie="black",label.mut=NA,label.pie=NA,label.sub.str.mut=NA,label.sub.str.pie=NA,colInd="red", colSust="black",lwd.mut=1,InScale=1, SuScale=1, lwd.edge=1.5,cex.mut=1,cex.label.mut=1,cex.label.pie=1,cex.vertex=1, main=c("Haplotypes","Populations"),NameIniPopulations=NA, NameEndPopulations=NA, NameIniHaplotypes=NA,NameEndHaplotypes=NA, cex.pie=1, HaplosNames=NA,offset.label=1.5)
{

if(is.na(bgcol[1]))
{
Aux<-GetHaplo(align=align, saveFile =FALSE, format = "fasta", seqsNames = NA,silent=T)
if(is.na(bgcol))
bgcol<-colour.scheme(def=bgcol,N=length(dimnames(Aux)[[1]]))
col.pie<-NA
}

if(is.na(bgcol[1])==F)
bgcol->col.pie
if (modules==FALSE)
{
if(is.na(bgcol[1]))
{
Aux<-GetHaplo(align=align, saveFile =FALSE, format = "fasta", seqsNames = NA,silent=T)
if(is.na(bgcol))
bgcol<-colour.scheme(def=bgcol,N=length(dimnames(Aux)[[1]]))
col.pie<-NA
}

if(is.na(bgcol[1])==FALSE)
bgcol->col.pie
}

if(length(main)==1 & main[1]=="summary")
{
Expand All @@ -30,9 +32,13 @@ main[2]<-paste("Haplotypes network (left) \nPopulations network (right)\n")

layout(matrix(c(1:2),ncol=2))

mutation.network (align=align,indel.method=indel.method,substitution.model=substitution.model,pairwise.deletion=pairwise.deletion, network.method=network.method.mut,range=range,addExtremes=addExtremes,alpha=alpha.mut,combination.method=combination.method.mut, bgcol=bgcol, label.col=label.col.mut,modules=FALSE,colInd=colInd, colSust=colSust,lwd.mut=lwd.mut,lwd.edge=lwd.edge,cex.mut=cex.mut,label=label.mut, cex.label=cex.label.mut,cex.vertex =cex.vertex, na.rm.row.col=na.rm.row.col.mut,save.distance=save.distance.mut, save.distance.name=save.distance.name.mut ,label.sub.str=label.sub.str.mut,silent=TRUE,InScale=InScale, SuScale=SuScale)
a<-mutation.network (align=align,indel.method=indel.method,substitution.model=substitution.model,pairwise.deletion=pairwise.deletion, network.method=network.method.mut,range=range,addExtremes=addExtremes,alpha=alpha.mut,combination.method=combination.method.mut, bgcol=bgcol, label.col=label.col.mut,modules=modules, moduleCol= modules.col,colInd=colInd, colSust=colSust,lwd.mut=lwd.mut,lwd.edge=lwd.edge,cex.mut=cex.mut,label=label.mut, cex.label=cex.label.mut,cex.vertex =cex.vertex, na.rm.row.col=na.rm.row.col.mut,save.distance=save.distance.mut, save.distance.name=save.distance.name.mut ,label.sub.str=label.sub.str.mut,silent=TRUE,InScale=InScale, SuScale=SuScale)
mtext(paste(main[1],"\n"),font=2)

if(modules==TRUE)
#col.pie<-unique(a[[3]][,3])
col.pie<-a[[3]][,3]

pie.network (align=align,indel.method=indel.method,substitution.model=substitution.model,pairwise.deletion=pairwise.deletion, network.method=network.method.pie,range=range,addExtremes=addExtremes,alpha=alpha.pie,combination.method=combination.method.pie, label=label.pie,label.col=label.col.mut,cex.label=cex.label.pie ,label.sub.str=label.sub.str.pie, na.rm.row.col=na.rm.row.col.pie, NameIniPopulations=NameIniPopulations, NameEndPopulations=NameEndPopulations, NameIniHaplotypes=NameIniHaplotypes, NameEndHaplotypes=NameEndHaplotypes,save.distance=save.distance.pie,save.distance.name=save.distance.name.pie, col.pie=col.pie,cex.pie=cex.pie,HaplosNames=HaplosNames,offset.label=offset.label)
mtext(paste(main[2],"\n"),font=2)
}
10 changes: 6 additions & 4 deletions R/mutation.network.R
Expand Up @@ -87,9 +87,6 @@ dis<-mergeNodes(dis)
colnames(salida)<-c("Threshold","#Clusters")
for (j in range)
{
if(length(which(dis==0))!=nrow(dis))
stop("\n\nSome of the off-diagonal elements in your matrix are zero and percolation threshold can not be estimated. Your distance matrix seems to provide low resolution. You may:\n\n1.- Redefine populations by meging those showing distance values of 0 before percolation threshold estimation. For that use the 'merge=TRUE' option \n\n2.- Represent your original distance matrix using the 'No Isolated Nodes Allowed' method. For that use the 'network.method=\"NINA\"' option.\n\n3.- Represent your original distance matrix using the 'zero' method. For that use the 'network.method=\"zero\"' option.")

dis2<-matrix(1,nrow=nrow(dis),ncol=ncol(dis))
lim<-max(dis)*j
fuera<-which(dis>lim)
Expand Down Expand Up @@ -191,6 +188,7 @@ if(network.method=="zero")
M[zero1,zero2]<-1
}
dis2<-M
j<-0
}
}
## 3- END ZERO THRESHOLD
Expand Down Expand Up @@ -218,8 +216,12 @@ if(network.method=="zero")
### END THRESHOLD ESTIMATION ###
#
#
write.table(dis2,file="kk_control_combined_dis2.txt")
#write.table(dis2,file="kk_control_combined_dis2.txt")
#
## WARNING IF percolation threshold is not found:
if(is.na(j) & length(which(dis==0))!=nrow(dis))
warning("\n\nPercolation threshold can not be estimated and some of the off-diagonal elements in your matrix are zero. Your distance matrix seems to provide low resolution. You may:\n\n1.- Redefine populations by meging those showing distance values of 0 before percolation threshold estimation. For that use the 'merge=TRUE' option \n\n2.- Represent your original distance matrix using the 'No Isolated Nodes Allowed' method. For that use the 'network.method=\"NINA\"' option.\n\n3.- Represent your original distance matrix using the 'zero' method. For that use the 'network.method=\"zero\"' option.")

## GETTING NETWORKS ###
G<-graph.adjacency(dis2)
A<-as.network.matrix(dis2)
Expand Down
9 changes: 5 additions & 4 deletions R/perc.thr.R
Expand Up @@ -31,9 +31,6 @@ dis<-mergeNodes(dis)

## END merging nodes ##

if(length(which(dis==0))!=nrow(dis))
warning("\n\nSome of the off-diagonal elements in your matrix are zero. Percolation threshold may not be estimated if the input distance matrix provides low resolution (that is, if there are many off-diagonal zeros). In that case you may:\n\n1.- Redefine populations by meging those showing distance values of 0 before percolation threshold estimation. For that use the 'merge=TRUE' option \n\n2.- Represent your original distance matrix using the 'No Isolated Nodes Allowed' method. For that use the 'NINA.thr' function.\n\n3.- Represent your original distance matrix using the 'zero' method. For that use the 'zero.thr' function.\n\n4.- Use another distance matrix or combine this matrix with other more informative matrix")

for (j in range)
{

Expand Down Expand Up @@ -175,7 +172,11 @@ A<-as.network.matrix(dis2)
vertis<-plot.network(A)
plot.network(A,coord=vertis,vertex.col=as.matrix(bgcol),label=label,usearrows=0,vertex.cex=2.5*cex.vertex,interactive=F, label.pos=5,label.col=label.col,label.cex=0.8*cex.label,main=paste("Percolation threshold=",round(j,ncs),sep=" "))

if(is.na(j)) stop("\n\nNo percolation threshold found.\n\n")
#if(is.na(j)) stop("\n\nNo percolation threshold found.\n\n")

## WARNING IF percolation threshold is not found:
if(is.na(j) & length(which(dis==0))!=nrow(dis))
warning("\n\nPercolation threshold can not be estimated and some of the off-diagonal elements in your matrix are zero. Your distance matrix seems to provide low resolution. You may:\n\n1.- Redefine populations by meging those showing distance values of 0 before percolation threshold estimation. For that use the 'merge=TRUE' option \n\n2.- Represent your original distance matrix using the 'No Isolated Nodes Allowed' method. For that use the 'network.method=\"NINA\"' option.\n\n3.- Represent your original distance matrix using the 'zero' method. For that use the 'network.method=\"zero\"' option.")

if(ptPDF==TRUE)
{
Expand Down
8 changes: 5 additions & 3 deletions R/pie.network.R
Expand Up @@ -158,9 +158,6 @@ dis<-mergeNodes(dis)
colnames(salida)<-c("Threshold","#Clusters")
for (j in range)
{
if(length(which(dis==0))!=nrow(dis))
stop("\n\nSome of the off-diagonal elements in your matrix are zero and percolation threshold can not be estimated. Your distance matrix seems to provide low resolution. You may:\n\n1.- Redefine populations by meging those showing distance values of 0 before percolation threshold estimation. For that use the 'merge=TRUE' option \n\n2.- Represent your original distance matrix using the 'No Isolated Nodes Allowed' method. For that use the 'network.method=\"NINA\"' option.\n\n3.- Represent your original distance matrix using the 'zero' method. For that use the 'network.method=\"zero\"' option.")

# print(paste("Threshold value:",j," Range to test: from ",min(range)," to ",max(range),sep=""))

dis2<-matrix(1,nrow=nrow(dis),ncol=ncol(dis))
Expand Down Expand Up @@ -268,6 +265,7 @@ if(network.method=="zero")
}
dis2<-M
}
j<-0
}
## 3- END ZERO THRESHOLD

Expand All @@ -285,6 +283,7 @@ if(network.method=="zero")
M[zero1,zero2]<-1
}
dis2<-M
j<-0
}


Expand All @@ -294,6 +293,9 @@ if(network.method=="zero")
### END THRESHOLD ESTIMATION ###
#
#
## WARNING IF percolation threshold is not found:
if(is.na(j) & length(which(dis==0))!=nrow(dis))
warning("\n\nPercolation threshold can not be estimated and some of the off-diagonal elements in your matrix are zero. Your distance matrix seems to provide low resolution. You may:\n\n1.- Redefine populations by meging those showing distance values of 0 before percolation threshold estimation. For that use the 'merge=TRUE' option \n\n2.- Represent your original distance matrix using the 'No Isolated Nodes Allowed' method. For that use the 'network.method=\"NINA\"' option.\n\n3.- Represent your original distance matrix using the 'zero' method. For that use the 'network.method=\"zero\"' option.")
#
## GETTING NETWORKS ###
G<-graph.adjacency(dis2)
Expand Down
51 changes: 33 additions & 18 deletions R/spatial.plot.R
@@ -1,5 +1,5 @@
spatial.plot <-
function(dis=NA, align=NA, X=NULL, Y=NULL, indel.method="MCIC", substitution.model="raw",
function(dis=NULL, align=NA, X=NULL, Y=NULL, indel.method="MCIC", substitution.model="raw",
pairwise.deletion=TRUE, alpha="info", combination.method="Corrected",
na.rm.row.col=FALSE, addExtremes=FALSE, NameIniPopulations=NA, NameEndPopulations=NA,
NameIniHaplotypes=NA, NameEndHaplotypes=NA, HaplosNames=NA, save.distance=FALSE,
Expand All @@ -9,7 +9,11 @@ bgcol="white", label.col="black", label=NA, label.sub.str=NA, label.pos= "b",
cex.label=1,cex.vertex=1,vertex.size="equal", plot.edges=TRUE, lwd.edge=1,to.ggmap=FALSE,
plot.ggmap=FALSE, zoom.ggmap=6, maptype.ggmap="satellite", label.size.ggmap=3)
{
if(length(which(is.na(dis)))>0)

if(is.null(dis)==FALSE)
pieSize<-rep(1,nrow(dis))

if(is.null(dis))
{
#### ALIGNMENT OF UNIQUE HAPLOTYPES:
#
Expand Down Expand Up @@ -122,10 +126,18 @@ plot.ggmap=FALSE, zoom.ggmap=6, maptype.ggmap="satellite", label.size.ggmap=3)
}


####### PROBAR A REDEFINIR LOS NOMBRES DE LAS SECUENCIAS NADA MÁS EMPEZAR Y VER SI ASÍ LO HACE BIEN...
dis<-pop.dist(distances=dis,Haplos=HaplosPop[[1]], logfile=FALSE,saveFile=FALSE,NameIniHaplotypes=NameIniHaplotypes, NameEndHaplotypes=NameEndHaplotypes,NameIniPopulations=NameIniPopulations,NameEndPopulations=NameEndPopulations)

### vertex.size

dis<-pop.dist(distances=dis,Haplos=HaplosPop[[1]], logfile=FALSE,saveFile=FALSE,NameIniHaplotypes=NameIniHaplotypes, NameEndHaplotypes=NameEndHaplotypes,NameIniPopulations=NameIniPopulations,NameEndPopulations=NameEndPopulations)
HP<-as.matrix(HaplosPop[[1]])
pieSize<-rowSums(HP)/max(rowSums(HP)) # radius
if(vertex.size=="area")
pieSize<-sqrt(pieSize/pi)/max(sqrt(pieSize/pi)) # area
if(vertex.size=="equal")
pieSize<-rep(1,nrow(HP))
if(vertex.size!="radius" & vertex.size!="area" & vertex.size!="equal")
stop("wrong pie.size defined")

}
#
Expand All @@ -139,9 +151,6 @@ plot.ggmap=FALSE, zoom.ggmap=6, maptype.ggmap="satellite", label.size.ggmap=3)
colnames(salida)<-c("Threshold","#Clusters")
for (j in range)
{
if(length(which(dis==0))!=nrow(dis))
stop("\n\nSome of the off-diagonal elements in your matrix are zero and percolation threshold can not be estimated. Your distance matrix seems to provide low resolution. You may:\n\n1.- Redefine populations by meging those showing distance values of 0 before percolation threshold estimation. For that use the 'merge=TRUE' option \n\n2.- Represent your original distance matrix using the 'No Isolated Nodes Allowed' method. For that use the 'network.method=\"NINA\"' option.\n\n3.- Represent your original distance matrix using the 'zero' method. For that use the 'network.method=\"zero\"' option.")

# print(paste("Threshold value:",j," Range to test: from ",min(range)," to ",max(range),sep=""))

dis2<-matrix(1,nrow=nrow(dis),ncol=ncol(dis))
Expand Down Expand Up @@ -193,6 +202,8 @@ plot.ggmap=FALSE, zoom.ggmap=6, maptype.ggmap="satellite", label.size.ggmap=3)
lim<-max(dis)*j
fuera<-which(dis>lim)
dis2[fuera]<-0


}
## 1- END PERCOLATION THRESHOLD
#
Expand Down Expand Up @@ -249,6 +260,7 @@ if(network.method=="zero")
}
dis2<-M
}
j<-0
}
## 3- END ZERO THRESHOLD

Expand All @@ -266,6 +278,7 @@ if(network.method=="zero")
M[zero1,zero2]<-1
}
dis2<-M
j<-0
}


Expand All @@ -275,6 +288,11 @@ if(network.method=="zero")
### END THRESHOLD ESTIMATION ###
#
#
## WARNING IF percolation threshold is not found:
if(is.na(j) & length(which(dis==0))!=nrow(dis))
warning("\n\nPercolation threshold can not be estimated and some of the off-diagonal elements in your matrix are zero. Your distance matrix seems to provide low resolution. You may:\n\n1.- Redefine populations by meging those showing distance values of 0 before percolation threshold estimation. For that use the 'merge=TRUE' option \n\n2.- Represent your original distance matrix using the 'No Isolated Nodes Allowed' method. For that use the 'network.method=\"NINA\"' option.\n\n3.- Represent your original distance matrix using the 'zero' method. For that use the 'network.method=\"zero\"' option.")
#
#
#
## GETTING NETWORKS ###
G<-graph.adjacency(dis2)
Expand Down Expand Up @@ -319,17 +337,6 @@ if(modules==FALSE)
colores<-bgcol


### vertex.size

HP<-as.matrix(HaplosPop[[1]])
pieSize<-rowSums(HP)/max(rowSums(HP)) # radius
if(vertex.size=="area")
pieSize<-sqrt(pieSize/pi)/max(sqrt(pieSize/pi)) # area
if(vertex.size=="equal")
pieSize<-rep(1,nrow(HP))
if(vertex.size!="radius" & vertex.size!="area" & vertex.size!="equal")
stop("wrong pie.size defined")

#### label names

if(is.na(label[1])==F & is.na(label.sub.str[1])==F)
Expand Down Expand Up @@ -360,6 +367,14 @@ POS<-4

### BEGIN PLOT

if (is.null(X)|is.null(Y))
{
warning("Geographic coordinates not provided. Populations plotted according to the Fruchterman-Reingold algorithm.")
vertis1<-plot.network(A)
X<-vertis1[,1]
Y<-vertis1[,2]
}

rangeX<-max(X)-min(X)
rangeY<-max(Y)-min(Y)

Expand Down
Binary file modified data/ex_alignment1.rda
Binary file not shown.

0 comments on commit b95f7ba

Please sign in to comment.