[PyMOL] loading a file whose name is stored in a variable
Hi there, If the base name of my file is stored in a variable, how can I load the file using the variable? Eg., My filename is "File10.pdb" and I have, X = File10 I tried loading it using, cmd.load ( X+".pdb", X), but it doesn't seem to work. Sorry for posting a very basic question. Thanks, Subha -- Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot___ PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net) Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Re: [PyMOL] loading a file whose name is stored in a variable
Is there an error output? I could see it not working if File10 is not located in the present working directory. If you are running the script by using the load command in pymol you can type pwd or cmd.pwd() on the input line to see the present working directory. The best bet to fix the problem is to prefix the absolute path to the directory with the pdb files. Like so: cmd.load(‘/home/me/pdbs/‘ + X + ‘.pdb’, x) Alternatively you can use the cd (change directory) command to move pymol’s pwd to the directory containing the pdbs, then you can run the load myscript.py command. Regards, Gabriel Marques > On Oct 20, 2016, at 1:06 PM, Subha K wrote: > > Hi there, > > If the base name of my file is stored in a variable, how can I load the file > using the variable? > > Eg., My filename is "File10.pdb" > and I have, X = File10 > > I tried loading it using, > cmd.load ( X+".pdb", X), but it doesn't seem to work. > > Sorry for posting a very basic question. > > Thanks, > Subha > > -- > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! > http://sdm.link/slashdot___ > PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net) > Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users > Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net -- Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot ___ PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net) Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Re: [PyMOL] loading a file whose name is stored in a variable
Hi Gabriel, Thanks for that suggestion. You are correct, the file is missing, but I don't understand why my previous shutil.copy command is not working. Thanks, Subha On Thu, Oct 20, 2016 at 11:38 AM, Gabriel Marques < gabriel.marq...@schrodinger.com> wrote: > Is there an error output? I could see it not working if File10 is not > located in the present working directory. If you are running the script by > using the load command in pymol you can type pwd or cmd.pwd() on the input > line to see the present working directory. The best bet to fix the problem > is to prefix the absolute path to the directory with the pdb files. Like so: > > cmd.load(‘/home/me/pdbs/‘ + X + ‘.pdb’, x) > > Alternatively you can use the cd (change directory) command to move > pymol’s pwd to the directory containing the pdbs, then you can run the load > myscript.py command. > > Regards, > Gabriel Marques > > > > On Oct 20, 2016, at 1:06 PM, Subha K wrote: > > > > Hi there, > > > > If the base name of my file is stored in a variable, how can I load the > file using the variable? > > > > Eg., My filename is "File10.pdb" > > and I have, X = File10 > > > > I tried loading it using, > > cmd.load ( X+".pdb", X), but it doesn't seem to work. > > > > Sorry for posting a very basic question. > > > > Thanks, > > Subha > > > > > -- > > Check out the vibrant tech community on one of the world's most > > engaging tech sites, SlashDot.org! http://sdm.link/slashdot__ > _ > > PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net) > > Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users > > Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net > > -- Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot___ PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net) Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
[PyMOL] Pair_fit syntax
Hi there, Could somebody please help me with the correct syntax for pair fit? I tried this, but this doesn't work. pairfit (obj2 and resi 256-510), (onj1 and resi 1-255), [(obj2 and resi 1-255), (obj1 and resi 256-510), [(obj2 and resi 766-1020), (obj1 and resi 511-765), [(obj2 and resi 511-765), (obj1 and resi 766-1020)]]] Thanks, Subha -- Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot___ PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net) Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net