Load sources
- Do not forget to use correct name for views…
source("init.R")
source("functions_map.R")
Cultures
cultures <- rio::import(cultures_file_name)
# filter(!is.na(asv_code)) %>%
# group_by(asv_code, sequence_matching) %>%
# # Count the number of cells corresponding to same asv and same species
# summarize(n_cells = n()) %>%
# # Keep for each asv the species occuring most often (if ties, take line randomly)
# dplyr::slice_max(n_cells, n=1, with_ties=FALSE) %>%
# ungroup()
# fasta_cells <- inner_join(cells, fasta, by = c("asv_code" = "seq_name"))
df_map <- inner_join(cultures, df, by = c("asv_code"="asv_code"))
# Group by single cell adn get info about the first asv
df_map <- df_map %>%
mutate(label = str_c(species_Luka,he492_asv_matching,culture_matching, sep = " - ")) %>%
group_by(file_code, label) %>%
summarise(n_reads_label = sum(n_reads)) %>%
ungroup()
df_map <- inner_join(samples_with_taxa, df_map) %>%
mutate(n_reads_label_pct = n_reads_label/n_reads_taxa*100) %>%
filter(!is.na(latitude))
samples <- samples %>%
filter(!is.na(latitude))
# Plot the maps -----------------------------------------------------------
map_metapr2 (df_map, samples)
species, ASV, culture: Arcocellulus_cornucervis - ASV_24 - HE492-43
species, ASV, culture: Attheya_longicornis - ASV_570 - HE492-59
species, ASV, culture: Chaetoceros_contortus - ASV_1089 - HE492-06
species, ASV, culture: Chaetoceros_convolutus - ASV_109 - HE492-64
species, ASV, culture: Chaetoceros_debilis - ASV_162 - HE492-19
species, ASV, culture: Chaetoceros_diadema - ASV_786 - HE492-12
species, ASV, culture: Chaetoceros_neogracilis - ASV_121 - HE492-73
species, ASV, culture: Chaetoceros_sp. - ASV_1173 - HE492-36
species, ASV, culture: Chaetoceros_sp. - ASV_1516 - HE492-03
species, ASV, culture: Corethron_sp. - ASV_282 - HE492-01
species, ASV, culture: Cylindrotheca_closterium - ASV_766 - HE492-63
species, ASV, culture: Cymatosiraceae - ASV_46 - HE492-46
species, ASV, culture: Fragilariopsis sp. - ASV_186 - HE492-50
species, ASV, culture: Pseudo-nitzschia_granii - ASV_54 - HE492-40
species, ASV, culture: Pseudo-nitzschia_turgidula - ASV_179 - HE492-47
species, ASV, culture: Shionodiscus_bioculatus - ASV_110 - HE492-10
species, ASV, culture: Skeletonema_marinoi - ASV_40 - HE492-39
species, ASV, culture: Thalassiosira sp. - ASV_117 - HE492-45
species, ASV, culture: Thalassiosira_gravida - ASV_243 - HE492-07
species, ASV, culture: Thalassiosira_oceanica - ASV_187 - HE492-54
Metabarcodes HE792
metab <- rio::import(metabarcodes_file_name)
# filter(!is.na(asv_code)) %>%
# group_by(asv_code, sequence_matching) %>%
# # Count the number of cells corresponding to same asv and same species
# summarize(n_cells = n()) %>%
# # Keep for each asv the species occuring most often (if ties, take line randomly)
# dplyr::slice_max(n_cells, n=1, with_ties=FALSE) %>%
# ungroup()
# fasta_cells <- inner_join(cells, fasta, by = c("asv_code" = "seq_name"))
df_map <- inner_join(metab, df, by = c("asv_code"="asv_code"))
# Group by single cell adn get info about the first asv
df_map <- df_map %>%
mutate(label = str_c(species_Luka,he492_asv_matching, sep = " - ")) %>%
group_by(file_code, label) %>%
summarise(n_reads_label = sum(n_reads)) %>%
ungroup()
df_map <- inner_join(samples_with_taxa, df_map) %>%
mutate(n_reads_label_pct = n_reads_label/n_reads_taxa*100) %>%
filter(!is.na(latitude))
samples <- samples %>%
filter(!is.na(latitude))
# Plot the maps -----------------------------------------------------------
map_metapr2 (df_map, samples)
species, ASV, culture: Actinocyclus_sp. - ASV_123
species, ASV, culture: Chaetoceros borealis - ASV_270
species, ASV, culture: Chaetoceros sp. - ASV_296
species, ASV, culture: Chaetoceros_brevis - ASV_245
species, ASV, culture: Chaetoceros_convolutus - ASV_160
species, ASV, culture: Chaetoceros_sp. - ASV_227
species, ASV, culture: Chaetoceros_wighamii - ASV_168
species, ASV, culture: Eucampia_groenlandica - ASV_49
species, ASV, culture: Fragilariopsis_cylindrus - ASV_361
species, ASV, culture: Fragilariopsis_sp. - ASV_127
species, ASV, culture: Leptocylindrus_minimus - ASV_159
species, ASV, culture: Leptocylindrus_minimus - ASV_28
species, ASV, culture: Leptocylindrus_minimus - ASV_395
species, ASV, culture: Leptocylindrus_minimus - ASV_45
species, ASV, culture: Leptocylindrus_minimus - ASV_8
species, ASV, culture: Leptocylindrus_sp. - ASV_183
species, ASV, culture: Proboscia_alata - ASV_365
species, ASV, culture: Proboscia_sp. - ASV_362
species, ASV, culture: Raphid-pennate_X_sp. - ASV_202
species, ASV, culture: Rhizosolenia sp. - ASV_260
species, ASV, culture: Skeletonema_sp. - ASV_58
species, ASV, culture: Skeletonema_sp. - ASV_99
species, ASV, culture: Thalassiosira_concaviuscula - ASV_79
species, ASV, culture: Thalassiosira_hispida - ASV_70
species, ASV, culture: Thalassiosira_sp. - ASV_266