-
Notifications
You must be signed in to change notification settings - Fork 667
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
Write compressed ascii outputs #2216
Comments
Hello, I am new to this organization. I would like to contribute to the project "Making Cython Ascii Parsers" for GSOC 2019. I am looking for a starter issue to familiarize myself with the codebase. Can I take up this issue? |
@Fenil3510 sure yeah. I think the steps above should work, so I'd follow them through to get an idea of what needs doing here. |
I'll send an initial PR as soon as possible. Thank you |
Don't we use |
@jbarnoud yes there is openany from util.py used in PDBwriter. I too was thinking along similar lines. Do you mean that changes in openany(anyopen specifically) function to handle .gz extension would do the job? |
@Fenil3510 I did not look at the code, but, if I recall correctly, |
@jbarnoud, yes precisely that is what is happening. The get_writer() function searches suitable writer based on the name extension in the argument |
Sounds good, indeed. Le 12 mars 2019 14:03, GeneX <[email protected]> a écrit :@jbarnoud, yes precisely that is what is happening. The get_writer() function searches suitable writer based on the name extension in the argument u.atom.write(). But when the argument is passed as .gz, it raises an error that no writer found. So I guess the fix would be to change the code such that it calls for writer that is before .gz ie. PDB in this case and openany would handle the compression part. I have done some hacks to check if this works and it does. So this would be the way to go right?
—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread.
|
Ok @jbarnoud. I'll put a PR latest by tomorrow evening. Thanks. |
Writes compressed output of given format (fixes #2216)
We can currently read ascii files that are compressed (eg
mda.Universe('this.pdb.gz')
). It would be cool ifu.atoms.write('new.pdb.gz')
also worked (ie wrote a pdb file that was compressed with gz).I'm not 100% sure how this should work, but one idea is to add a
GZWriter
which acts as a wrapper, calling the "real" format Writer and then compressing whatever was created. So calling chain would beu.atoms.write('something.pdb.gz')
makes aGZWriter
GZWriter
makes aPDBWriter
GZWriter
can get the child Writer to write to a stream to lessen I/O operations?PDBWriter
does its thing (oblivious to whats happening)GZWriter
then compresses the PDB fileOther things to consider
CompressionWriter
?)The text was updated successfully, but these errors were encountered: