// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // ! This script is provided "as is" by Applied Maths. ! // ! You are free to use and modify this script for your own needs. ! // ! Redistribution or reproduction of the script is prohibited. ! // ! DISCLAIMER: ! // ! Improper use of scripts may corrupt your database. ! // ! Running this script is entirely at your own responsibility. ! // ! Applied Maths accepts no lialibility for any consequences ! // ! resulting from its use. ! // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //$DISPLAY_COMPWIN DIALOG dlg; string fieldlist,fieldsel,filename,key,st,st1,experlist,expername; integer i; FILE fp; if not(CmpIsPresent) then CmpAttach; if not(CmpIsPresent) then { message("ERROR: there is currently no comparison present"); stop; } fieldlist="Key "; for i=1 to DbGetFieldCount do fieldlist=fieldlist+DbGetFieldName(i)+" "; fieldsel="Key"; for i=1 to DbGetExperCount do if DbGetExperClass(i)="SEQ" then experlist=experlist+DbGetExperName(i)+" "; expername=experlist;expername=splitstring(expername," "); DlgAddText(dlg,"Select the field(s) you want to export",20,20,180,15); DlgAddList(dlg,fieldlist,fieldsel,20,40,180,150,"MULTI"); DlgAddText(dlg,"Select the sequence",220,20,150,15); DlgAddList(dlg,experlist,expername,220,40,150,150,"LIST"); if not(DlgShow(dlg,"Export aligned sequences",490,220)) then stop; filename=DbGetPath+"\export.txt"; if not(FileOpenWrite(fp,filename)) then { message("ERROR: unable to create export file"); stop; } for i=1 to CmpGetEntryCount do { key=CmpGetEntryKey(i); st=fieldsel; while st<>"" do { st1=splitstring(st," "); if st1="key" then FileWrite(fp,key+" "); if st1<>"key" then FileWrite(fp,DbGetField(key,st1)+" "); } FileWrite(fp,CmpSeqGet(expername,i)); FileWriteLine(fp); } FileClose(fp); execute("notepad.exe "+filename);