FNam2PDB.c



char *FNam2PDB(char *filename)

Inputs

char *filename A PDB filename containing a PDB code

Returns

char * The PDB code (lower case) NULL if memory allocation fails XXXX if filename blank or NULL or if unable to find PDB code
This routine attempts to convert a filename stem to a PDB code.

Description

All the following inputs should produce the same output of 1fbj: $A:[PDB]PDB1FBJ.ENT C:\P1FBJ.PDB /pdb/p1fbj.pdb /pdb/pdb1fbj.pdb 1fbj.pdb 1fbjL

The routine first removes characters from the start of the filename up to the last : ] / or \. It then searches for the following possible patterns (where N is a digit and X is an alphanumeric)

pdbNXXX pNXXX NXXX XXXX.pdb XXXX.ent

This should cover just about any filename which includes a legal PDB code.

Created: 24.07.95 Last Modified: 26.07.95