On Thu, 2013-06-06 at 14:41 +1000, Nat Echols wrote:
> You should resist the temptation to write your own PDB parser; that
> way lies pain and suffering.  There are multiple free libraries for
> Python that can be used for this task - I recommend either CCTBX or
> BioPython (probably the latter if you don't need to do very much with
> the models).

Well, that depends on what one is trying to accomplish.  Say, I just
want to count how many atoms I have that are partially occupied in an
average PDB file.  All I need to know is that occupancy is stored in
columns 55:60 as Real(6.2), and that atom record lines begin with "ATOM
"|"HETATM".  With basic python/c/perl/whatever knowledge I can write my
own "occupancy parser" faster than this post.  Getting BioPython or
CCTBX to work will definitely take longer.

By writing primitive parsers one also gains speed and portability, as
well as extends programming skills.  Basically this choice depends on
the complexity of the task and long/short-term goals.

Cheers,

Ed.

-- 
Oh, suddenly throwing a giraffe into a volcano to make water is crazy?
                                                Julian, King of Lemurs

Reply via email to