-
Notifications
You must be signed in to change notification settings - Fork 666
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
Add top-level function from_PDB
for obtaining structure directly from PDB
#810
Comments
I would call the function |
Sure this won't confuse analysis algorithms that assume |
U. Filename is always the topology, which is read once and never used On Thu, 31 Mar 2016 10:24 kain88-de, [email protected] wrote:
|
Most of the time, if the analysis does not assume it receives a stream, it does something wrong. |
The old soon to be deprecated ContactAnalysis for example uses Not to mention all the custom analysis code users have build on top of MDAnalysis and that might be shared inside of a research group. I'm pretty sure that they implicitly assume that |
Given that we don't really universaly support streams everywhere (it's still a hack) I'd go with the unambiguous
If you decide to cache, I'd probably cache in the current directory and provide another kwarg to specify an alternative cache dir. (It would be cool if we could use streams interchangeably with files everywhere, although I am not sure if the benefits really balance the time to implement a good solution.) |
There's a compact alternative (that I'm not entirely sure I prefer), which is to overload the u = mda.Universe('4AKE', fetch=True) We can even make it more flexible, database-wise: u = mda.Universe('4AKE', fetch='PDB') And maybe allow further keywords to differentiate between fetching topology and trajectory. |
+1 vote for |
No that will just be more confusing. |
On 1 Apr, 2016, at 00:56, Hai Nguyen wrote:
I don't mind |
I don't want to add another kwarg to Universe, just because of complexity, On Fri, 1 Apr 2016 10:16 Oliver Beckstein, [email protected] wrote:
|
wouldn't we need to download it anyway to create the stream? So better would be |
@orbeckst does MDA have intention to add on memory Universe? pytraj has both on disk and on memory objects. The on-memory is good for interactive work (such like visualization). |
FYI, @tomnewport showed one way how to do the PDB downloading in his issue report for #839. |
FWIW, mmtf at #907 has this built into their API (according to website) and is arguably a better solution for downloading than bulky PDB files? |
Good idea, although users probably still want to have a PDB file locally, simply because many other tools won’t have MMTF support (yet). Does MMTF have a way to convert to a “native looking” PDB, i.e., one with all the metadata? Oliver Beckstein * [email protected] |
Simple code (from #839): import urllib
downloader = urllib.URLopener()
def fetch_pdb(pdb_id, download_url="http://files.rcsb.org/download"):
filename = "{0}.pdb".format(pdb_id.lower())
downloader.retrieve("/".join([download_url, filename]), filename)
return filename
# example use:
fetch_pdb("1osm") |
We should use the functionality provided by MMTF, see #907 (and PR #1069). import mmtf
m = mmtf.fetch('1ake') ... although this |
It would be nice to be able to get a Universe directly from the PDB without first writing the file to disk. This could be done using perhaps a
NamedStream
so that we could do:where
u.filename
just returns the web address theNamedStream
pulled from.The text was updated successfully, but these errors were encountered: