HowChemScriptworks
ThemostfundamentaluseforChemScriptistoreaddatafromonesource,modifythedatausingascript,andwrite
themodifieddatatoanotherlocation.Youcanretrievedatafromorwritetoalmostanydatabase,file(s),orapplic-
ation.
Figure13.1:AChemScriptscriptcanretrievedatafromonesource,modifythedata,andwriteittoanotherlocation.
Howthedataismodifiedisdeterminedentirelybythescript.Thescriptcandeletedata,calculateoraddnewdata,or
editexistingdata.Thedatacanbeeithertext,structures,orboth.
SinceChemScriptscriptsarelikeanyotherPythonscriptsor.NETprogram,youcanexecutethescriptsusingeither
theWindowscommandlineoranydevelopmentenvironment.
GettingStarted
Bydefault,ChemScriptandPython3.2areinstalledonyourlocalcomputerwhenyouinstallChemBioOffice.After
theinstallation,wesuggestthatyoufollowthesimpleexercisesinthissectiontofamiliarizeyourselfwith
ChemScript.
ForeditingChemScriptfiles,werecommendthatyouuseoneofthemanyprogrammingtoolsthatareavailable.One
ofthesetools,IDLE,isincludedwiththePythoninstallation.TolearnmoreaboutIDLE,seetheonlineHelpinthe
IDLEmainmenu.
StartingIDLE
FromtheStartmenu,gotoAllPrograms>Python3.2>IDLE(PythonGUI).AfterPythonstarts,aPythonshell
opensinIDLEandtheheaderindicatesaversionofPython(Ex.3.2),andaversionofIDLE(Ex.1.2).Apromptwill
alsoappear:“>>>”
LoadingtheChemScriptLibrary
Atthecommandprompt,typethelinebelowandpress<Enter>:
import ChemScript14 *
ChemBioDraw14.0
Chapter13:ChemScript
221of315
Pdf rotate page - rotate PDF page permanently in C#.net, ASP.NET, MVC, Ajax, WinForms, WPF
Empower Users to Change the Rotation Angle of PDF File Page Using C#
pdf save rotated pages; how to rotate pdf pages and save
Pdf rotate page - VB.NET PDF Page Rotate Library: rotate PDF page permanently in vb.net, ASP.NET, MVC, Ajax, WinForms, WPF
PDF Document Page Rotation in Visual Basic .NET Class Application
pdf rotate page; rotate pdf page few degrees
Note:Thecommandiscase-sensitive.
A“WelcometoCSChemScript”messageappears,followedbyacommandprompt.
ChemScriptHelp
YoucanreadadescriptionofanyChemScriptclasswithinIDLE.Forexample,enterthelinebelowtoreturnHelpfor
theChemScriptAtomclass.
help(Atom)
Thehelpwillbeginwithamessagesuchas:
“HelponclassAtominmoduleChemScript14:”
EnterSMILESData
YoucanalsotesttoverifythatChemScriptisworkingcorrectly.OnecommonuseforChemScriptistoapplyfunc-
tionstoSMILESstrings.Forexample,youcanassignaSMILESstringtoavariable.Typethefollowinglineandpress
<Enter>:
myMol = Mol.LoadData('C1CCCCC1C')
Thismessageappears:
Open molecule successfully: chemical/x-smiles
ReportingaChemicalName
Youcannowusethevariabletoreportthechemicalname.Forexample,atthecommandprompttypethelinebelow
andpressEnter:
myMol.chemicalName()
Thelinemethylcyclohexaneisreturned.
CountingAtoms
Tocounttheatomsinthestring,typethefollowinglineandpress<Enter>:
myMol.CountAtoms()
Thecommandreturnstheatomcountforthestructuredefinedwiththechemical/x-smilesformatfor'C1CCCCC1C',
whichis7.
ExitingIDLE
Toexit,typethislineandpress<Enter>:
exit()
Confirmanypromptstocompletetheexitcommand.PythonIDLEexits.
GettingStartedGuide
ChemScriptincludesaGettingStartedguidetohelpyoubegindevelopingandusingyourownscripts.Toopenthe
guide,gotoStart>AllPrograms>ChemBioOffice2014>ChemScript14.0>GettingStarted.
ThedocumentincludesnotesontheChemScriptobjectsandfunctionality,Python,andanoverviewofexamples
installed.
EditingScripts
UsingIDLEoranotherdevelopmentenvironment,youcaneithereditthescriptsprovidedwithChemBioOfficeorcre-
ateyourown.Regardlessofhowyoudevelopascript,itmustincludethesecommands:
ChemBioDraw14.0
Chapter13:ChemScript
222of315
C# TIFF: How to Rotate TIFF Using C# Code in .NET Imaging
Convert Tiff to Jpeg Images. Convert Word, Excel, PowerPoint to Tiff. Convert PDF to Tiff. Move Tiff Page Position. Rotate a Tiff Page. Extract Tiff Pages. Tiff
how to rotate one page in pdf document; rotate pdf page and save
VB.NET PDF Page Delete Library: remove PDF pages in vb.net, ASP.
XDoc.PDF ›› VB.NET PDF: Delete PDF Page. using RasterEdge.Imaging.Basic; using RasterEdge.XDoc.PDF; How to VB.NET: Delete a Single PDF Page from PDF File.
saving rotated pdf pages; pdf rotate pages and save
from sys import *
from os import *
from os.path import *
from ChemScript14 import *
Thefirstcommandimportsthepythonsystem.Thesecondandthirdcommandsimporttheoperatingsystemmod-
ules.ThelastcommandimportsalltheChemScriptfunctions.Afteryouincludethesecommandlines,howyou
developtherestofyourscriptisentirelyuptoyou.
IntroducingtheChemScriptAPI
ChemScriptincludesaChemScriptAPIreferenceguide.YoucanfindtheguideatStart>All
Programs>ChemBioOffice2014>ChemScript14.0>APIReference.Itprovideslinksandinformationforthe
ChemScriptclasses.
TheChemScriptobjectmodelcomprisestwofundamentallevelsoffunctionality,describedbelow.
ChemScriptClasses
Atthetoplevel,theAPIconsistsoffourclasses:
Atom
Chemicalelement,charge,bondstoneighboringatoms,drawingcoordinates,3Dcoordinates(ifavailable),ste-
reochemistry,etc.
Bond
Bondedatoms,bondorder,etc.
Molecule(Mol)
Achemicalconnectiontable,whichcanrepresentoneormoremolecularfragments.ThisclassalsoincludesfileI/O
capabilitiesandotheradvancedchemistryfunctionalitysuchasstereochemistry.
Reaction(Rxn)
Achemicalreactionwithoneormoresteps.
FunctionsandAlgorithms
Thesecondarylevelconsistsofthecoresetofhigh-levelfeaturesthatyoucanmodifytomeetyourspecificbusiness
needs.Someexamplesaredescribedbelow.
TemplateBasedNormalization
Enforcestandardrepresentationsoffunctionalgroupstructuresinchemicaldata.
TemplateBasedProductGeneration
Automaticgenerationofproductsfromasetofreactantsandagenericallydefinedreaction.Forexample,reactions
likethosebetweenaminesandcarboxylates.
ChemBioDraw14.0
Chapter13:ChemScript
223of315
VB.NET PDF Page Insert Library: insert pages into PDF file in vb.
PDF Pages. |. Home ›› XDoc.PDF ›› VB.NET PDF: Insert PDF Page. Professional .NET PDF control for inserting PDF page in Visual Basic .NET class application.
rotate pdf page by page; pdf expert rotate page
C# PDF Page Insert Library: insert pages into PDF file in C#.net
page processing functions, such as how to merge PDF document files by C# code, how to rotate PDF document page, how to delete PDF page using C# .NET, how to
pdf page order reverse; how to save a pdf after rotating pages
SubstructureIdentificationandMapping
Atom-by-atomcomparisonofamoleculewithasubstructure.Positivematchingprovidesanatom-by-atommapofthe
substructureatomstothoseinthemolecule.
SaltStripping
Removesaltsfromareactionbasedonapre-definedlistofsaltfragments.
StructureOrientation
Enforcestandardorientationofstructuresbasedontheestablishedorientationofacommonscaffold.
2DStructureGenerationandCleanup
UseChemBioDraw-basedalgorithmstogeneratestructurefromscratchoraftermodifyingchemicaldatausingapro-
gram.
CanonicalCodes
Generateuniqueidentifyingcodesfromachemicalstructure.
FileFormatConversion
ReadandwritefiledatausingallPerkinElmersupportedfileformats(CDX,CDXML,MOL,CHM,SKC,SMILES,
etc.).
ChemicalNameandStructureConversion1
UsetheChemBioDrawStruct=Namefeaturetogeneratestructuresfromchemicalnamesandnamesfromtheirstruc-
tures.
MolecularMechanics
OptimizemolecularstructuresusingtheMM2force-field.
TheChemScriptAPIonline
PerkinElmeralsoprovidesthedocumentationoftheAPIonline.YoucanfindtheAPIatsdk.cambridgesoft.com.
Tutorials
Weprovideseveralsamplescriptstoillustratehowyoucandevelopyourowncustomcodetomeetyourbusiness
needs.ManyofthescriptsweuseareintheChemScriptsamplesdirectory.Bydefault,thisdirectoryiswhere
ChemBioOffice2014auxillaryfilesareinstalled:
OnWindows7and8:
C:\ProgramData\CambridgeSoft\ChemOffice2014\ChemScript\Examples\
1
PremiumfunctionalitythatmaybelicensedfromPerkinElmer.
ChemBioDraw14.0
Chapter13:ChemScript
224of315
C# PDF Page Delete Library: remove PDF pages in C#.net, ASP.NET
Pages. |. Home ›› XDoc.PDF ›› C# PDF: Delete PDF Page. Demo Code: How to Delete a Single PDF Page from PDF File in C#.NET. How
how to rotate one pdf page; rotate pdf pages individually
VB.NET PDF - View PDF with WPF PDF Viewer for VB.NET
1. Anticlockwise rotation. Rotate PDF page 90 degree in anticlockwise. 2. Clockwise rotation. Rotate PDF page 90 degree in clockwise. 3. Zoom in.
how to rotate all pages in pdf in preview; how to change page orientation in pdf document
Forthesakeofbrevity,wewon’trepeatthescriptsinthismanualortrytoteachPython.However,webrieflydescribe
whatyoucandowiththecodeexamplessothatyoucanmodifyandexpanduponthemforyourownuse.Asyouread
thetutorials,youareencouragedtoviewthecodeinIDLEandedititasdesiredtoseehoweachexampleworks.For
moreonIDLE,see"GettingStarted"onpage221.
Example1:AutomatedStructureCleanup
ThissamplescriptcleansupthestructuresinmultipleChemBioDrawfilesallatthesametime.Itusesthesame
cleanupfunctionthatisinChemBioDraw.ThescriptisinthedirectoryExample.001/script.py.Thescriptreads
theCDXstructurefilesfromasourcedirectory,appliesthecleanupfeaturetoeachstructure,andwritethemodified
filestoanoutputdirectory.Theoriginalfilesremainunchanged.
Figure13.1:Thestructurecleanupscriptreadsastructurefile(left)andcreatesanew,cleanedupstructurefile(right).
ThisexampleusestheCDXMLformat.Otherformats,suchasMDLMOL,mayalsobeapplied.Youcanalsoforce
ChemScripttousespecificfileformatsforreadingandwritingdata.
Example2:CreateanSDfile
ThisexampleillustrateshowyoucancreateanSDfilefromexistingCDXMLfiles.Youcanfindthescriptat
Example.002/script.py.WebeginwithalistofCDXMLfilesthateachcontainachemicalstructure.Thelistof
filesishard-codedintotheChemScriptscript.Whenexecuted,thescriptusestheSDFileWritermethodtocreate
anSDfilethatincludesallthestructures.
Example3:CreatealistofCDXMLfiles
ThisexampleillustrateshowtoreadanSDfileandwritealistofCDXMLfiles.Youcanfindthesourcefileat
Example.003/script.py.
Example4:FilteranSDfile
ThisexampleusestheatomByAtomSearchmethodtodemonstrateasimpleapplicationofthe"atom-by-atom"sub-
structuresearchinChemScript.TheprogramreadsanSDfileandfiltersstructuresintooneoftwooutputSDfiles,
structuresthatcontainaphenylgroupandstructuresthatdon’t.Italsoillustrateshowyoucanreadchemicaldata
formattedasaSMILESstring.SeeExample.004/script.py.
Example5:ComputingCanonicalCodes
ThisexamplescriptcheckswhetheranystructuresappearinbothoftwoSDfilesbasedonthestructures’canonical
codes.TheoutputisanewSDfilewiththeduplicatestructuresexcluded.SeeExample.005/script.py.
ChemBioDraw14.0
Chapter13:ChemScript
225of315
C# WPF PDF Viewer SDK to view PDF document in C#.NET
1. Anticlockwise rotation. Rotate PDF page 90 degree in anticlockwise. 2. Clockwise rotation. Rotate PDF page 90 degree in clockwise. 3. Zoom in.
how to rotate a page in pdf and save it; how to rotate page in pdf and save
VB.NET PDF - WPF PDF Viewer for VB.NET Program
Existing PDF Pages. Page: Replace PDF Pages. Page: Move Page Position. Page: Copy, Paste PDF Pages. Page: Rotate a PDF Page. PDF Read. Text
how to rotate just one page in pdf; how to reverse page order in pdf
Thisexamplefirstcomputesthecanonicalcodeforeachstructure.Sincethecanonicalcodedoesnotvarywithdif-
ferentrepresentationsofthesamechemicalstructure,youcanuseittodeterminewhethertwostructuresarechem-
icallyequivalent.
ThisexamplealsointroducesthePythonDictionary,whichisanassociativearray.Thedictionarymapsakeytoa
value.Thedictionaryisusedtodeterminewhetheracanonicalcodehasbeenpreviouslyencountered.
ThisexampleusesanalternateloopingconstructtoreadanSDfile.
Canonicalcodesshouldneverbepermanentlystoredbecausetheirrepresentationcan
changeamongdifferentversionsofChemScript.
Example6:StructureOverlay
ThisscriptintroducestheChemScriptstructureoverlayfeature.Itusesascaffoldstructurefiletosuperimposetwo
chemicallysimilarstructures.ThescriptfirstexaminesthestructuresinanSDfilethatcontainacommonscaffold
substructure.Itthenalignsthesestructuressothattheyhavethesameorientationwithrespecttothescaffold.See
Example.006/script.py.
Note:Theoverlayfunctionalitycanalsobeusedtoalignthreedimensionalstructures.
Example7:ReactionTransformation
Thisexampledemonstratesreactiontransformation.Thismeansthatyoucandrawareactionthatdefinesatrans-
formationofamoleculeandthenapplythattransformationtoasetofstructurefiles.
AllthefilesnecessaryforthistutorialareintheExample.007directory.Thetransform1.cdxmlfileprovidesthe
reactionthatdefinesthetransformation.Theinput.sdffilecontainsallthestructuresthatwillbetransformed.
Figure13.2:Thetransformfiledefineshowthetransformationisappliedtothesourcestructures.
Thescriptsearchestheinputfileforstructuresthatcontainanitrogroup,shownasareactantinthetransformation
file.Ifastructureisfound,thescripttransformsthenitrogrouptotheformshownintheproductandcopiestheentire
structuretoanewfile.Thefigurebelowshowsoneexample.
ChemBioDraw14.0
Chapter13:ChemScript
226of315
Figure13.3:A)beforethetransformationisapplied;B)aftertransformation.
Structuresthatdon’tmeetthesearchcriteriaareignored.
Example8:Simplesaltstripping
TheprogramreadsanSDFile,identifiesandremovessaltcomponents(ifanyarepresent),andoutputstwoSDfiles.
Theoutputstructurefilecontainstheoriginalstructureswithoutthesaltcomponent,andtheoutputsaltfilecontains
thesaltcomponentsthatwerestripped,alongwithareferencetotheoriginalstructure.See
Example.008/script.py.
Note:ThisexampleusesadefaultsetofsaltsthatPerkinElmerprovides.However,youcanalsodefineacus-
tomizedsalttablethatenablesyoutodesignatewhichchemicalsareconsideredsalts.
UsefulReferences
TherearenumerousresourcesavailableforlearningPythonandC#/.NET.JustafewofthemanybooksandWeb
sitesarelistedbelow.
Books
Python
BeginningPython:FromNovicetoProfessionalbyMagnusLieHetland.
DiveintoPythonbyMarkPilgrim.
LearningPythonbyMarkLutz&DavidAscher.Thisisabeginner/intermediatelearningmanualandreference.
PythoninaNutshellbyAlexMartelli.ThisbookisabriefintroductionandgoodreferencetoPython.
C#/.NET
C#inaNutshellbyPeterDrayton,BenAlbahari,andTedNeward.
ProC#with.NET3.0byAndrewTroelsen.
C#EssentialsbyBenAlbahari,PeterDrayton,andBradMerrill.
C#3.0CookbookbyJayHilyardandStephenTeilhet.
WebSites
Python
YoucanfindmoreinformationonPythonat:http://www.python.org.ThisistheofficialPythonprogramminglanguage
site.
.NET
Forinformationon.NET,see
http://msdn.microsoft.com
ChemBioDraw14.0
Chapter13:ChemScript
227of315
QueryStructures
Aqueryisasearchforinformationthatisstoredinadatabase.IfyouhaveeversearchedtheInternetusingaWeb
browser,thenyouhaveperformedasimplequery.
Aquerystructureisaparameteryouusetosearchachemicaldatabase(thedatabasemustincludestructuresforthe
querytobeuseful).Thequerystructurecanincludebondandatompropertiesthatyouspecifytonarroworbroaden
thelistofsearchresults.Belowaretwoquerystructureexamples:
Figure14.1:Twoexamplestructurequeries.A)Theresultsincludeanyconnectedatomatthelocationspecifiedby
‘R’;B)Theresultsincludeeitherasingleordoublebondatthelocationspecifiedby‘S/D’.
Toperformaquery,youfirstdrawthequerystructureinChemBioDraw.Youthenenterthestructureinadatabase
applicationsuchasChemBioFinder.Theapplicationsearchesoneormoredatabasesthatyouspecifyandreturnsthe
queryresults.
SearchLimitations
Severalfactorsdeterminethesearchresultsthatarereturned.Togettheresultsyouexpect,youmustfirstensure
thatthestructureyoudrawaccuratelyrepresentsthequeryyouwanttoperform.Forexample,ifyourquerystructure
requiresthatnocarbonatomsinanaromaticstructurecanbepartofanyring,youarelikelytoreturnnoresultsoran
error,dependingonthequerysystemused.
Thesearchapplicationyouusecanalsoaffectyourquery.Iftheapplicationdoesnotaccuratelyinterpretyourquery
structure,orthestructuresinthedatabase,youcouldreceiveinaccurateresults.
GenericLabels
Agenericlabelrepresentsanonspecificattachment.Itcanbeeitheranunspecifiedatom,functionalgroup,orstruc-
turalfeature.Whenyouperformaquery,thequerylooksforstructuresbasedonthetypeofgenericlabelyouuseand
whereitisinthequerystructure.Recordsthatmatchthequerystructurearereturnedinthesearchresults.
Forexample,thequerystructurebelowusestheletter‘Q’toindicatethatanonhydrogen,noncarbonatommust
appearatthespecifiedlocation.
ChemBioDraw14.0
Chapter14:QueryStructures
228of315
Youcanuseothergenericlabelstoindicateothertypesofquerycriteria.ThegenericlabelsthatChemBioOfficesup-
portsarelistedbelow(allarerecognizedaschemicallysignificant).
A:Representsanynonhydrogen.
M:Representsametal.
Q:Representsanatomthatisneitherhydrogennorcarbon.
X:Representsanyhalide.
R:Unrestricted;representsoneormoreconnectedatomsofanykind.
Toaddagenericlabeltoastructure,dooneofthefollowing:
1. Double-clicktheatomtoopenatextbox,andtypeinthenickname.
2. Right-clicktheatom,pointtoInsertGenericLabelonthecontextmenu,andclickthelabelyouwishtoinserton
thesub-menu.
GenericNicknameHotkeys
Youcanassignhotkeystogenericnicknames,justlikeothernicknames.Forinformationonassigningahotkeytoa
nickname,see"CustomizingHotkeys"onpage33.
DefiningGenericNicknames
ThegenericnicknamesrecognizedaschemicallymeaningfularelistedintheGenericNicknamesfileinthe
ChemDrawItemsfolder.
Toeditthegenericnicknamefiles,opentheGenericNicknamesfileinatexteditorandmakeyourchanges.Follow
examplesinthefileforthecorrectformat.
Note:Ifyoucheckastructurethathasagenericnickname,amessagedisplaysbecausethestructurecontains
variablesubstituents.Ifyouignorethismessage,thegenericnicknamesareignored,andthechemicalformula,
mass,etc.,arereportedasiftheatomlabelcontainingthegenericnicknamewerenotselected.
Reaxys
Reaxysisaweb-basedchemicalsearchenginedesignedforsyntheticandmedicalchemists.TheReaxysdatabase
includeschemicalproperties,structures,reactionsandexperimentaldata.UsingChemDrawforReaxys®with
ChemDraw,youcandrawquerystructurestosearchtheReaxysdatabase.
ChemBioDraw14.0
Chapter14:QueryStructures
229of315
Note:FortheWindowsversion,youneedboththeReaxysStructureEditorplug-inandeithertheChemDraw
applicationorplugininstalledonyoursystem.
InadditiontoA,M,Q,X,andR,Reaxysrecognizesseveralothergenericatoms.
ToaddaReaxysgenericlabeltoastructure:
Right-clickanatom,pointtoInsertGenericLabelonthecontextmenu,pointtoReaxysandclickthelabelinthe
sub-menuyouwishtoinsert.
Thetablebelowliststhelabelsandtheirmeaning.
Labels
Meaning
AH
AnyorH
MH
MetalorH
QH
Any,exceptCarbonorH
XH
HalogenorH
G
Unspecified
GH
UnspecifiedorH
G*
Unspecified,ringclosureallowed
GH*
Unspecified,ringclosureallowedorH
ACY
Acyclic
ACH
AcyclicorH
ABC
Carbacyclic
ABH
CarbacyclicorH
AYL
Alkynyl
AYH
AlkynylorH
ALK
Alkyl
ALH
AlkylorH
AEL
Alkenyl
AEH
AlkenylorH
AHC
Heteroacyclic
AHH
HeteroacyclicorH
AOX
Alkoxy
AOH
AlkoxyorH
ChemBioDraw14.0
Chapter14:QueryStructures
230of315
Documents you may be interested
Documents you may be interested