240-magic-add-pdb.patch 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. Author: Adam Buchbinder <adam.buchbinder@gmail.com>
  2. Description: Adding new magics for PDB files (Closes: #480829).
  3. diff -Naurp file.orig/magic/Magdir/scientific file/magic/Magdir/scientific
  4. --- file.orig/magic/Magdir/scientific 2010-07-11 00:17:48.700953291 +0200
  5. +++ file/magic/Magdir/scientific 2010-07-13 18:10:28.461677038 +0200
  6. @@ -71,3 +71,29 @@
  7. 0 string \060\000\040\000\110\000\105\000\101\000\104\000 GEDCOM data
  8. 0 string \376\377\000\060\000\040\000\110\000\105\000\101\000\104 GEDCOM data
  9. 0 string \377\376\060\000\040\000\110\000\105\000\101\000\104\000 GEDCOM data
  10. +
  11. +# PDB: Protein Data Bank files
  12. +# Adam Buchbinder <adam.buchbinder@gmail.com>
  13. +#
  14. +# http://www.wwpdb.org/documentation/format32/sect2.html
  15. +# http://www.ch.ic.ac.uk/chemime/
  16. +#
  17. +# The PDB file format is fixed-field, 80 columns. From the spec:
  18. +#
  19. +# COLS DATA
  20. +# 1 - 6 "HEADER"
  21. +# 11 - 50 String(40)
  22. +# 51 - 59 Date
  23. +# 63 - 66 IDcode
  24. +#
  25. +# Thus, positions 7-10, 60-62 and 67-80 are spaces. The Date must be in the
  26. +# format DD-MMM-YY, e.g., 01-JAN-70, and the IDcode consists of numbers and
  27. +# uppercase letters. However, examples have been seen without the date string,
  28. +# e.g., the example on the chemime site.
  29. +0 string HEADER\ \ \ \
  30. +>&0 regex/1 \^.{40}
  31. +>>&0 regex/1 [0-9]{2}-[A-Z]{3}-[0-9]{2}\ {3}
  32. +>>>&0 regex/1s [A-Z0-9]{4}.{14}$
  33. +>>>>&0 regex/1 [A-Z0-9]{4} Protein Data Bank data, ID Code %s
  34. +!:mime chemical/x-pdb
  35. +>>>>0 regex/1 [0-9]{2}-[A-Z]{3}-[0-9]{2} \b, %s