[Seqinr-commits] r2114 - in pkg: . R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue May 18 14:53:14 CEST 2021


Author: simonpenel
Date: 2021-05-18 14:53:14 +0200 (Tue, 18 May 2021)
New Revision: 2114

Modified:
   pkg/DESCRIPTION
   pkg/R/dia.bactgensize.R
Log:
replace ftp by https in dia.bactgensize.R

Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION	2021-05-18 12:29:27 UTC (rev 2113)
+++ pkg/DESCRIPTION	2021-05-18 12:53:14 UTC (rev 2114)
@@ -1,7 +1,7 @@
 Encoding: UTF-8
 Package: seqinr
 Version: 4.2-8
-Date: 2021-03-17
+Date: 2021-05-18
 Title: Biological Sequences Retrieval and Analysis
 Authors at R: c(person("Delphine", "Charif", role = "aut"),
              person("Olivier", "Clerc", role = "ctb"),

Modified: pkg/R/dia.bactgensize.R
===================================================================
--- pkg/R/dia.bactgensize.R	2021-05-18 12:29:27 UTC (rev 2113)
+++ pkg/R/dia.bactgensize.R	2021-05-18 12:53:14 UTC (rev 2114)
@@ -1,7 +1,7 @@
 dia.bactgensize <- function(
   fit = 2, p = 0.5, m1 = 2000, sd1 = 600, m2 = 4500, sd2 = 1000, p3 = 0.05,
   m3 = 9000, sd3 = 1000, maxgensize = 20000,
-  source = c("ftp://pbil.univ-lyon1.fr/pub/seqinr/data/goldtable15Dec07.txt",
+  source = c("https://pbil.univ-lyon1.fr/datasets/seqinr/data/goldtable15Dec07.txt",
     "http://www.genomesonline.org/DBs/goldtable.txt"))
 {
 #
@@ -11,7 +11,7 @@
 #
 # Build source of data string:
 #
-  if(source == "ftp://pbil.univ-lyon1.fr/pub/seqinr/data/goldtable15Dec07.txt"){
+  if(source == "https://pbil.univ-lyon1.fr/datasets/seqinr/data/goldtable15Dec07.txt"){
     sodtxt <- "Source of data: GOLD (Genomes OnLine Database) 15 Dec 2007"
   } else {
     sodtxt <- paste("Source of data: GOLD (Genomes OnLine Database)",date())
@@ -45,7 +45,7 @@
 
   if(fit == 0)
   {
-    hst <- hist(sizeKb, freq = TRUE, 
+    hst <- hist(sizeKb, freq = TRUE,
       breaks = mybreaks,
       main=paste("Genome size distribution for", n, "bacterial genomes"),
       xlab="Genome size [Kb]",
@@ -56,7 +56,7 @@
     lines(x=dst$x, y=vscale*dst$y)
     legend(x = max(sizeKb)/2, y = 0.75*max(hst$counts), lty=1,
       "Gaussian kernel density estimation")
-      
+
     mtext(sodtxt)
   }
 ##########################################
@@ -66,7 +66,7 @@
 ###########################################
   if(fit == 2)
   {
-    logvraineg <- function(param, obs) 
+    logvraineg <- function(param, obs)
     {
       p <- param[1]
       m1 <- param[2]
@@ -84,10 +84,10 @@
     y2 <- vscale*(1-estimate[1])*dnorm(x, estimate[4], estimate[5])
     dst <- density(sizeKb)
 
-    hst <- hist(sizeKb, plot = FALSE, breaks = mybreaks)    
+    hst <- hist(sizeKb, plot = FALSE, breaks = mybreaks)
     ymax <- max(y1, y2, hst$counts, vscale*dst$y)
-    
-    
+
+
     hist(sizeKb, freq = TRUE, ylim=c(0,ymax),
       breaks = mybreaks,
       main=paste("Genome size distribution for", n, "bacterial genomes"),
@@ -94,7 +94,7 @@
       xlab="Genome size [Kb]",
       ylab="Genome count",
       col="lightgrey")
-      
+
     lines(x, y1, col="red", lwd=2)
     lines(x, y2, col="blue", lwd=2)
 
@@ -101,21 +101,21 @@
     text(x = max(sizeKb)/2, y = ymax, pos=4, "Maximum likelihood estimates:")
 
     text(x = max(sizeKb)/2, y = 0.95*ymax, col="red", pos = 4, cex=1.2,
-    substitute(hat(p)[1] == e1~~hat(mu)[1] == e2~~hat(sigma)[1] == e3, 
-    list(e1 = round(estimate[1],3), 
+    substitute(hat(p)[1] == e1~~hat(mu)[1] == e2~~hat(sigma)[1] == e3,
+    list(e1 = round(estimate[1],3),
        e2 = round(estimate[2],1),
        e3 = round(estimate[3],1))))
 
     text(x = max(sizeKb)/2, y = 0.90*ymax, col="blue", pos = 4, cex=1.2,
-    substitute(hat(p)[2] == q~~hat(mu)[2] == e4~~hat(sigma)[2] == e5, 
-    list(q = round(1 - estimate[1],3), 
+    substitute(hat(p)[2] == q~~hat(mu)[2] == e4~~hat(sigma)[2] == e5,
+    list(q = round(1 - estimate[1],3),
        e4 = round(estimate[4],1),
        e5 = round(estimate[5],1))))
-       
+
     lines(x=dst$x, y=vscale*dst$y)
     legend(x = max(sizeKb)/2, y = 0.75*ymax, lty=1,
        "Gaussian kernel density estimation")
-       
+
     mtext(sodtxt)
   }
 ##########################################
@@ -125,7 +125,7 @@
 ###########################################
   if(fit == 3)
   {
-    logvraineg <- function(param, obs) 
+    logvraineg <- function(param, obs)
     {
       p <- param[1]
       m1 <- param[2]
@@ -148,7 +148,7 @@
     y2 <- vscale*(1-estimate[1]-estimate[6])*dnorm(x, estimate[4], estimate[5])
     y3 <- vscale*estimate[6]*dnorm(x, estimate[7], estimate[8])
 
-    hst <- hist(sizeKb, plot = FALSE, breaks = mybreaks)    
+    hst <- hist(sizeKb, plot = FALSE, breaks = mybreaks)
     ymax <- max(y1, y2, y3, hst$counts)
 
     hist(sizeKb, freq = TRUE, ylim=c(0,ymax),
@@ -157,36 +157,36 @@
       xlab="Genome size [Kb]",
       ylab="Genome count",
       col="lightgrey")
-          
+
     lines(x, y1, col="red", lwd=2)
     lines(x, y2, col="blue", lwd=2)
     lines(x, y3, col="green3", lwd=2)
-  
+
     text(x = max(sizeKb)/2, y = ymax, pos=4, "Maximum likelihood estimates:")
 
     text(x = max(sizeKb)/2, y = 0.95*ymax, col="red", pos = 4, cex=1.2,
-    substitute(hat(p)[1] == e1~~hat(mu)[1] == e2~~hat(sigma)[1] == e3, 
-    list(e1 = round(estimate[1],3), 
+    substitute(hat(p)[1] == e1~~hat(mu)[1] == e2~~hat(sigma)[1] == e3,
+    list(e1 = round(estimate[1],3),
        e2 = round(estimate[2],1),
        e3 = round(estimate[3],1))))
 
     text(x = max(sizeKb)/2, y = 0.90*ymax, col="blue", pos = 4, cex=1.2,
-    substitute(hat(p)[2] == q~~hat(mu)[2] == e4~~hat(sigma)[2] == e5, 
-    list(q = round(1 - estimate[1]-estimate[6],3), 
+    substitute(hat(p)[2] == q~~hat(mu)[2] == e4~~hat(sigma)[2] == e5,
+    list(q = round(1 - estimate[1]-estimate[6],3),
        e4 = round(estimate[4],1),
        e5 = round(estimate[5],1))))
-       
+
     text(x = max(sizeKb)/2, y = 0.85*ymax, col="green3", pos = 4, cex=1.2,
-    substitute(hat(p)[3] == p3~~hat(mu)[3] == e7~~hat(sigma)[3] == e8, 
-    list(p3 = round(estimate[6],3), 
+    substitute(hat(p)[3] == p3~~hat(mu)[3] == e7~~hat(sigma)[3] == e8,
+    list(p3 = round(estimate[6],3),
        e7 = round(estimate[7],1),
-       e8 = round(estimate[8],1))))     
-       
+       e8 = round(estimate[8],1))))
+
     dst <- density(sizeKb)
     lines(x=dst$x, y=vscale*dst$y)
     legend(x = max(sizeKb)/2, y = 0.75*ymax, lty=1,
        "Gaussian kernel density estimation")
-       
+
     mtext(sodtxt)
   }
 #
@@ -194,15 +194,3 @@
 #
   invisible(data)
 }
-
-
-
-
-
-
-
-
-
-
-
-



More information about the Seqinr-commits mailing list