Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Occurrences from new zenodo cube all over the place #44

Closed
SanderDevisscher opened this issue Dec 20, 2023 · 8 comments
Closed

Occurrences from new zenodo cube all over the place #44

SanderDevisscher opened this issue Dec 20, 2023 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@SanderDevisscher
Copy link

Observations of Lithobates catesbeianus for the year 2018:

vs

When I look at be_alientaxa_cube.csv from zenodo it looks like the number of infected gridcells for Lithobates catesbeianus seems to be inflated compared to the previous version.

df <- read_csv(
  file = "https://zenodo.org/records/10058400/files/be_alientaxa_cube.csv?download=1",
  col_types = cols(
    year = col_double(),
    eea_cell_code = col_character(),
    taxonKey = col_double(),
    n = col_double(),
    min_coord_uncertainty = col_double()
  ),
  na = ""
)

test <- df %>% filter(taxonKey == 2427091)

df <- read_csv(
  file = "https://zenodo.org/records/5819028/files/be_alientaxa_cube.csv?download=1",
  col_types = cols(
    year = col_double(),
    eea_cell_code = col_character(),
    taxonKey = col_double(),
    n = col_double(),
    min_coord_uncertainty = col_double()
  ),
  na = ""
)

test <- df %>% filter(taxonKey == 2427091)

PS not certain this issue belongs here!

@SanderDevisscher SanderDevisscher added the bug Something isn't working label Dec 20, 2023
@SanderDevisscher
Copy link
Author

Probably this issue is not limited to only Lithobates catesbeianus

@qgroom
Copy link
Contributor

qgroom commented Dec 24, 2023

Something wrong has happened!
I think is should be posted here https://github.com/trias-project/occ-cube-alien

I think this is a good example of why the cube should have a link back in each row to the occurrence ID that was actually used. The current lack of provenance makes debugging such errors much more difficult.

@damianooldoni
Copy link
Contributor

@SanderDevisscher: thanks for reporting this. Sorry for not having time to check this properly. I will try to find time this week. Probably wednesday I will. My first thought: the random assignment algorithm used for generating cube can modify the number of cells occupied if the occs have a high coordinate uncertainty.
I will also try to move the issue as suggested by @qgroom.

@damianooldoni
Copy link
Contributor

I have only now seen the screenshots. Sorry!
Actually it seems very strange, indeed. I will check it on Wednesday for sure!

@SanderDevisscher
Copy link
Author

I would move the issue but i cannot 😞

@damianooldoni damianooldoni transferred this issue from trias-project/indicators Jan 8, 2024
@damianooldoni
Copy link
Contributor

damianooldoni commented Jan 10, 2024

Yes, @SanderDevisscher. I can reproduce the unexpected behavior you encounter. It's a random assignment issue probably as it happens also for years with one occurrence only.

Notice that the problem is limited to the Belgian cube in occ-cube-alien (linked to the zenodo version you mention) and the Belgian cube produced in occ-cube repo and linked to https://zenodo.org/records/10074895 which actually starts from the same interim sqlite database.

In other words, no issues with cubes at species level of other countries and the cube of modelling species at European level contained in the same zenodo package of the Belgian one. In other words, the code is correct. I remember I had some problems while performing the 3_assign_grid.R pipeline (laptop stopped) and instead of starting from scratch again I tried to fix them in the sqlite database directly to save time. I am sorry for this. I will make the BE cube again from scratch and update the zenodo repository afterwards. No change in code should be required.

@damianooldoni
Copy link
Contributor

@SanderDevisscher: issue closed automatically. I have checked myself before pushing to main and publishing a new version on zenodo (see 20240118 version), but I would like you double check it. Thanks.

@SanderDevisscher
Copy link
Author

@SanderDevisscher: issue closed automatically. I have checked myself before pushing to main and publishing a new version on zenodo (see 20240118 version), but I would like you double check it. Thanks.

I will

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

3 participants