Clinical-Genomics / scout

VCF visualization interface
https://clinical-genomics.github.io/scout
BSD 3-Clause "New" or "Revised" License
147 stars 43 forks source link

CLI option to remove an institute #4665

Open Jakob37 opened 3 weeks ago

Jakob37 commented 3 weeks ago

We needed to remove an institute, and found no Scout command-line way to do it. This led to some issues where we at first didn't manage to properly remove all the references from the mongo db.

It would make sense to be able to remove an institute as such:

scout delete institute

It seems to not be available at the moment:

$ scout delete --help
Usage: scout delete [OPTIONS] COMMAND [ARGS]...

  Delete objects from the database.

Options:
  --help  Show this message and exit.

Commands:
  case      Delete a case
  exons     Delete exons
  genes     Delete genes
  index     Delete all indexes
  panel     Delete a gene panel
  user      Delete a user
  variants  Delete variants for one or more cases
northwestwitch commented 3 weeks ago

I think that's because to be able to remove the institute you need to first remove all its cases with relative variants. We could add the option I guess, but we have to be sure what pages this can affect. For instance, should we remove also all the events related to that institute? And what about the causative variants? Do we want to remove them all without leaving any trace of them? 🤔

Jakob37 commented 3 weeks ago

I think that's because to be able to remove the institute you need to first remove all its cases with relative variants. We could add the option I guess, but we have to be sure what pages this can affect. For instance, should we remove also all the events related to that institute? And what about the causative variants? Do we want to remove them all without leaving any trace of them? 🤔

OK, yes, I was suspecting there were many layers to this .. In this case, I suspect they had added a testing institute which they then wanted gone. Not sure how they dealt with these details.

I guess if you do a small testing institute you would want to be able to remove it without any trace.

But maybe that is a too powerful operation to give access to. If accidentally removing a "real" institute it would be no good ..

It is not a pressing need for us, just something which occured to me to be missing. If tricky, we could just leave it aside.

dnil commented 3 weeks ago

It is advisable to keep testing and validation in a separate environment from production. That said, the option is certainly missing from the interface.

While you certainly have a point, I don't think you need to worry about too powerful (we have e.g. scout wipe), but it would be somewhat complex deciding how to treat all mentions of a removed institute, making sure they lead to meaningful warnings not hard exceptions.

Jakob37 commented 3 weeks ago

It is advisable to keep testing and validation in a separate environment from production.

Yes, of course, not sure about the history of the setup here though.

While you certainly have a point, I don't think you need to worry about too powerful (we have e.g. scout wipe), but it would be somewhat complex deciding how to treat all mentions of a removed institute, making sure they lead to meaningful warnings not hard exceptions.

No, I agree with you. It makes sense to have an official delete institute functionality.