Skip to content

Commit

Permalink
Release v3.3.3
Browse files Browse the repository at this point in the history
- Remove `@ksize` header from kernel alignment
- R code deal with legacy rubbish `@ksize` in kernel alignment
- Release v3.3.3
  • Loading branch information
lmrodriguezr committed Oct 22, 2018
1 parent aa79f07 commit 180d46b
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 28 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
48 changes: 26 additions & 22 deletions enveomics/nonpareil_sampling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,14 @@ sample_t nonpareil_sample_summary(double *&sample_result, int sample_number, cha

// File handlers
if(alldata && strlen(alldata)>0){
alldatah = fopen(alldata, (samplepar.portion==samplepar.portion_min ? "w" : "a+"));
alldatah = fopen(alldata,
(samplepar.portion==samplepar.portion_min ? "w" : "a+"));
if(alldatah==NULL) error("I cannot write on all-data file", alldata);
reportAllData=true;
}
if(strlen(outfile)>0 && strcmp(outfile, "-")!=0){
summaryh = fopen(outfile, (samplepar.portion==samplepar.portion_min ? "w" : "a+"));
summaryh = fopen(outfile,
(samplepar.portion==samplepar.portion_min ? "w" : "a+"));
if(summaryh==NULL) error("I cannot write on summary file", outfile);
reportSummary=1;
}else if(strlen(outfile)>0){
Expand All @@ -133,25 +135,25 @@ sample_t nonpareil_sample_summary(double *&sample_result, int sample_number, cha

if(samplepar.portion==samplepar.portion_min){
header = new char[LARGEST_LINE];
if(samplepar.type == 1) {
sprintf(header, "# @impl: Nonpareil\n# @ksize: %d\n# @version: %.2f\n# @maxL: %d\n# @L: %.3f\n# @R: %llu\n# @overlap: %.2f\n# @divide: %.2f\n",
samplepar.k,
samplepar.np_version,
samplepar.max_read_len,
samplepar.avg_read_len,
samplepar.total_reads,
samplepar.seq_overlap*100.0,
samplepar.divide);
}
else if(samplepar.type == 2) {
sprintf(header, "# @impl: Nonpareil\n# @ksize: %d\n# @version: %.2f\n# @L: %.3f\n# @AL: %.3f\n# @R: %llu\n# @overlap: %.2f\n# @divide: %.2f\n",
samplepar.k,
samplepar.np_version,
samplepar.avg_read_len,
samplepar.adj_avg_read_len,
samplepar.total_reads,
samplepar.seq_overlap*100.0,
samplepar.divide);
if(samplepar.type == 1) { // Kernel: Alignment
sprintf(header,
"# @impl: Nonpareil\n# @version: %.2f\n# @maxL: %d\n# @L: %.3f\n# @R: %llu\n# @overlap: %.2f\n# @divide: %.2f\n",
samplepar.np_version, // @version
samplepar.max_read_len, // @maxL
samplepar.avg_read_len, // @L
samplepar.total_reads, // @R
samplepar.seq_overlap*100.0, // @overlap
samplepar.divide); // @divide
}else if(samplepar.type == 2) { // Kernel: Kmer
sprintf(header,
"# @impl: Nonpareil\n# @ksize: %d\n# @version: %.2f\n# @L: %.3f\n# @AL: %.3f\n# @R: %llu\n# @overlap: %.2f\n# @divide: %.2f\n",
samplepar.k, // @ksize
samplepar.np_version, // @version
samplepar.avg_read_len, // @L
samplepar.adj_avg_read_len, // @AL
samplepar.total_reads, // @R
samplepar.seq_overlap*100.0, // @overlap
samplepar.divide); // @divide
}
}

Expand All @@ -162,7 +164,9 @@ sample_t nonpareil_sample_summary(double *&sample_result, int sample_number, cha
s.avg += (double)sample_result[a];
x2 += pow((double)sample_result[a], 2.0);
dataPoints.push_back(sample_result[a]);
if(reportAllData) fprintf(alldatah, "%.2f\t%d\t%.10f\n", samplepar.portion, a, sample_result[a]);
if(reportAllData)
fprintf(alldatah, "%.2f\t%d\t%.10f\n",
samplepar.portion, a, sample_result[a]);
}
fclose(alldatah);
s.avg /= (double)sample_number;
Expand Down
5 changes: 3 additions & 2 deletions nonpareil.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// nonpareil - Calculation of nonpareil curves
// @author Luis M. Rodriguez-R <lmrodriguezr at gmail dot com>
// @license artistic license 2.0
// @author Santosh Kumar G.
// @license Artistic-2.0

#include <math.h>
#include <getopt.h>
Expand All @@ -14,7 +15,7 @@
#include <string>

#define LARGEST_PATH 4096
#define NP_VERSION 3.301
#define NP_VERSION 3.303

using namespace std;
int processID;
Expand Down
2 changes: 1 addition & 1 deletion utils/Nonpareil/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: Nonpareil
Title: Metagenome Coverage Estimation and Projections for 'Nonpareil'
Type: Package
Version: 3.3.2
Version: 3.3.3
Authors@R: c(person("Luis M.","Rodriguez-R",role=c("aut","cre"),
email="[email protected]"))
Author: Luis M. Rodriguez-R [aut, cre]
Expand Down
9 changes: 6 additions & 3 deletions utils/Nonpareil/R/Nonpareil.R
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,12 @@ Nonpareil.read_metadata <- function(
x$log.sample <- 0

# Set metadata
if("ksize" %in% keys && vals[keys=="ksize"]>0) x$kernel <- "kmer";
if("divide" %in% keys) x$log.sample <- as.numeric(vals[keys=="divide"]);
if("logsampling" %in% keys) x$log.sample <- as.numeric(vals[keys=="logsampling"]);
if("ksize" %in% keys && vals[keys=="ksize"]>0 && vals[keys=="ksize"]<1001)
x$kernel <- "kmer";
if("divide" %in% keys)
x$log.sample <- as.numeric(vals[keys=="divide"]);
if("logsampling" %in% keys)
x$log.sample <- as.numeric(vals[keys=="logsampling"]);
x$version <- as.numeric(vals[keys=="version"])
x$L <- as.numeric(vals[keys=="L"])
x$R <- as.numeric(vals[keys=="R"])
Expand Down

0 comments on commit 180d46b

Please sign in to comment.