lizzieinvancouver / egret

1 stars 0 forks source link

Decisions for photoperiod #42

Open wangxm-forest opened 1 month ago

wangxm-forest commented 1 month ago

I've looked into the egret dataset to look for any indication of light/dark treatment during germination. I found other.treatment column and photoperiod column contain this information. There are 17325 rows out of 30202 rows containing some light/dark information. Since I excluded the 0 and NA values from the photoperiod column, we probably could convert everything in the photoperiod column into 'light'.

wangxm-forest commented 1 month ago

There are 326 unique datasetIDstudy out of 542, and 248 unique species out of 333 containing light/dark data.

lizzieinvancouver commented 1 month ago

@wangxm-forest please push code to repo and reply here with here it is ... then you or I or @dbuona should put it in the code where we do some cleaning we want for analyses that is outside the basic cleaning. @dbuona where is that file? Thanks!

dbuona commented 1 month ago

I started a cleaning file (drop_extratreats.R) for post- cleaning analysis prep in the analyses/seedcues folder

wangxm-forest commented 1 month ago

@lizzieinvancouver I pushed the code for making an extra column named "lightDark". It is saved in analyses/photoperiod. Please let me know if you want me to move this code somewhere else.

lizzieinvancouver commented 1 month ago

@wangxm-forest Nice! Given how common this is, I think we should add it to the main cleaning file. Can you make it so it runs from cleanall.R (in analyses/cleaning) -- likely just before cleancoordinates.R -- and move and rename it to analyses/cleaning/source/cleanphotoperiod.R ? Thank you!

wangxm-forest commented 1 month ago

@lizzieinvancouver Done! Do you want me to close this issue?

lizzieinvancouver commented 1 month ago

@wangxm-forest I think we should get back into the habit of ALL cleaning code being checked by someone else before we close it, so I will do that, but just now cleanall.R is not great so remind me to do this once it's better.

lizzieinvancouver commented 1 month ago

@wangxm-forest Can we also do some basic cleaning in this file please? Here is some cleaning code I find around the cleaning/ folder that perhaps we should clean (or NOT) ... I am not sure, but worth checking. Thank you!

unique(egret$photoperiod)
# TO CHECK
#0.3444444444444445
# 0 a true zero? ie 100% dark?
# 0.25

unique(egret$photoperiod)
# TO CHECK
# 0.25 - I couldn't find studies with "0.25" - JS

#0.3444444444445
photo0.34 <- egret[which(egret$photoperiod == "0.3444444444444445"),]
#borghetti86 photoperiod was 8/16 (8 hours light, 16 dark) - JS
egret$photoperiod[which(egret$photoperiod == "0.3444444444444445")] <- "8/16"
lizzieinvancouver commented 1 month ago

@wangxm-forest

In looking at:


sort(unique(d$other.treatment))
lux_rows <- grep("lux", d$other.treatment, ignore.case = TRUE)
mol_rows <- grep("μmol/m^2/s light", d$other.treatment, ignore.case = TRUE)
lightintense_rows <- grep("light intensity", d$other.treatment, ignore.case = TRUE)
whitelight_rows <- grep("white light", d$other.treatment, ignore.case = TRUE)

I was able to add 46 rows of data ... not much, but this was only on quick glance. Can you check the other.treatment column a bit more to make sure you think you pulled all light treatments?

wangxm-forest commented 1 month ago

@lizzieinvancouver I believe that running this line of code: selected_rows <- grep("light|dark|lux|photoperiod", d$other.treatment, ignore.case = TRUE) will select all cells containing either of the words "light" or "dark" in the other.treatment column. This means that phrases like "μmol/m^2/s light", "light intensity", "white light" should all be included in selected_rows.

I took a second look at the other.treatment column and added "lux", "photoperiod" in the grep().

lizzieinvancouver commented 1 month ago

@DeirdreLoughnan I saw you referenced stuff related to this issue elsewhere, can you add it here too?

lizzieinvancouver commented 1 week ago

@DeirdreLoughnan I know you referenced that the photoperiod code is broken currently, but in another issue. Can you link to that issue here?

DeirdreLoughnan commented 1 week ago

@DeirdreLoughnan I know you referenced that the photoperiod code is broken currently, but in another issue. Can you link to that issue here?

@lizzieinvancouver @wangxm-forest yes, the problem is referenced in both #27 and #58