Skip to content

Commit

Permalink
started harmo NCBI backbone
Browse files Browse the repository at this point in the history
  • Loading branch information
gaelso committed Jul 26, 2024
1 parent 24fda7c commit c8950c4
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ data/
results/
*-bkp/
tmp/

inst/data/

## Default R gitignore ---
# History files
Expand Down
18 changes: 18 additions & 0 deletions R/fct_dl_backbones.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@



## TEST
path_bb <- "inst/data/backbones"

# Read lines from NCBI data

ncbi_url <- "https://ftp.ncbi.nih.gov/pub/taxonomy/taxdump_archive/"

ncbi_version <- readLines(ncbi_url) |> stringr::str_extract('new\\_taxdump\\_2024\\-.[0-9]\\-.[0-9]') |> max(na.rm = T)

dl_ncbi <- download.file(
url = paste0(ncbi_url, ncbi_version, ".zip"),
destfile = file.path(path_bb, paste0("NCBI-", ncbi_version, ".zip"))
)

unzip(zipfile = file.path(path_bb, paste0("NCBI-", ncbi_version, ".zip")), exdir = path_bb)
76 changes: 54 additions & 22 deletions R/mod_info_UI.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,16 @@ mod_info_UI <- function(id){
ns <- NS(id)

##
## UI Elements ###############################################################
## UI Content ################################################################
##

## 4 cards
## left width 4 and right width 8
## right split top and bottom
## right top split left 1/2 right 1/2


## Left - Welcome -------------------------------------------------------------------
card_left <- card(
h1("Welcome"),

Expand All @@ -24,14 +31,14 @@ mod_info_UI <- function(id){
),

p(
"you are using the package ", tags$code("speval"), "version: ",
"You are using the package ", tags$code("speval"), "version:",
textOutput(outputId = ns("speval_version"), inline = TRUE), "."
),

h4("What is ", tags$code("arena-helpers")),
p(
"This app is part of of a collection of tools designed to support Forest inventory related
activities and grouped under ", tags$code("arena-helpers")
activities and grouped under ", tags$code("arena-helpers"), "."
),
br(),
h4("Open Foris Arena ", tags$img(src="www/Arena-Logo.png", height = '30px')),
Expand All @@ -45,46 +52,71 @@ mod_info_UI <- function(id){
.noWS = "before-end"
),
" in particular support data analysis parts that cannot be embedded directly
to OF Arena "
to OF Arena."
)
)


## Emission factors ----------------------------------------------------------
card_right_sub1 <- card(
p("Placeholder for content sub1"),
## right top 1 - Instructions ------------------------------------------------
card_right_top1 <- card(
h5("Instructions"),
tags$ol(
tags$li('In the ', tags$b('Run Validation'), ' tab, upload a list of species name as a CSV file.'),
tags$li('The species names will be displayed and validation settings appear.'),
tags$li('Select the taxonomic backbones and the fuzzy matching functions.'),
tags$li('Select multicore to run the processes in parrallel (only useful if more than a few hundred names to validate).'),
tags$li('Select IUCN and follow instructions to add IUCN endangered species list to the analysis.')
),
)
# It can be a one column file with header: "scientific_name"

## right top 2 - Results -----------------------------------------------------
card_right_top2 <- card(
h5("Results"),
p("The app outputs a detailed table where the results of each backbone are given for each
species name with the fuzzy distance of the closest name found in the backbone, the
proposed accepted name and status of the input species if not an accepted name already."),
p("The apps also provides a table where a unique validated name is proposed for each input
species name. The selection process arbitrarily favors the Leipzig Catalogue of Vascular
Plants but should be crossed-checked carefully, especially if the proposed solution as a
low fuzzy score."),
p("Finally, the app provides a series of statistics on the valdiation process: number of
accepted names found, number of conflicts between taxonomic backbones, etc."
)
)

card_right_sub2 <- card(
p("placeholder for content sub2")
## Right bottom - Under the hood ---------------------------------------------
card_right_bot <- card(
h5("Under the hood"),
p("placeholder for more content")
)

## right top combine ---------------------------------------------------------
card_right_top <- card(
card_header(bsicons::bs_icon("1-circle-fill", size = "1.5rem", class = "text-primary"), "Card right top"),
card_header(
h4(bsicons::bs_icon("1-circle-fill", size = "1.5rem", class = "text-primary"), "How to use the app")
),
layout_column_wrap(
width = 1/2,
card_right_sub1,
card_right_sub2
card_right_top1,
card_right_top2
)
)

card_right_bot <- card(
p("placeholder for more content")
)

card_right <- card(
card_right_top,
card_right_bot
)

##
## UI elements order wrapped in a tagList() function #########################
##

## UI elements wrapped in a tagList() function
tagList(

layout_columns(
col_widths = c(4, 8),
card_left,
card_right
card(
card_right_top,
card_right_bot
)
)

) ## END tagList
Expand Down
Binary file modified inst/app/.DS_Store
Binary file not shown.

0 comments on commit c8950c4

Please sign in to comment.