msysbio / bacterial_growth

a database and an interface for bacterial growth data
1 stars 3 forks source link

Lab files analysis .sh file #17

Open jcasadogp opened 1 year ago

jcasadogp commented 1 year ago

When I tried to populate the DB with the command:

python3 main.py populateDB --info_file ../../Desktop/local_thesis_files/yml_files/study_information.yml

The study_information.yml contained these directories for files:

value: /Users/julia/Desktop/local_thesis_files/BT_mucin_RNAseq_3.txt

I got the following error (which started a cascade or errors):

ls: /Users/julia/Desktop/local_thesis_files/BT_mucin_RNAseq_3.txt/: Not a directory

This was because I tried to populate a single file that was not contained in a directory. The code expects a directory, even if it only contains 1 file, for the moment.

jcasadogp commented 1 year ago

The problems come from the format that is asked:

First, it asks for technical replicate files which end with _n.txt, being n the number of technical replicate. It is also related with how paths and file names are formed in the code. In lines such as:

These lines do not work if, instead of a directory, a single file is passed: https://github.com/jcasadogp/bacterial_growth/blob/49c6309843c82d858494e0b2c66d5e1004c2653b/src/import_into_database/populate_db.py#L88-L89

From the previous lines we get the variable files_dir. Here, it passes files_diras an argument to the .sh file. It MUST be a directory; if not, the .sh will give errors. https://github.com/jcasadogp/bacterial_growth/blob/49c6309843c82d858494e0b2c66d5e1004c2653b/src/import_into_database/populate_db.py#L145-L146