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

Strain order not updating as expected #204

Open
anwarMZ opened this issue May 7, 2024 · 8 comments
Open

Strain order not updating as expected #204

anwarMZ opened this issue May 7, 2024 · 8 comments

Comments

@anwarMZ
Copy link
Member

anwarMZ commented May 7, 2024

For a time-series-based production instance, default_reference_strain_order.json doesn't work well.
I wrote a script to order the files based on the latest to earliest in terms of time. However, the order is not reflected on the instance even if the image is rebuilt and the container is restarted.

The contents of the default_reference_strain_order.json file for time-series data are as follows -

[
  "2024-04-09_2024-04-15",
  "2024-04-02_2024-04-08",
  "2024-03-26_2024-04-01",
  "2024-03-19_2024-03-25",
  "2024-03-12_2024-03-18",
  "2024-03-05_2024-03-11",
  "2024-02-27_2024-03-04",
  "2024-02-20_2024-02-26",
  "2024-02-13_2024-02-19",
  "2024-02-06_2024-02-12",
  "2024-01-30_2024-02-05"
] 

the current view of the instance is here

@ivansg44
Copy link
Collaborator

ivansg44 commented May 7, 2024

Seems to be in reverse order

@anwarMZ
Copy link
Member Author

anwarMZ commented May 7, 2024

I am setting up the wastewater instance as I type. Maybe that will further clarify.

@ivansg44
Copy link
Collaborator

ivansg44 commented May 7, 2024

The reverse order also happens to be the ASCII order. This means the GVF sample names extracted from the header are not being matched to the key in strain_order_dict, in data_parser.py.

@anwarMZ
Copy link
Member Author

anwarMZ commented May 7, 2024

I tried this same on the wastewater instance and it looks like the order was again not parsed well.

cat default_reference_strain_order.json

[
  "sample_1_T1",
  "sample_2_T1",
  "sample_3_T1",
  "sample_4_T1",
  "sample_5_T1",
  "sample_6_T1",
  "sample_7_T1",
  "sample_8_T1",
  "sample_9_T1",
  "sample_10_T1",
  "sample_11_T1",
  "sample_12_T1",
  "sample_13_T1",
  "sample_14_T1",
  "sample_15_T1",
  "sample_16_T1",
  "sample_17_T1",
  "sample_18_T1",
  "sample_19_T1",
  "sample_20_T1"
]

the current view of the instance is here

@ivansg44
Copy link
Collaborator

ivansg44 commented May 7, 2024

It is again in ASCII order

@ivansg44
Copy link
Collaborator

ivansg44 commented May 8, 2024

Seems to be working fine now. Did you clear the cache directory before rebuilding?

@ivansg44
Copy link
Collaborator

ivansg44 commented May 8, 2024

It seems the strain order does not update unless you clear the cache directory AND restart the application. But we want it to change whenever the strain order file is modified. The hidden strains file is probably affected similarly. Also, this is likely not related to the docker configuration. It happens if you start the program locally too.

@ivansg44 ivansg44 changed the title Default order doesnt work for groups other than lineages Strain order not updating as expected May 8, 2024
@ivansg44
Copy link
Collaborator

ivansg44 commented May 8, 2024

I actually think we shouldn't change anything for local development, and just remember after updating the strain order/hidden strains files to 1) clear the cache directory, and 2) restart the application without generating new cache. I think that's sufficient because shouldn't expect users to muck around with the underlying asset files, which would duplicate the issue for them. For docker deployment purposes, implementing #202 should prevent the issue from happening again in the future anyways. We will not include the local cache directory when building the docker image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants