Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'Namespace' object has no attribute 'outCsvFile' and not plots #5

Open
stephaneabel opened this issue Dec 18, 2019 · 7 comments

Comments

@stephaneabel
Copy link

stephaneabel commented Dec 18, 2019

HI all

I have the data from gmx_clusterByFeatures with the following commands bot in a bash script

/ccc/work/cont003/drf/abel01/gmx_clusterByFeatures_Cobalt_suppapp/install_noMPI/bin/gmx_clusterByFeatures hole -f /ccc/store/cont003/drf/abel01/MDs_GENCI_2017/GrA_65SDS_Micelle_CHARMM36_TIP3P_rep2/XTC/1JNO_GrA_65SDS_Micelle_CHARMM36_TIP3P_rep2_Along_Z_Axis_Rotated_afterFit_Center.xtc -s 1JNO_GrA_65SDS_Micelle_CHARMM36_TIP3P_rep2_fake_reoriented.tpr -n System.ndx -o 1JNO_GrA_65SDS_Micelle_CHARMM36_TIP3P_rep2_hole_radius_along_Z.dat -pdb 1JNO_GrA_65SDS_Micelle_CHARMM36_TIP3P_rep2_hole_sphpdb.pdb -b 229000 -e 230000 -fit -sample 0.5 -cvect 0 0 1 -rad bondi

And I would like to obtain and image of the results so I use the following command

/ccc/work/cont003/drf/abel01/gmx_clusterByFeatures_Cobalt_suppapp/install_noMPI/bin/gmx_clusterByFeatures holeplot -i 1JNO_GrA_65SDS_Micelle_CHARMM36_TIP3P_rep2_hole_radius_along_Z.dat -csv 1JNO_GrA_65SDS_Micelle_CHARMM36_TIP3P_rep2_hole_radius_along_Z.csv -xmin 0 -xmax 15 -ax Z -resplot -b 229000 -e 230000 -ymin 0 -ymax 15 --output 1JNO_GrA_65SDS_Micelle_CHARMM36_TIP3P_rep2_hole_radius_along_Z.pdf -fs 14 -dpi 300 -rlsize 10

But I obtain the error and no pdf file is generated
Traceback (most recent call last):
File "/ccc/work/cont003/drf/abel01/gmx_clusterByFeatures_Cobalt_suppapp/install_noMPI/bin/gmx_clusterByFeatures", line 8, in
gmx_clusterByFeatures.main.main()
File "/ccc/work/cont003/drf/abel01/gmx_clusterByFeatures_Cobalt_suppapp/gmx_clusterByFeatures-master/gmx_clusterByFeatures/main.py", line 79, in main
holeplot.main()
File "/ccc/work/cont003/drf/abel01/gmx_clusterByFeatures_Cobalt_suppapp/gmx_clusterByFeatures-master/gmx_clusterByFeatures/holeplot.py", line 170, in main
holeProcessor.plot_radius_residues(outputFile, csvfile=args.outCsvFile, violinplot=args.violinplot,
AttributeError: 'Namespace' object has no attribute 'outCsvFile'

See also the file attached.

Could you help me to resolve this problem

Thank you
GrA_SDS_hole.4602493e.TXT

@rjdkmr
Copy link
Owner

rjdkmr commented Dec 18, 2019

This is a bug in code. I will look into it. You may use without csvfile as output for meantime. It will anyway print the values on display terminal.

You have not used either -cpoint or -catmid with hole command. It will use COM of radius group. And use -pdb option for only one frame to check whether cavity is identified correctly.

@stephaneabel
Copy link
Author

Thank you Dr Kumar

You have not used either -cpoint or -catmid with hole command. It will use COM of radius group. And use -pdb option for only one frame to check whether cavity is identified correctly.
OK I have used these options in my calculations.

But I still have a problem to obtain the average radius of the channel for plotting the pore lining surface as for instance in figure 3A in the following paper (10.1080/19336950.2017.1306163)

Do you have an idea when the bug in the "holeplot.py" will be corrected ?

Thanks again

Stéphane

@rjdkmr
Copy link
Owner

rjdkmr commented Feb 21, 2020

To make surface for average-radius, here is a link which could help: http://www.holeprogram.org/doc/index.html#_producing_a_colored_dot_surface_and_visualizing_in_vmd. You can use pdb file obtained from -pdb option in place of hole_out.sph in the above link. I do not know how average value can be visualized as sph (or pdb) file generated for each frame. You may take a pdb file and replace manually all radius value with average value and then procedures given in above link might work for visualization of average radius.

I will try to correct csvfile problem in this weekend.

@rjdkmr
Copy link
Owner

rjdkmr commented Feb 21, 2020

You may also try to correct the csvfile error as follows:
Open holeplot.py file and go to line no. 204 and add dest="outCsvFile" as shown below:

parser.add_argument('-csv', '--out-csv', action='store', dest="outCsvFile",
                        type=str, metavar='output.csv', 
                        help=outCsvFileHelp)

It should work after this correction.

@stephaneabel
Copy link
Author

stephaneabel commented Feb 21, 2020

Thank you for your response.
With the help of the information provided in the link your suggested I was able to resolve the my problem and output the average lining surface

@stephaneabel
Copy link
Author

stephaneabel commented Feb 21, 2020

You may also try to correct the csvfile error as follows:
Open holeplot.py file and go to line no. 204 and add dest="outCsvFile" as shown below:

parser.add_argument('-csv', '--out-csv', action='store', dest="outCsvFile",
                        type=str, metavar='output.csv', 
                        help=outCsvFileHelp)

It should work after this correction.
After the modification, the holeplot program seems to work but crash before to finish the calculation with the following error (see also the file attached):


abel@is154919:~/MDs_GramicidinA/GrA_65SDS_Water_rep1_2/Hole_Analysis$ ./Do_HolePlot_Analysis.bash

Reading file : 1JNO_GrA_65SDS_Micelle_CHARMM36_TIP3P_rep2_hole_radius_along_Z.dat
Reading frame 0 at time 200000.000
Maximum axis range is: (0.000 to 15.000)
Reading frame 3000 at time 215075.000
Finishid reading.... Total number of frame read = 3895
After removing axis points with any missing data:

Axis Mean radius Std. deviation



Traceback (most recent call last):
File "/gmx_clusterByFeatures/install_noMPI/bin/gmx_clusterByFeatures", line 8, in
gmx_clusterByFeatures.main.main()
File "/home/abel/gmx_clusterByFeatures/gmx_clusterByFeatures/main.py", line 79, in main
holeplot.main()
File "/home/abel/gmx_clusterByFeatures/gmx_clusterByFeatures/holeplot.py", line 173, in main
rlabelsize=args.rlabelsize, dpi=args.dpi)
File "/home/abel/gmx_clusterByFeatures/gmx_clusterByFeatures/holeOutputProcessor.py", line 380, in plot_radius_residues
ax1.plot(self.axis_value, self.average.values(), '-r')
File "/usr/local/lib/python3.6/dist-packages/matplotlib/axes/_axes.py", line 1665, in plot
lines = [*self._get_lines(*args, data=data, **kwargs)]
File "/usr/local/lib/python3.6/dist-packages/matplotlib/axes/_base.py", line 225, in call
yield from self._plot_args(this, kwargs)
File "/usr/local/lib/python3.6/dist-packages/matplotlib/axes/_base.py", line 391, in _plot_args
x, y = self._xy_from_xy(x, y)
File "/usr/local/lib/python3.6/dist-packages/matplotlib/axes/_base.py", line 270, in _xy_from_xy
"have shapes {} and {}".format(x.shape, y.shape))
ValueError: x and y must have same first dimension, but have shapes (0,) and (1,)


The command I used
"$MYSOURCE"/gmx_clusterByFeatures holeplot -i my_radius_along_Z.dat -xmin 0 -xmax 15 -ax Z -endrad 5.0 -do 90 --out-csv output.csv -resplot -b 200000 -e 230000 -ymin 0 -ymax 15 --output my_radius_radius_along_Z.pdf -fs 14 -dpi 300 -rlsize 1

Thanks again
error.txt

@stephaneabel
Copy link
Author

Re Hello
I have finally resolved the problem mentioned above and obtained the *csv and *.png file I want with the following command:
"$MYSOURCE"/gmx_clusterByFeatures holeplot -i MYRAD_radius_along_Z.dat -ax Z -endrad 5.0 -do 90 -vplot --out-csv MYRAD_radius_along_Z_Holeplot.csv --residues-plot -rfreq 50 -b 200000 -e 300000 --output MYRAD_radius_along_Z_Holeplot.png -gap 1 -fs 14 -dpi 300 -rlsize 10 -wd 8 -ht 8

"$MYSOURCE"/gmx_clusterByFeatures holeplot -i my_radius_along_Z.dat -xmin 0 -endrad 5.0 -do 90 --out-csv output.csv -resplot -b 200000 -e 230000 -ymin 0 -ymax 15 --output my_radius_radius_along_Z.pdf -fs 14 -dpi 300 -rlsize 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants