Skip to content

Commit

Permalink
Merge pull request #4 from maize-genetics/fix-demo-params
Browse files Browse the repository at this point in the history
Fix `DEMO` endpoint from returning incorrect data
  • Loading branch information
btmonier authored Mar 19, 2024
2 parents 698bd6e + 04f9e42 commit ce83136
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 11 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: rPHG
Version: 0.2.1
Version: 0.2.2
Date: 2019-06-03
Title: R front-end for the practical haplotype graph
Authors@R: c(
Expand Down Expand Up @@ -72,6 +72,6 @@ Encoding: UTF-8
LazyData: true
VignetteBuilder:
knitr
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
biocViews:
GenomeWideAssociation
5 changes: 5 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## CHANGES IN VERSION 0.2.2
* Fixed issue with `DEMO` method endpoint returning incorrect dimensional data
for specific Maize PHGv1 methods


## CHANGES IN VERSION 0.2.1
* Added new function, `plotDot()`
+ Creates dot plots from `.anchorspro` files
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## rPHG 0.2.2
* Fixed issue with `DEMO` method endpoint returning incorrect dimensional data
for specific Maize PHGv1 methods


## rPHG 0.2.1
* Added new function, `plotDot()`
+ Creates dot plots from `.anchorspro` files
Expand Down
2 changes: 1 addition & 1 deletion R/class_phg_method.R
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ setMethod(
if (conType == "local") {
phgDataSetFromLocal(conObj, conMethod, verbose)
} else if (conType == "server") {
phgDataSetFromServer(conObj, conMethod, verbose, conDemo)
phgDataSetFromServer(conObj, conMethod, conDemo, verbose)
}
}
)
Expand Down
2 changes: 1 addition & 1 deletion R/constants.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ BRAPI_PARAMS <- list(
"METHOD_RR_SIZE" = "dimensionCallSetPageSize=%i",
"METHOD_RR_PAGE" = "dimensionCallSetPage=%i",
"METHOD_SAMPLE_SIZE" = "dimensionVariantPageSize=%i",
"METHOD_SAMPLE_PAGE" = "dimensionVariantPagePage=%i"
"METHOD_SAMPLE_PAGE" = "dimensionVariantPage=%i"
)


Expand Down
9 changes: 5 additions & 4 deletions R/read_hap_ids.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ hapIdsFromSever <- function(conObj, conMethod, conDemo) {
)
)


message(verbInfo[2])
pb <- utils::txtProgressBar(
min = 0,
Expand All @@ -92,7 +93,7 @@ hapIdsFromSever <- function(conObj, conMethod, conDemo) {

message(verbInfo[3])
fullResp <- do.call(
what = "cbind",
what = "rbind",
args = lapply(
X = respVector,
FUN = function(x) {
Expand All @@ -101,10 +102,10 @@ hapIdsFromSever <- function(conObj, conMethod, conDemo) {
)
)

colnames(fullResp) <- paste0("R", seq_len(ncol(fullResp)))
rownames(fullResp) <- samplesFromServer(conObj, conMethod, conDemo)
rownames(fullResp) <- paste0("R", seq_len(nrow(fullResp)))
colnames(fullResp) <- samplesFromServer(conObj, conMethod, conDemo)

return(fullResp)
return(t(fullResp))
}


Expand Down
2 changes: 1 addition & 1 deletion R/read_ref_ranges.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ refRangesFromServer <- function(conObj, conMethod, conDemo) {
if (conDemo) {
BRAPI_PARAMS$DEMO_N_RR_TOTAL
} else {
BRAPI_PARAMS$MAX_N_RR_SIZE
BRAPI_PARAMS$MAX_N_RR_TOTAL
}
)
)
Expand Down
2 changes: 1 addition & 1 deletion R/utilities_api_brapi.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ amUrlContextStringBuilder <- function(
BRAPI_PARAMS$REST_KV_SEP,
BRAPI_PARAMS$METHOD_SAMPLE_PAGE
),
methodId, rrPageSize, samplePageSize, rrPage, samplePage
methodId, rrPageSize, samplePageSize, samplePage, rrPage
)

return(amContextString)
Expand Down
2 changes: 1 addition & 1 deletion vignettes/rphg_walkthrough.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ If you would like to use a PHG web service, we can use the following
similar method:

```{r, echo=TRUE, eval=TRUE}
"demo.hub.maizegenetics.net" |> PHGServerCon()
"phg.maizegdb.org" |> PHGServerCon()
```

Here, a URL pointing to a PHG web service is supplied to the
Expand Down

0 comments on commit ce83136

Please sign in to comment.