Cannot execute command-line STRUCTURE software on a Linux machine
1
0
Entering edit mode
4.5 years ago
endretoth ▴ 30

Dear All,

I would like to run the command-line software called STRUCTURE on a Linux server. I downloaded the package of the Linux command-line version (without graphical front end) available with this link: https://web.stanford.edu/group/pritchardlab/structure_software/release_versions/v2.3.4/release/structure_linux_console.tar.gz

After, I extracted the file with the command tar -zxvf structure_linux_console.tar.gz. This resulted in a folder called console inside of this, the program called structure. I navigated into the folder, so I'm exactly at the place of the structure file. Then, I tried to run it two different ways: (1) simply typing structure after (2) I tried ./structure but for some reason, I cannot execute the program. I also tried to use sudo for administrative privileges but nothing. Recently, someone suggested me to run it with sh, but in this case I receive the following error: structure: 1: structure: Syntax error: word unexpected (expecting ")")

I would like to ask for the help of experienced bioinformaticians to overcome this error. I greatly appreciate any help. Please note that I'm new to using linux/unix.

Best, Thend

software error Linux Unix Structure • 2.8k views
ADD COMMENT
4
Entering edit mode

You can try installing Structure with conda, or compile from source:

wget https://web.stanford.edu/group/pritchardlab/structure_software/release_versions/v2.3.4/structure_kernel_source.tar.gz
tar -xzf structure_kernel_source.tar.gz
cd structure_kernel_source/
make
ADD REPLY
1
Entering edit mode

You will need to use ./structure while you're inside that directory, as it wont yet be in your $PATH.

You probably need to make it executable with chmod +x /path/to/structure.

Otherwise, you need to tell us how/why you cannot execute the program as there could be a myriad of different reasons.


General comments:

  • Don't blindly use sudo when you don't know what the code does.
  • Don't blindly use sh because someone told you to when you don't know what the code does (or is written in).
ADD REPLY
0
Entering edit mode

Dear Joe,

I tried: chmod +x /home/.../structure but nothing happens after I tried structure but it gives me structure: command not found after I tried ./structure but still nothing. It shows -bash: ./structure: No such file or directory

ADD REPLY
2
Entering edit mode

I can download and run the software without any issue on a Linux machine with simply ./structure. You need to show us the exact errors you're getting, the file paths you're using and so on, else we can't really help.

ADD REPLY
0
Entering edit mode

chmod +x doesn't 'visibly' do anything, it just sets the permissions on the file.

You still need to use ./structure from within the directory that the file exists.

ADD REPLY
0
Entering edit mode

I tried it that way (I was writing it in my question). I do everything in the folder where the software is. :(

ADD REPLY
1
Entering edit mode

endretoth : Which linux flavor are you using? I downloaded the pre-compiled executable from your link and had no issues getting it to run.

ADD REPLY
0
Entering edit mode

These are my commands:

xxx:~/structure/Psylvestris/oldSTR/console$ ls

extraparams  input_oldStr  mainparams  structure  structure_doc.pdf

xxx:~/structure/Psylvestris/oldSTR/console$ structure

structure: command not found

xxx:~/structure/Psylvestris/oldSTR/console$ ./structure

-bash: ./structure: No such file or directory

xxx:~/structure/Psylvestris/oldSTR/console$ sh structure

structure: 1: structure: Syntax error: word unexpected (expecting ")")

xxx:~/structure/Psylvestris/oldSTR/console$ sh ./structure

./structure: 1: ./structure: Syntax error: word unexpected (expecting ")")
ADD REPLY
1
Entering edit mode

could you show an ls -l of that folder?

ADD REPLY
0
Entering edit mode

Yes it is the following:

xxx:~/structure/Psylvestris/oldSTR/console$ ls -l

total 1044

-rwxr-xr-x 1 tendre tendre   6260 nov   20 12:59 extraparams

-rwx------ 1 tendre tendre  96029 nov   20 12:44 input_oldStr

-rwxr-xr-x 1 tendre tendre   2590 nov   20 12:56 mainparams

-rwxr-xr-x 1 tendre tendre 143870 júl   16  2012 structure

-rwxr-xr-x 1 tendre tendre 809401 júl   16  2012 structure_doc.pdf
ADD REPLY
1
Entering edit mode

can you md5sum your structure file and show us the result?

It should match 2fcb2fa0314005d681340f0496924924. It seems your error could be caused by a number of things, an incomplete download/transfer being one of them.

ADD REPLY
3
Entering edit mode
4.5 years ago
endretoth ▴ 30

Dear All,

I would like to write to all person helped to solve this problem (Joe, genomax, WouterDeCoster, h.mon). Sorry, for my slow response, unfortunately, the Biostars forum does not allow me to write more than 5 messages within 6 hours, or something like this, as a new users.)

The problem is solved, someone suggested me that compatibility between the 64bit server and 32bit Structure program cause the trouble. Thus, I tried to fix this issue by doing the following steps:

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386

This immediately fixed the problem and the Structure runs simply with ./structure

I really appreciate all of your help and patient guidance. I hope this information will be useful for others facing the same or a similar problem.

Best, Thend

PS: I don't really understand this voting system... :(

ADD COMMENT
1
Entering edit mode

Glad you solved it, the 32-bit/64-bit issue was going to be my next guess!

ADD REPLY
0
Entering edit mode

I don't really understand this voting system... :(

It is really simple. If an answer/comment is helpful, people (including you) upvote (thumbs-up only, Biostars doesn't use down-voting). If an answer resolved your question, you can mark it as accepted (well technically moderators can but we prefer that original posters do that). You are able to accept more than one answer if they all work.
Upvote|Bookmark|Accept

ADD REPLY

Login before adding your answer.

Traffic: 1485 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6