Closed bienchen closed 2 years ago
Well, what if when you deposit the file you do put it in the A
subdirectory? python-modelcif has no way to know either way - it would be surprising to the user if it just ignored the path provided (as usually this is intended to be part of the URL). One option for CifFile
subclasses would be to allow providing a different path for the local file (and default to the same as the URL path).
We have a more complicated solution for python-ihm, the Repository class, but that's probably overkill here since we generally don't have a lot of these associated files.
I agree, an additional path parameter sounds the easiest way. Then the URL can be the final location and the path would just be used for writing the file.
The
path
used inmodelcif.associated.LocalPairwiseQAScoresFile
should be relative to the one used inmodelcif.dumper.write()
, I think.Imagine I have a directory
A
with my models. Then I read the data needed for the ModelCIF file fromA
and I also want to write the file toA/model1.cif
,A/model2.cif
,...
. If I create associated files for the local pairwise scores, I would like to write them toA
, also. That meansmodelcif.associated.LocalPairwiseQAScoresFile("A/model1_local_pae.cif", ...)
which stores the associated file in the right directory, but gives me
_ma_entry_associated_files.file_url A/model1_local_pae.cif
while I think that should be
_ma_entry_associated_files.file_url model1_local_pae.cif
without pointing to a subdirectory
A/A
.Of course I can achieve this by
cd
ing intoA
before writing but that is inconvenient.Or do I oversea an easy way to get this?