Bioplib
Protein Structure C Library
|
Select a subset of atom types from a PDB linked list. More...
#include <string.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include "SysDefs.h"
#include "MathType.h"
#include "pdb.h"
#include "macros.h"
Go to the source code of this file.
Functions | |
PDB * | blSelectAtomsPDBAsCopy (PDB *pdbin, int nsel, char **sel, int *natom) |
Select a subset of atom types from a PDB linked list.
This code is NOT IN THE PUBLIC DOMAIN, but it may be copied according to the conditions laid out in the accompanying file COPYING.DOC.
The code may be modified as required, but any modifications must be documented so that the person responsible can be identified.
The code may not be sold commercially or included as part of a commercial product except as described in the file COPYING.DOC.
This routine takes a linked list of type PDB and returns a list containing only those atom types specfied in the sel array.
[in] | pdbin | Input list |
[in] | nsel | Number of atom types to keep |
[in] | sel | List of atom types to keep |
[out] | natom | Number of atoms kept |
To set up the list of atoms to keep, define an array of pointers to char: e.g. char *sel[10]
Then define the atoms in the list thus:
SELECT(sel[0],"N "); SELECT(sel[1],"CA "); SELECT(sel[2],"C "); SELECT(sel[3],"O ");
The SELECT macro returns a character pointer which will be NULL if the allocation it performs fails.
N.B. The routines are non-destructive; i.e. the original PDB linked list is intact after the selection process
Definition in file SelAtPDB.c.
[in] | *pdbin | Input list |
[in] | nsel | Number of atom types to keep |
[in] | **sel | List of atom types to keep |
[out] | *natom | Number of atoms kept |
Take a PDB linked list and returns a list containing only those atom types specified in the sel array.
To set up the list of atoms to keep, define an array of pointers to char: e.g. char *sel[10] Then define the atoms in the list thus:
SELECT(sel[0],"N "); SELECT(sel[1],"CA "); SELECT(sel[2],"C "); SELECT(sel[3],"O ");
Ensure the spaces are used!!
N.B. The routine is non-destructive; i.e. the original PDB linked list is intact after the selection process
Definition at line 173 of file SelAtPDB.c.