help > Running asc_to_swc from shell runs into "Could not open the file to save the neuron." error
Showing 1-4 of 4 posts
Display:
Results per page:
Jul 12, 2019  04:07 AM | Sophie Laturnus
Running asc_to_swc from shell runs into "Could not open the file to save the neuron." error
Hi there,

I have downloaded a bunch of morphological reconstructions (1000+) as .asc files and would like to convert them into .swc.
The usual converter I use (NLMorphologyConverter) can not deal with these files. I think because they are missing some annotations etc. but Vaa3D (v3.2) outputs nice swc's when I convert the cells via the GUI.

Now, since it is 1000+ cells, I'd like to automate the process using a script but when I run

sudo ./Vaa3D_Ubuntu_64bit_v3.200/start_vaa3d.sh -x convert_Neurolucida_ASC_file_to_SWC -f asc_to_swc -p ./Desktop/morph/sm090918b1-3_idA_-_Scale_x1.000_y1.025_z1.000.asc -o ./Desktop/morph/sm090918b1-3_idA_-_Scale_x1.000_y1.025_z1.000.swc

I get the following output

[./vaa3d]
[-x]
[convert_Neurolucida_ASC_file_to_SWC]
[-f]
[asc_to_swc]
[-p]
[./Desktop/morph/sm090918b1-3_idA_-_Scale_x1.000_y1.025_z1.000.asc]
[-o]
[./Desktop/morph/sm090918b1-3_idA_-_Scale_x1.000_y1.025_z1.000.swc]
>>key ... -x
call plugin ... convert_Neurolucida_ASC_file_to_SWC
>>key ... -f
call plugin function ... asc_to_swc
>>key ... -p
>>key ... -o
Searching in ./plugins ......
Searching ./plugins done.
Current canonical path = [convert_Neurolucida_ASC_file_to_SWC]
Searching in ./plugins ......
Searching ./plugins done.
plugins
callPluginFunc fullpath: "/gpfs01/berens/user/slaturnus/Vaa3D_Ubuntu_64bit_v3.200/plugins/data_IO/convert_Neurolucida_ASC_file_to_SWC/libconvert_Neurolucida_ASC_file_to_SWC.so"
Could not open the file to save the neuron.
**** the plugin preprocessing takes [ 2320 milliseconds]

So it seems it can find the input and plugin fine but for some reason it does not save the neuron. Have you encountered this problem before?
Do you know what is going wrong?
Has the syntax of the command changed?

Update: It seems that I have this problem generally as I can also not convert cells that the NLMorphology has no problems with.

I attached the two files that I tested.

Thanks in advance.
All the best,
Sophie
Jul 12, 2019  05:07 AM | Linus Manubens-Gil - CRG
RE: Running asc_to_swc from shell runs into "Could not open the file to save the neuron." error
Dear Sophie, 

I have just done some tests with my own ASC files.
To me it seems it can be a problem with the path. Are you sure the path to the ASC file is correctly specified?
Also, I could not see the attached files in your original post. If you can post them in a reply I can test with your files also.

With best regards,

Linus Manubens-Gil
Jul 12, 2019  07:07 AM | Sophie Laturnus
RE: Running asc_to_swc from shell runs into "Could not open the file to save the neuron." error
Dear Linus,

thanks for the quick response!

I attached the two files I've been working with.

I also noticed that the plugin seems to have troubles with spaces in the filename, that is why I put them into the Desktop folder and one can see that the input and output are read in correctly. Or do you mean that the input path needs to be relative to the Vaa3D location?

Best regards,
Sophie
Attachment: test_asc_files.zip
Jul 12, 2019  07:07 AM | Sophie Laturnus
RE: Running asc_to_swc from shell runs into "Could not open the file to save the neuron." error
Ha, you are right!
The input and output folders need to be either absolute or relative to the location of the Vaa3D folder.

Thanks for pointing that out. That was easy enough.

Update: So this is the command that worked for me:

sudo ./Vaa3D_Ubuntu_64bit_v3.200/start_vaa3d.sh -x convert_Neurolucida_ASC_file_to_SWC -f asc_to_swc -p ../Desktop/morph/C010306C.ASC -o ../Desktop/morph/C010306.swc

All the best,
Sophie