(eval-when (:compile-toplevel :execute :load-toplevel) (register-namespace "alz:" "http://www.alzforum.org/res/com/ant#") (register-namespace "reagent:" "http://www.w3.org/2001/sw/hcls/ontologies/reagent.owl#")) (define-ontology reagent (:base "http://www.w3.org/2001/sw/hcls/ontologies/reagent.owl") (class !Reagent :partial) (class !Antibody :partial !Reagent) ;; antibody clonality (value-partition '(!AntibodyClonality !PolyclonalAntibody !MonoclonalAntibody)) (object-property !hasClonality :functional (domain !Antibody) (range !AntibodyClonality)) ;; isotype (value-partition '(!AntibodyImmunoglobulin (!IgG !IgG1 (!IgG2 !IgG2a !IgG2b !IgG2c) !IgG3) !IgM !IgY)) (value-partition '(!AntibodyHeavyChain !KappaChain !LambaChain)) ;; methods ;; (define-alz-methods) ;; sample preparation (value-partition '(!ImmunoAssaySamplePreparation !CellSmearSample !CellsSample !VibratomeSectionsSample !ParaffinSectionsSample !FrozenSectionsSample)) ;; database fields (annotation-property !hasEpitopeDescription) (annotation-property !hasSpecificityDescription) (annotation-property !hasHostDescription) (annotation-property !hasReactivityDescription) (annotation-property !hasCompanyDescription) (annotation-property !alz:hasAntibodyId) (annotation-property !alz:hasAntigenClass) ) (defun foreach-antibody-entry (function) (with-open-file (f "hcls/biordf/reagents/antibody-db-dump-2006-03.txt") (let ((headers (mapcar (lambda(header) (intern (string-upcase header) 'keyword)) (split-at-regex (read-line f) "\\t")))) (loop for line = (read-line f nil :eof) until (eq line :eof) for fields = (split-at-regex line "\\t") do (funcall function (mapcar 'cons headers fields)))))) ;; (class !Supplier :partial) ;; (class !Manufacturer :partial !supplier) ;; (class !Supplier :partial !supplier) ;; (class !epitopeDescription :partial) ;; (class !SequenceRange :partial !epitopeDescription) ;; (datatype-property !fromSequencePosition range(xsd:int)) ;; (datatype-property !toSequencePosition range(xsd:int)) ;; (class !ProteinSequenceRange :partial !SequenceRange) ;; (object-property !ofProtein domain(!ProteinSequenceRange) range(!Protein)) ;; (class !method :partial) ;; (("antibodyID" "626") ;; ("antigenID" "Bcl") ; class. (does this include families?) ;; ("datasheet" "trans610746.asp") ;; ("datasheetLinkText" "Bcl-X") ;; ("externalLink" "1") ;; ("clonalityID" "monoclonal") ;; ("cloneNum" "44") ;; ("antigenInfo" " IgG1") ;; ("companyName" "BD Biosciences PHARMINGEN") ;; http://www.bdbiosciences.com/index.shtml ;; ("distributorInfo" "Formerly Transduction") ;; entrez 598 http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=gene&cmd=Retrieve&dopt=full_report&list_uids=598 ;; ("epitope" "aa. 18-233 of human Bcl-XL") ;; ("host" "mouse") ;; ("hostFastOutput" "monoclonal mouse") ;; ("hostExtraInfo" "BSA, azite") ;; ("methodFastOutput" "IF, IH, WB") ;; http://www.alzforum.org/res/com/ant/glossary.asp ;; ("methodExtraInfo" "") ;; ("specificity" "Bcl-X, 26kDa") ;; ("reactivityFastOutput" "human, rat, mouse") ;; ("reactivityExtrainfo" "NULL") ;; ("fromWhoID" "Manufacturers")) ;; (individual !monoclonal (type !MonoclonalAntibody)) ;; (individual !polyclonal (type !PolyClonalAntibody)) ;; (individual !alzant:626 !Antibody ;; (value !hasClonality !monoclonal) ;; (value ! ;; ) ;; (loop for a in ;; (map 'list #"toString" (#"split" "antibodyID antigenID datasheet datasheetLinkText externalLink clonalityID cloneNum antigenInfo companyName distributorInfo epitope host hostFastOutput hostExtraInfo methodFastOutput methodExtraInfo specificity reactivityFastOutput reactivityExtrainfo fromWhoID" ;; "\\t")) ;; for b in ;; (map 'list #"toString" (#"split" "626 Bcl trans610746.asp Bcl-X 1 monoclonal 44 IgG1 BD Biosciences PHARMINGEN Formerly Transduction aa. 18-233 of human Bcl-XL mouse monoclonal mouse BSA, azite IF, IH, WB Bcl-X, 26kDa human, rat, mouse NULL Manufacturers")) ;; collect (list a b)) ;; (("antibodyID" "626") ;; ("antigenID" "Bcl") ; class. (does this include families?) ;; ("datasheet" "trans610746.asp") ;; ("datasheetLinkText" "Bcl-X") ;; ("externalLink" "1") ;; ("clonalityID" "monoclonal") ;; ("cloneNum" "44") ;; ("antigenInfo" " IgG1") ;; ("companyName" "BD Biosciences PHARMINGEN") ;; http://www.bdbiosciences.com/index.shtml ;; ("distributorInfo" "Formerly Transduction") ;; entrez 598 http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=gene&cmd=Retrieve&dopt=full_report&list_uids=598 ;; ("epitope" "aa. 18-233 of human Bcl-XL") ;; ("host" "mouse") ;; ("hostFastOutput" "monoclonal mouse") ;; ("hostExtraInfo" "BSA, azite") ;; ("methodFastOutput" "IF, IH, WB") ;; http://www.alzforum.org/res/com/ant/glossary.asp ;; ("methodExtraInfo" "") ;; ("specificity" "Bcl-X, 26kDa") ;; ("reactivityFastOutput" "human, rat, mouse") ;; ("reactivityExtrainfo" "NULL") ;; ("fromWhoID" "Manufacturers")) (define-ontology alzantibodies (:base "http://www.w3.org/2001/sw/hcls/ontologies/reagent.owl" :includes '(reagent)) (let ((individuals nil) (count 0)) (block limit (foreach-antibody-entry (lambda(entry) (let ((lastfield nil) (lastvalue nil)) (flet ((field (field) (if (eq field lastfield) lastvalue (setq lastvalue (let ((value (cdr (assoc field entry)))) (if (and (char= (char value 0) #\") (char= (char value (1- (length value))) #\")) (setq value (subseq value 1 (- (length value) 2)))) (if (or (equal value "NULL") (equal value " ")) nil (progn (#"replaceAll" (#"replaceAll" value "&" "&") "\"" "%22")))))))) ; (when (> (incf count) 2000) ; (return-from limit nil)) (let* ((name (make-uri-base-relative (format nil "antibody-~a" (field :antibodyid)) "alz:")) (individual (individual name (annotation !alz:hasAntibodyId (field :antibodyid)) (and (field :epitope) (annotation !hasEpitopeDescription (field :epitope))) (and (field :specificity) (annotation !hasSpecificityDescription (field :specificity))) (and (field :hostfastoutput) (annotation !hasHostDescription (format nil "~a~a" (field :hostfastoutput) (if (field :hostExtraInfo) (format nil " (~a)" (field :hostExtraInfo)) "")))) (and (field :reactivityfastoutput) (annotation !hasReactivityDescription (format nil "~a~a" (field :reactivityfastoutput) (if (field :reactivityextrainfo) (format nil " (~a)" (field :reactivityextrainfo)) "")))) (and (field :companyname) (annotation !hasCompanyDescription (field :companyname))) (annotation !alz:hasAntigenClass (field :antigenId)) (type !Antibody)))) (push individual individuals))))))) individuals)) (defun ant (&optional limit) (let ((count 0) (unknowns nil)) (foreach-antibody-entry (lambda (entry) (if (and limit (> (incf count) limit)) (return-from ant unknowns) (progn ;;(setq unknowns (union unknowns (second (multiple-value-list (parse-methods entry))) :test 'equal)) ;;(pushnew (parse-antigen-info entry) unknowns :test 'equalp) (pushnew (parse-specificity entry) unknowns :test 'equalp) )))) unknowns)) (defun all-matches (string regex &rest which) (let ((matcher (#"matcher" (#"compile" 'java.util.regex.pattern regex) string))) (loop while (#"find" matcher) collect (loop for g in which collect (#"group" matcher g))))) (defun parse-methods (entry) (let ((known (test)) (unknowns nil)) (let* ((methods (cdr (assoc :methodfastoutput entry))) (cleaned (#"replaceAll" methods "<.{0,1}nobr>" ""))) (setq cleaned (#"replace" cleaned "\"" "")) (let ((composites (all-matches cleaned "(I.)\\((.*?)\\)" 0 1 2))) (loop for (got) in composites do (setq cleaned (#"replace" cleaned got ""))) (setq cleaned (split-at-regex cleaned "\\s*,\\s*")) (setq cleaned (remove "NULL" cleaned :test 'equalp)) (loop for (got prefix which) in composites for specifics = (split-at-regex which "\\s*,\\s*") do (loop for specific in specifics do (push (format nil "~a(~a)" prefix specific) cleaned))) (loop for one in cleaned when (not (find one known :test 'equalp)) do (pushnew one unknowns :test 'equal)))) (values cleaned unknowns))) ;; http://www.antibodyresource.com/educational.html ;; http://nhpreagents.bidmc.harvard.edu/NHP/default.aspx ;; http://www.keithbahjat.com/abcxr/ ;; http://www.hiv.lanl.gov/content/immunology/search_help.html ;; http://www.google.com/search?client=safari&rls=en&q=antibody+database&ie=UTF-8&oe=UTF-8 ;; http://www.cellnucleus.com/antibody.htm ;; http://www.antibodyresource.com/findantibody.html ;; http://www.linscottsdirectory.com/ ;; http://researchlink.labvelocity.com/products/index.jhtml;$sessionid$UGVHAQYAAAQXCQBICNVBNWQ?nodeId=1017&path=0 ;; http://en.wikipedia.org/wiki/Immunoglobulin ;; http://en.wikipedia.org/wiki/Immunoglobulin#IgG ;; IgG: 1,2a,2b,3 - can be annotated kappa ;; http://en.wikipedia.org/wiki/Immunoglobulin#IgM ;; IgM ;; IgY (chicken) ;; 954 is kappa ;; 955 is lambda ;; RMAB recombinant monoclonal antibody (rmAb) http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&list_uids=1751781&dopt=Abstract (only one example in altz) (defparameter *isotype-noise-pattern* (load-time-value (#"compile" 'java.util.regex.pattern "(
)|(&)|( )|([lL]igand)|(^[ \"]*)|([ \"]*$)|(<\\/>)|((?i)<.{0,1}sub[>.])"))) (defun parse-antigen-info (entry) (let ((antigenInfo (cdr (assoc :antigenInfo entry)))) (setq antigenInfo (#"replaceAll" (#"matcher" *isotype-noise-pattern* antigenInfo) "")) ; noise (setq antigenInfo (#"replaceAll" antigenInfo "^\\s*" "")) (setq antigenInfo (#"replaceAll" antigenInfo "[ ,]{0,1}κ" " kappa")) (setq antigenInfo (#"replaceAll" antigenInfo "954" " kappa")) (setq antigenInfo (#"replaceAll" antigenInfo "[ ,]{0,1}&#(955|923);" " lambda")) (setq antigenInfo (#"replaceFirst" antigenInfo "^.*?(?=[Ii][Gg].*)" "")) (setq antigenInfo (#"replaceAll" antigenInfo "[;>