Skip to content

Commit

Permalink
Upload v1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre Holzer committed Apr 12, 2023
1 parent 2749d90 commit 2bb0715
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/Metapolish_main-anaylsis-script.R
Original file line number Diff line number Diff line change
Expand Up @@ -538,10 +538,10 @@ message(str_c("\nINFO: Compound names were partically translated to potential me
# automatic processing
# ATTENTION: This step can take a while ......

if (length(df.names$Name) > 399) {
if (length(df.names$Name) > 99) {

query_results <- data.frame()
separations <-ceiling(length(df.names$Name)/400)
separations <-ceiling(length(df.names$Name)/100)

for (i in 1:separations) {
# create name vector and format type
Expand All @@ -558,7 +558,8 @@ if (length(df.names$Name) > 399) {
# Parse the response into a table
query_results_text <- content(query_results_html, "text", encoding = "UTF-8")
query_results_json <- RJSONIO::fromJSON(query_results_text, flatten = TRUE)
# replae NULL values with NA

# replace NULL values with NA
Query <- unlist(nullToNA(query_results_json[[1]]))
Match <- unlist(nullToNA(query_results_json[[2]]))
HMDB <- unlist(nullToNA(query_results_json[[3]]))
Expand All @@ -574,7 +575,6 @@ if (length(df.names$Name) > 399) {
rename(Metabolite=Match)
query_results <- rbind(query_results, query_results_i)
}

} else {
# create name vector and format type
name.vec <- paste(df.names$Name, collapse = ';')
Expand Down

0 comments on commit 2bb0715

Please sign in to comment.