The outage for Sunday 24th November has been cancelled.
Bioplib
Protein Structure C Library
 All Data Structures Files Functions Variables Typedefs Macros Pages
Functions
SelAtPDB.c File Reference

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

PDBblSelectAtomsPDBAsCopy (PDB *pdbin, int nsel, char **sel, int *natom)
 

Detailed Description

Select a subset of atom types from a PDB linked list.

Version
V1.11
Date
19.04.15
Author
Dr. Andrew C. R. Martin
Institute of Structural & Molecular Biology, University College London, Gower Street, London. WC1E 6BT.
andre.nosp@m.w@bi.nosp@m.oinf..nosp@m.org..nosp@m.uk andre.nosp@m.w.ma.nosp@m.rtin@.nosp@m.ucl..nosp@m.ac.uk

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.

Description:

Usage:

pdbout = blSelectAtomsPDBAsCopy(pdbin,nsel,sel,natom)

This routine takes a linked list of type PDB and returns a list containing only those atom types specfied in the sel array.

Parameters
[in]pdbinInput list
[in]nselNumber of atom types to keep
[in]selList of atom types to keep
[out]natomNumber of atoms kept
Returns
PDB output list

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

Revision History:

Definition in file SelAtPDB.c.

Function Documentation

PDB* blSelectAtomsPDBAsCopy ( PDB pdbin,
int  nsel,
char **  sel,
int *  natom 
)
Parameters
[in]*pdbinInput list
[in]nselNumber of atom types to keep
[in]**selList of atom types to keep
[out]*natomNumber of atoms kept
Returns
Output list

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

  • 01.03.90 Original By: ACRM
  • 28.03.90 Modified to match new version of pdb.h
  • 24.05.90 Fixed so the variables passed in as sel[] don't have* to be 4 chars.
  • 17.05.93 Modified for book. Returns BOOL.
  • 09.07.93 Modified to return PDB pointer. Changed allocation scheme. Changed back to sel[] variables must be 4 chars.
  • 04.02.09 Initialize q for fussy compliers
  • 07.07.14 Use bl prefix for functions By: CTP
  • 19.08.14 Renamed function to blSelectAtomsPDBAsCopy(). By: CTP

Definition at line 173 of file SelAtPDB.c.