pdb_numpy.format package

Submodules

pdb_numpy.format.gro module

pdb_numpy.format.gro.get_gro_string(gro_coor)[source]

Return a coor object as a gro string.

Parameters:
selfCoor

Coor object

Returns:
str

Coor object as a gro string

pdb_numpy.format.gro.parse(gro_lines)[source]

Parse the gro lines and return atom information’s as a Coor.

Parameters:
gro_lineslist

list of gro lines

Returns:
Coor

Coor object

pdb_numpy.format.gro.write(coor, gro_out, overwrite=False)[source]

Write a gro file.

Parameters:
coorCoor

Coor object

gro_outstr

path of the gro file to write

overwritebool, optional, default=False

flag to overwrite or not if file has already been created.

Returns:
None

Examples

>>> prot_coor = Coor(os.path.join(TEST_PATH, '1y0m.pdb'))
>>> prot_coor.write(os.path.join(TEST_OUT, 'tmp.gro'))
Succeed to save file tmp.gro

pdb_numpy.format.mmcif module

pdb_numpy.format.mmcif.fetch(pdb_ID)[source]

Get a mmcif file from the PDB using its ID and return a Coor object.

Parameters:
pdb_IDstr

pdb ID

Returns:
Coor

Coor object

Examples

>>> prot_coor = Coor()
>>> prot_coor.get_PDB_mmcif('3EAM')
pdb_numpy.format.mmcif.fetch_BioAssembly(pdb_ID, index=1)[source]

Get a Bio Assembly mmcif file from the PDB using its ID and return a Coor object.

Parameters:
pdb_IDstr

pdb ID

indexint

Bio Assembly index

Returns:
Coor

Coor object

Examples

>>> prot_coor = Coor()
>>> prot_coor.get_PDB('3EAM')
pdb_numpy.format.mmcif.get_mmcif_string(coor)[source]

Return a coor object as a mmcif string.

Parameters:
coorCoor

Coor object to write

Returns:
str

Coor object as a pdb string

pdb_numpy.format.mmcif.parse(mmcif_lines)[source]

Parse the mmcif lines and return atom information as a dictionary

Parameters:
mmcif_lineslist

list of pdb lines

Returns:
Coor

Coor object

pdb_numpy.format.mmcif.parse_crystal_pack(data_mmCIF)[source]

Parse crystal packing information from a mmcif file. treat the following mmcif tags: - _cell - _symmetry

Parameters:
data_mmCIFdict

mmcif data

Returns:
crystal_packstr

crystal packing

pdb_numpy.format.mmcif.parse_symmetry(data_mmCIF)[source]

Parse information from a mmcif file. treat the following mmcif tags: - _symmetry_equiv_pos_as_xyz

Parameters:
data_mmCIFdict

mmcif data

Returns:
symmetry_dictdict

symmetry dict

pdb_numpy.format.mmcif.parse_transformation(data_mmCIF)[source]

Parse information from a mmcif file. treat the following mmcif tags: - _pdbx_struct_assembly_gen - _pdbx_struct_oper_list - _pdbx_struct_assembly

Parameters:
data_mmCIFdict

mmcif data

Returns:
transformation_dictdict

transformation dict

pdb_numpy.format.mmcif.read(file_in)[source]

Read a mmcif file.

Parameters:
file_instr

path of the pdb file to read

Returns:
Coor

Coor object

pdb_numpy.format.mmcif.write(coor, mmcif_out, overwrite=False)[source]

Write a mmcif file.

Parameters:
coorCoor

Coor object

mmcif_outstr

path of the mmcif file to write

overwritebool, optional, default=False

flag to overwrite or not if file has already been created.

Returns:
None

pdb_numpy.format.pdb module

pdb_numpy.format.pdb.fetch(pdb_ID)[source]

Get a pdb file from the PDB using its ID and return a Coor object.

Parameters:
pdb_IDstr

pdb ID

Returns:
Coor

Coor object

Examples

>>> prot_coor = Coor()
>>> prot_coor.get_PDB('3EAM')
pdb_numpy.format.pdb.fetch_BioAssembly(pdb_ID, index=1)[source]

Get a Bio Assembly pdb file from the PDB using its ID and return a Coor object.

Parameters:
pdb_IDstr

pdb ID

indexint

Bio Assembly index

Returns:
Coor

Coor object

Examples

>>> prot_coor = Coor()
>>> prot_coor.get_PDB('3EAM')
pdb_numpy.format.pdb.get_pdb_string(pdb_coor)[source]

Return a coor object as a pdb string.

Parameters:
pdb_coorCoor

Coor object

Returns:
str

Coor object as a pdb string

Examples

>>> prot_coor = Coor()
>>> prot_coor.read_file(os.path.join(TEST_PATH, '1y0m.pdb'))    
Succeed to read file ...1y0m.pdb ,  648 atoms found
>>> pdb_str = prot_coor.get_structure_string()
>>> print(f'Number of caracters: {len(pdb_str)}')
Number of caracters: 51264
pdb_numpy.format.pdb.parse(pdb_lines, pqr_format=False)[source]

Parse the pdb lines and return atom information’s as a dictionary

Parameters:
pdb_lineslist

list of pdb lines

pqr_formatbool, optional

if True, parse pqr format, by default False

Returns:
Coor

Coor object

pdb_numpy.format.pdb.parse_symmetry(text)[source]

Parse the REMARK 290 SMTRY information from a pdb file.

Parameters:
textstr

pdb file

Returns:
symetry_dictdict

symetry information

pdb_numpy.format.pdb.parse_transformation(text)[source]

Parse the REMARK 350 BIOMT information from a pdb file.

Parameters:
textstr

pdb file

Returns:
symetry_dictdict

symetry information

pdb_numpy.format.pdb.write(coor, pdb_out, overwrite=False)[source]

Write a pdb file.

Parameters:
coorCoor

Coor object

pdb_outstr

path of the pdb file to write

overwritebool, optional, default=False

flag to overwrite or not if file has already been created.

Returns:
None

Examples

>>> prot_coor = Coor(os.path.join(TEST_PATH, '1y0m.pdb'))
>>> prot_coor.write_pdb(os.path.join(TEST_OUT, 'tmp.pdb'))
Succeed to save file tmp.pdb

pdb_numpy.format.pqr module

pdb_numpy.format.pqr.get_pqr_string(coor)[source]

Return a coor object as a pqr string.

Parameters:
coorCoor

Coor object

Returns:
str

Coor object as a pqr string

Examples

>>> prot_coor = Coor()
>>> prot_coor.read_pdb(os.path.join(TEST_PATH, '1y0m.pdb'))    
Succeed to read file ...1y0m.pdb ,  648 atoms found
>>> pqr_str = prot_coor.get_pqr_structure_string()
>>> print('Number of caracters: {}'.format(len(pqr_str)))
Number of caracters: 46728
pdb_numpy.format.pqr.parse(pqr_lines)[source]

Parse the pqr lines and return atom information’s as a dictionary

Parameters:
pqr_lineslist

list of pdb lines

Returns:
Coor

Coor object

pdb_numpy.format.pqr.write(coor, pqr_out, overwrite=False)[source]

Write a pdb file.

Parameters:
coorCoor

Coor object

pqr_outstr

path of the pqr file to write

overwritebool, optional, default=False

flag to overwrite or not if file has already been created.

Returns:
None

Examples

>>> TEST_OUT = str(getfixture('tmpdir'))
>>> prot_coor = Coor(os.path.join(TEST_PATH, '1y0m.pdb'))    
Succeed to read file ...1y0m.pdb ,  648 atoms found
>>> prot_coor.write_pdb(os.path.join(TEST_OUT, 'tmp.pdb'))    
Succeed to save file ...tmp.pdb

Module contents

Format library for pdb_numpy module.