BigelowLab / edna-dada2

Maine eDNA dada2
0 stars 0 forks source link

Should I be afraid of .save and .save1? #7

Closed robinsleith closed 3 years ago

robinsleith commented 3 years ago

Was just going to commit the edits to the yaml and R script incorporating truncLen auto etc and encountered the following in the edna-dada2 directory:

rsleith@cfe1 edna-dada2 [master*]$ ls -lthr
total 76K
-rw-rw-r-- 1 rsleith edna 4.8K May  5 16:37 Configurations.md
-rw-rw-r-- 1 rsleith edna 1.7K May  5 16:37 README.md
-rw-rw-r-- 1 rsleith edna 8.7K May  5 16:57 dada2_18S.R
-rw-rw-r-- 1 rsleith edna  429 May  5 16:58 job_submission.sh
-rw-rw-r-- 1 rsleith edna 8.8K May  5 16:59 dada2_pacbio.R
-rw-rw-r-- 1 rsleith edna 1.8K May  5 16:59 dada2_pacbio18S.yaml
-rw-rw-r-- 1 rsleith edna 1.8K May  5 17:00 dada2_pacbio16S.yaml
-rw-rw-r-- 1 rsleith edna 8.7K May  5 17:02 dada2_16S.R
-rw-rw-r-- 1 rsleith edna 1.7K Jun 17 14:47 dada2_18S.yaml
-rw------- 1 rsleith edna    0 Jun 17 19:00 dada2_18S.R.save
-rw-rw-r-- 1 rsleith edna 8.7K Jun 17 19:00 dada2_18S.R.save.1
btupper commented 3 years ago

Hmmm - never seen that before. Let me investigate a bit.

robinsleith commented 3 years ago

Also FWIW dada2_18S.yaml in /mnt/storage/data/edna/packages/edna-dada2 does not match github, meaning changes were made but not committed? Still figuring all this part out.

btupper commented 3 years ago

There is no reference to a ".save" in the dadutils repos.

btupper@cfe1 dadautils [main*]$ git grep -Fn ".save"

It returns nothing, if found it would spit out one line per match. Same is true in edna-dada2

btupper@cfe1 edna-dada2 [master*]$ git grep -Fn ".save"

Which makes me wonder if it is either (a) a user has selected to save session or (b) it is output saved automatically by R when it aborts/crashes. Typically a true session save ends with .Rdata so I'm inclined to think it is (b). But that would mean that the user's working directory was /mnt/storage/data/edna/packages/edna-dada2 which would be weird.

I suggest that I move them to my home directory and then you continue with your work. If they are important we'll still have them. If not we can toss them later. Sound OK?

robinsleith commented 3 years ago

That works!

btupper commented 3 years ago

More...

> load("/mnt/storage/data/edna/packages/edna-dada2/dada2_18S.R.save.1")
Error in load("/mnt/storage/data/edna/packages/edna-dada2/dada2_18S.R.save.1") : 
  bad restore file magic number (file may be corrupted) -- no data loaded
In addition: Warning message:
file ‘dada2_18S.R.save.1’ has magic number 'libra'
  Use of save versions prior to 2 is deprecated 
> z = readRDS("/mnt/storage/data/edna/packages/edna-dada2/dada2_18S.R.save.1")
Error in readRDS("/mnt/storage/data/edna/packages/edna-dada2/dada2_18S.R.save.1") : 
  unknown input format

Ahhhhhaaaaa! It's a text dump of a script. Likely one of our editors did that for some weird reason.

> z = readLines("/mnt/storage/data/edna/packages/edna-dada2/dada2_18S.R.save.1") 
> cat(head(z, n = 10), sep = "\n")
library(dplyr)
library(readr)
library(configr)
library(futile.logger)
library(patchwork)

library(ShortRead)  
library(Biostrings)
library(dada2)

> cat(tail(z, n = 10), sep = "\n")
                               data_path = "data_path",
                               reference_path = "reference_path"),
                             rootname = "global")

if (!interactive()){
  ok <- main(CFG)
  quit(save = "no", status = ok)
}

Anyway - we can delete those.