The bioBakery help forum

Syntax errors - program code

Hi, I am very new to Python and trying to work my way around some tutorials. I cannot get your code to work no matter what I do, using both your files and my files. Python does not like the $ or the X or the b in before. Please help.

SyntaxError: invalid syntax

$ halla -x beforeotu.txt -y otugenera.txt -m spearman -o HAIIA
SyntaxError: invalid syntax

$ halla -x X_16_100.txt -y Y_16_100.txt -m spearman -o HAIIA
SyntaxError: invalid syntax

$ halla -x beforeotu.txt -y otugenera.txt -m spearman -o HAIIA
SyntaxError: invalid syntax

halla -x beforeotu.txt -y otugenera.txt -m spearman -o HAIIA
SyntaxError: invalid syntax

halla -x X_16_100.txt -y Y_16_100.txt -m spearman -o synthetic_output
SyntaxError: invalid syntax

Hi danicalea. It looks like you’re trying to run a shell command as a Python command. Try running your command in a terminal.

Thanks Andrew. I am using a Windows computer so could not do that. Have tried changing the path but that does not work either - halla is unrecognised. I have someone helping at my university and he has tried on a Mac and Google colab and is also not having any success in getting the tutorial code to work.

I have since found halla was missing about four modules and now its saying that there is an error - cannot load library

You can run HAllA from the command line in Windows using a console emulator like Cmder or Git Bash.

If you want to invoke HAllA from Python, the source definition might given some insight into the arguments that are needed. You’d want to import the halla module, then run the load() and run() methods. Sorry that I don’t have anything more helpful on this, the documentation has focused mainly on the command line version so far.

Given that error message, I think your installation of the rpy2 dependency isn’t set up properly. The most common issue I’ve seen is that rpy2 can’t find the installation of R. I suggest you look through their documentation to see if anything there is helpful.

I am having trouble installing jenkspy, and not sure why. No idea about the rpy2.

My person trying to help is also having trouble on Linux and would like to know exactly what versions of the softwares you are using - see below.

Hi Danica,

I followed the installation instruction from the halla – The Huttenhower Lab and installed the software on Linux rather than Windows, which would normally work much better. All the dependencies were installed using conda and pip. I use here Python 3.7, but I tried Python 3.9 too. Nevertheless, the problem continues as Halla is asking for the xicor package, although it was successfully installed using “pip install xicor”. See the attached screenshot.

Perhaps you could write to the developers and ask why I am still getting the error? Perhaps they could give the exact versions of packages they run Halla?

Cheers,
Konrad

You’ll need to install the R XICOR package. There’s no dependency on the Python xicor package.

Installing things with conda might also be causing problems, but hopefully the first point will fix your issue. If not then maybe @sagunmaharjann can chime in.

Getting a bit closer to it working, have installed Anaconda Navigator and the XICOR and eva package in R Studio. I am having to use the full filepath in the code, its trying to run but I am getting this error now for both my data and your data - cannot construct a dtype from an array

Could you post the input command / full output?

Hi Andrew

This is the input command below and output attached-

halla -x “C:\Users\Danica-Lea\anaconda3\otugenerabefore.txt”-y “C:\Users\Danica-Lea\anaconda3\beforeotu.txt”-m spearman -o “C:\Users\Danica-Lea\Desktop\HAIIA”

I upgraded NumPY and there is the same error.

Kind regards

This e-mail is confidential. If you are not the intended recipient you must not disclose or use the information contained within. If you have received it in error please return it to the sender via reply e-mail and delete any record of it from your system. The information contained within is not the opinion of Edith Cowan University in general and the University accepts no liability for the accuracy of the information provided.

CRICOS IPC 00279B
RTO PROVIDER 4756

Hi Andrew

It appears that there was an issue with my excel data, it has now tried to run but is trying to remove a directory for reporting, and unable to so I am looking into this.

Kind regards

This e-mail is confidential. If you are not the intended recipient you must not disclose or use the information contained within. If you have received it in error please return it to the sender via reply e-mail and delete any record of it from your system. The information contained within is not the opinion of Edith Cowan University in general and the University accepts no liability for the accuracy of the information provided.

CRICOS IPC 00279B
RTO PROVIDER 4756

Hi Danica, sorry for the slow response. I’m not sure I completely understand the issue at this point. So it’s finishing the computation steps, but when it gets to generating reports it’s not able to delete the pre-existing output directory?

If that’s the problem, you can either run your command prompt as administrator so that it has the permissions to remove directories, or you can change to a new output directory name (e.g. “tmp”, “tmp2”,…) so that it doesn’t have to delete anything.