Roleren / ORFik

MIT License
32 stars 9 forks source link

Unable to set Custom Configuration #167

Closed SuhasSrinivasan closed 4 months ago

SuhasSrinivasan commented 5 months ago

Hi,

I noticed this issue since the first time of trying the vignette, but as there were important issues, waited to bring this to your attention.

Issue 1

Following this particular step

There was difficulty to set custom configuration, and it always defaults to ~/Bio_data/

parent_folder = '~/hyerim/riboseq'
config_csv = file.path(parent_folder, 'orfik_config.csv')
fastq_dir = file.path(parent_folder, 'fastq')
bam_dir = file.path(parent_folder, 'bam')
reference_dir = file.path(parent_folder, 'reference')

config.save(config_csv, fastq_dir, bam_dir, reference_dir)

config()

--------------------------------
Setting up config file for ORFik
Saving to:  ~/Bio_data/ORFik_config.csv
                          fastq                             bam                             ref                             exp 
          "~/Bio_data/raw_data"     "~/Bio_data/processed_data"         "~/Bio_data/references" "~/Bio_data/ORFik_experiments/" 

Seems like config() expects a path argument, after supplying that:

config(config_csv)
                          fastq                             bam                             ref                             exp 
       "~/hyerim/riboseq/fastq"          "~/hyerim/riboseq/bam"    "~/hyerim/riboseq/reference" "~/Bio_data/ORFik_experiments/" 

But now it is observed that exp is predefined in config.save()

function (file = "~/Bio_data/ORFik_config.csv", fastq.dir, bam.dir, 
  reference.dir, exp.dir = "~/Bio_data/ORFik_experiments/") 
{
  conf <- data.frame(type = c("fastq", "bam", "ref", "exp"), 
    directory = c(fastq.dir, bam.dir, reference.dir, exp.dir))
  data.table::fwrite(conf, file, col.names = TRUE)
  return(invisible(NULL))
}

Issue 2

config.exper() seems to use the same default path ~/Bio_data/

Load config and verify the information.

config(config_csv)
                          fastq                             bam                             ref                             exp 
       "~/hyerim/riboseq/fastq"          "~/hyerim/riboseq/bam"    "~/hyerim/riboseq/reference" "~/Bio_data/ORFik_experiments/" 

config = config(config_csv)

config["fastq"]
                   fastq 
"~/hyerim/riboseq/fastq" 

Define the experiment, but it is again going back to ~/Bio_data/

config.exper(experiment = 'chx', assembly = 'hs_assembly', type = c('Ribo-seq'))
                           fastq Ribo-seq                              bam Ribo-seq                                       ref 
      "~/Bio_data/raw_data/Ribo-seq/chx/" "~/Bio_data/processed_data/Ribo-seq/chx/"      "~/Bio_data/references/hs_assembly/" 
                             exp Ribo-seq 
                           "chx_Ribo-seq" 
Roleren commented 5 months ago

Could you install newest orfik from GitHub and try again ?

Roleren commented 5 months ago

remotes::install_github("Roleren/ORFik") # Then restart R

SuhasSrinivasan commented 4 months ago

Thank you for reviewing the issue.

I uninstalled the Bioconductor version and installed from GitHub. The version number appears to be the same 1.23.10.

The GitHub version still has the issue.

> config = config(config_csv)
> config
                          fastq                             bam                             ref                             exp 
       "~/hyerim/riboseq/fastq"          "~/hyerim/riboseq/bam"    "~/hyerim/riboseq/reference" "~/Bio_data/ORFik_experiments/" 

> config_inf = config.exper(experiment = 'chx', 
+                         assembly = 'hs_assembly',
+                         type = c('Ribo-seq'))
/home/user1/.cache/R/BiocFileCache
  does not exist, create directory? (yes/no): yes
--------------------------------
Setting up config file for ORFik
This config defines where to save:
            fastq, bam files, references and experiments
Saving to:  /home/user1/.cache/R/BiocFileCache/fa8a388fb8_fa8a388fb8.csv
ORFik now uses BiocFileCache for config, moving your old config

> config_inf
                           fastq Ribo-seq                              bam Ribo-seq                                       ref 
      "~/Bio_data/raw_data/Ribo-seq/chx/" "~/Bio_data/processed_data/Ribo-seq/chx/"      "~/Bio_data/references/hs_assembly/" 
                             exp Ribo-seq 
                           "chx_Ribo-seq" 
Roleren commented 4 months ago

Hm, will take a look at this

Roleren commented 4 months ago

Hm, can you restart R and try again, I do not get this on my end:

# -> directories are correct      
> config()
                                        fastq                                           bam                                           ref 
      "/media/roler/S/data/Bio_data/raw_data" "/media/roler/S/data/Bio_data/processed_data"     "/media/roler/S/data/Bio_data/references" 
                                          exp 
              "~/Bio_data/ORFik_experiments/" 

> config.exper(experiment = 'chx', assembly = 'hs_assembly',type = c('Ribo-seq'))
                                             fastq Ribo-seq                                                bam Ribo-seq 
      "/media/roler/S/data/Bio_data/raw_data/Ribo-seq/chx/" "/media/roler/S/data/Bio_data/processed_data/Ribo-seq/chx/" 
                                                        ref                                                exp Ribo-seq 
     "/media/roler/S/data/Bio_data/references/hs_assembly/"   
Roleren commented 4 months ago

Related to #170 so now resolved