[BioPython] os.system problem with clustalw

Emanuel Hey jodyhey at yahoo.com
Wed Jul 25 13:39:43 UTC 2007


Thanks much for responding

ok,  I had no idea Clustalw was so particular about
its  command line flags.

I was not using Bio.Clustalw to build the command line
because I could not get that to work either. 

for example this does not work,  for reasons that are
obscure to me. 

>>> faa_filename =
'C:\\temp\\pythonplay\\hcgplay\\data.faa'
>>> cline = MultipleAlignCL(faa_filename)
>>> align = do_alignment(cline)

Thanks

jhey
--- Peter <biopython at maubp.freeserve.co.uk> wrote:

> Emanuel Hey wrote:
> > If I have clustalw.exe in the current directory
> then I
> > should be able to execute just using
> > 
> >>>> os.sytem('clustalw ' + 'data.faa')
> > 
> > Indeed this works fine
> 
> Yes, and if you try this at the windows command
> prompt it also works:
> 
> clustalw data.faa
> 
> or:
> 
> clustalw.exe data.faa
> 
> > However if I give it the full path
> >>>> os.system('clustalw ' +
> > 'C:\temp\pythonplay\hcgplay\data.faa')
> 
> That should fail due to the way python uses slashes
> as escape 
> characters, so \t means a tab for example.
> 
> > or
> >>>> os.system('clustalw ' +
> > 'C:\\temp\\pythonplay\\hcgplay\\data.faa')
> > 
> > then the clustalw run crashes and returns 
>  > Error: unknown option
>  > /-INFILE=C:\temp\pythonplay\hcgplay\data.faa
> 
> Its not crashing, its just returning with an error
> message.
> 
> You are not dealing with a Biopython or even a
> python problem here - you 
> are simply (but understandably) having trouble with
> the clustalw command 
> line options.
> 
> Notice that clustalw.exe will tolerate this:
> 
> clustalw.exe data.faa
> 
> as shorthand for:
> 
> clustalw.exe /infile=data.faa
> 
> However, for some reason it does not seem to work
> with full paths like this:
> 
> clustalw.exe C:\temp\pythonplay\hcgplay\data.faa
> 
> You have to be very explicit:
> 
> clustalw.exe
> /infile=C:\temp\pythonplay\hcgplay\data.faa
> 
> This may be a (windows only?) bug in clustalw. Its
> certainly not 
> intuitive as is.
> 
> Peter
> 
> P.S. Did you not like using Bio.Clustalw to build
> the command line 
> string for you?
> 
> 



       
____________________________________________________________________________________
Got a little couch potato? 
Check out fun summer activities for kids.
http://search.yahoo.com/search?fr=oni_on_mail&p=summer+activities+for+kids&cs=bz 



More information about the Biopython mailing list