All on Input and Output

BiochemicalAlgorithms.jl supports the reading and writing of several common structural data formats.

Protein Data Bank Format (PDB)

The most common format ist the PDB. Have a look at Learning about PDB data if you want to refresh your knowledge about this format. For a deeper understanding you can also read PDB format specifications.

Read a PDB file from the BiochemicalAlgorithms.jl repository:

sys = load_pdb(ball_data_path("../test/data/AlaAla.pdb"))
System{Float32} with 23 atoms (AlaAla.pdb)

Write the same system back into a new PDB file:

write_pdb("Ala_out.pdb", sys)

PubChem

In addition to PDB, the pubchem data base plays an important role as a source of structural data. Pubchem allows to retrieve data in JSON which is read by BiochemicalAlgorithms.jl as shown below:

sys = load_pubchem_json(ball_data_path("../test/data/aspirin_pug.json"))
System{Float32} with 21 atoms

SD file

sys = load_sdfile(ball_data_path("../test/data/rings_test.sdf"))
System{Float32} with 148 atoms (rings_test.sdf)

Write the system into a new SD file:

write_sdfile("rings_test_out.sdf", sys)
┌ Warning: write_sdfile: writer only supports 2D data; projecting atoms onto xy-plane...
└ @ BiochemicalAlgorithms ~/git/ball.jl/src/fileformats/sdfile.jl:23
[ Info: 9 records exported.