index xrefs 2006/08/08 17:41:29

ChemoJunMolFileReader

ChemoJun050 (2006/08/08) Copyright 2002-2006 National Institute of Informatics, Research Organization of Information and Systems.

category:

inheritance:

instance variables:

class instance variables:

class variables:

pool variables:

instance methods:

  1. atomList [accessing] xrefs
    	atomList isNil ifTrue: [atomList := OrderedCollection new].
    	^atomList
  2. connectionList [accessing] xrefs
    	connectionList isNil ifTrue: [connectionList := OrderedCollection new].
    	^connectionList
  3. defaultAtomObjectClass [defaults] xrefs
    	^self class defaultAtomObjectClass
  4. defaultMoleculeObjectClass [defaults] xrefs
    	^self class defaultMoleculeObjectClass
  5. initialize [initialize-release] xrefs
    	super initialize.
    	numberOfAtoms := nil.
    	numberOfConnections := nil.
    	atomList := nil.
    	connectionList := nil
  6. moleculeObject [accessing] xrefs
    	^self class defaultMoleculeObjectClass fromReader: self
  7. numberOfAtoms [accessing] xrefs
    	numberOfAtoms isNil ifTrue: [numberOfAtoms := 0].
    	^numberOfAtoms
  8. numberOfConnections [accessing] xrefs
    	numberOfConnections isNil ifTrue: [numberOfConnections := 0].
    	^numberOfConnections
  9. readAtomBlockFrom: aStream [reading] xrefs
     
    	numberOfAtoms timesRepeat: 
    			[| line size string x y z atom point |
    			line := self getLine: aStream.
    			size := line size.
    			string := line copyFrom: (1 min: size) to: (10 min: size).
    			x := (string , 'd') asNumber.
    			string := line copyFrom: (11 min: size) to: (20 min: size).
    			y := (string , 'd') asNumber.
    			string := line copyFrom: (21 min: size) to: (30 min: size).
    			z := (string , 'd') asNumber.
    			string := line copyFrom: (32 min: size) to: (34 min: size).
    			[string first isSeparator] 
    				whileTrue: [string := string copyFrom: 2 to: string size].
    			[string last isSeparator] 
    				whileTrue: [string := string copyFrom: 1 to: string size - 1].
    			atom := string.
    			point := x , y , z.
    			self atomList add: (Array with: atom with: point)]
  10. readBondBlockFrom: aStream [reading] xrefs
     
    	numberOfConnections timesRepeat: 
    			[| line size string from to bond stereo |
    			line := self getLine: aStream.
    			size := line size.
    			string := line copyFrom: (1 min: size) to: (3 min: size).
    			from := string asNumber.
    			string := line copyFrom: (4 min: size) to: (6 min: size).
    			to := string asNumber.
    			string := line copyFrom: (7 min: size) to: (9 min: size).
    			bond := string asNumber.
    			string := line copyFrom: (10 min: size) to: (12 min: size).
    			stereo := string asNumber.
    			self connectionList add: (Array 
    						with: from
    						with: to
    						with: bond
    						with: stereo)]
  11. readCountsLineFrom: aStream [reading] xrefs
     
    	| line string |
    	line := self getLine: aStream.
    	string := line copyFrom: 1 to: 3.
    	numberOfAtoms := string asNumber.
    	string := line copyFrom: 4 to: 6.
    	numberOfConnections := string asNumber
  12. readFrom: aStream [reading] xrefs
     
    	commentList := OrderedCollection new.
    	numberOfAtoms := 0.
    	numberOfConnections := 0.
    	atomList := nil.
    	connectionList := nil.
    	self readHeaderBlockFrom: aStream.
    	self readCountsLineFrom: aStream.
    	self readAtomBlockFrom: aStream.
    	self readBondBlockFrom: aStream.
    	self readPropertiesBlockFrom: aStream
  13. readHeaderBlockFrom: aStream [reading] xrefs
     
    	| boolean position line collection |
    	boolean := true.
    	position := aStream position.
    	[aStream atEnd not and: [boolean]] whileTrue: 
    			[position := aStream position.
    			line := self getLine: aStream.
    			collection := self separate: line dividers: self separators , 'Vv'.
    			(collection size >= 2 and: 
    					[((collection at: 1) detect: [:c | c isDigit not] ifNone: [nil]) isNil 
    						and: [((collection at: 2) detect: [:c | c isDigit not] ifNone: [nil]) isNil]]) 
    				ifTrue: [boolean := false]
    				ifFalse: [self commentList add: line]].
    	aStream position: position
  14. readPropertiesBlockFrom: aStream [reading] xrefs
     
    	[aStream atEnd not] whileTrue: 
    			[| aString aCollection |
    			aString := self getLine: aStream.
    			aCollection := self separate: aString.
    			(aCollection size >= 2 
    				and: [(aCollection at: 1) = 'M' and: [(aCollection at: 2) = 'END']]) 
    					ifTrue: [^self]].
    	^self

class methods:

  1. copyright [copyright] xrefs
    	^'ChemoJun050 (2006/08/08) Copyright 2002-2006 National Institute of Informatics, Research Organization of Information and Systems.'
  2. defaultAtomConnectionClass [defaults] xrefs
    	^ChemoJunAtomConnection
  3. defaultFileDescriptions [defaults] xrefs
    	^Array with: (Array 
    				with: (#chemoJun_Molecular_structure_files >> 'Molecular structure files') 
    						asString)
    		with: (Array with: (#jun_All_files >> 'All files') asString)
  4. defaultFilePatterns [defaults] xrefs
    	^Array with: #('*.mol' '*.MOL') with: #('*')
  5. defaultMoleculeObjectClass [defaults] xrefs
    	^ChemoJunMoleculeObject
  6. defaultRequestMessageString [defaults] xrefs
    	^(#chemoJun_Select_a_molecular_file_ >> 'Select a molecular file.') asString
  7. example1 [examples] xrefs
    	"ChemoJunMolFileReader example1."
    
    	| aReader |
    	aReader := ChemoJunMolFileReader request.
    	aReader isNil ifTrue: [^nil].
    	^aReader
  8. example2 [examples] xrefs
    	"ChemoJunMolFileReader example2."
    
    	| aReader |
    	aReader := ChemoJunMolFileReader request.
    	aReader isNil ifTrue: [^nil].
    	(ChemoJunMoleculeViewer moleculeObject: aReader moleculeObject) open
  9. system [copyright] xrefs
    	^'ChemoJun'
  10. version [copyright] xrefs
    	^'050'

index xrefs