Hi Hai,
It works like a charm, thank you very much!
On Thu, Sep 21, 2017 at 2:33 PM, Hai Nguyen <nhai.qn.gmail.com> wrote:
> hi, try to specify dtype='dict'
>
> In [4]: pt.radgyr(traj, mask='.CA tensor', dtype='dict')
>
> Out[4]:
>
> OrderedDict([('RoG_00000',
>
> array([ 8.10916061, 7.7643485 , 8.09693108, ...,
> 6.38061648,
>
> 6.24139008, 6.48994552])),
>
> ('RoG_00000[Tensor]',
>
> array([[ 5.12036852, 49.83322051, 10.8048967 ],
>
> [ 5.64622381, 48.2239143 , 6.41496946],
>
> [ 5.11853422, 54.45380463, 5.98795407],
>
> ...,
>
> [ 11.75586745, 17.82494893, 11.13145023],
>
> [ 11.66407102, 17.60610764, 9.68477152],
>
> [ 12.31941738, 20.41890689, 9.38106854]]))])
>
>
> Hai
>
> On Thu, Sep 21, 2017 at 7:29 AM, Domenico Marson <domenico87.gmail.com>
> wrote:
>
> > Thanks Hai,
> >
> > Unfortunately the command isn't working. I paste here the error message I
> > get:
> >
> > gyr = pt.radgyr(traj=traj, mask=":8P3,8FP,8CP tensor")
> > /Users/domenico/amber16/lib/python2.7/site-packages/
> > pytraj/utils/decorators.pyc
> > in inner(*args, **kwd)
> > 9 .wraps(f)
> > 10 def inner(*args, **kwd):
> > ---> 11 return f(*args, **kwd)
> > 12
> > 13 inner._is_parallelizable = True
> > /Users/domenico/amber16/lib/python2.7/site-packages/
> > pytraj/utils/get_common_objects.pyc
> > in inner(*args, **kwargs)
> > 304 except IndexError:
> > 305 args.append(mask)
> > --> 306 return f(*args, **kwargs)
> > 307
> > 308 inner._is_super_dispatched = True
> > /Users/domenico/amber16/lib/python2.7/site-packages/
> pytraj/all_actions.pyc
> > in radgyr(traj, mask, top, nomax, frame_indices, dtype)
> > 670 command = " ".join((mask, nomax_))
> > 671 c_dslist, _ = do_action(traj, command,
> c_action.Action_Radgyr)
> > --> 672 return get_data_from_dtype(c_dslist, dtype)
> > 673
> > 674
> > /Users/domenico/amber16/lib/python2.7/site-packages/
> > pytraj/utils/get_common_objects.pyc
> > in get_data_from_dtype(d0, dtype)
> > 68 return DSL(d0)
> > 69 elif dtype == 'ndarray':
> > ---> 70 return d0.to_ndarray()
> > 71 elif dtype == 'dict':
> > 72 return d0.to_dict()
> > pytraj/datasets/c_datasetlist.pyx in
> > pytraj.datasets.c_datasetlist.DatasetList.to_ndarray
> > (pytraj/datasets/c_datasetlist.cpp:11851)()
> >
> > ValueError: don't know how to convert to ndarray
> >
> >
> >
> >
> > On Tue, Sep 19, 2017 at 12:18 PM, Domenico Marson <domenico87.gmail.com>
> > wrote:
> >
> > > Hello,
> > > I'm really glad you have developed pytraj, it has positively changed
> the
> > > processing of my trajectories.
> > >
> > > In cpptraj it is possible to obtain the gyration tensor of a selection
> > > simply giving the appropriate option to the "radgyr" command. I'm
> trying
> > to
> > > achieve the same thing in pytraj, but I'm not able to find any way of
> > doing
> > > it... Am I missing something or it's an option not implemented? Can
> > someone
> > > point me in the right direction?
> > >
> > > Many thanks for your help,
> > >
> > > Regards,
> > > Domenico.
> > >
> > > --
> > > *Domenico Marson, Ph.D.*
> > > Department of Engineering and Architecture (DEA) Postdoctoral Fellow
> > > Molecular Simulation Engineering (MOSE) Laboratory
> > >
> > > University of Trieste
> > >
> > > Skype: domenicomars
> > >
> >
> >
> >
> > --
> > *Domenico Marson, Ph.D.*
> > Department of Engineering and Architecture (DEA) Postdoctoral Fellow
> > Molecular Simulation Engineering (MOSE) Laboratory
> >
> > University of Trieste
> >
> > Skype: domenicomars
> > _______________________________________________
> > AMBER mailing list
> > AMBER.ambermd.org
> > http://lists.ambermd.org/mailman/listinfo/amber
> >
> _______________________________________________
> AMBER mailing list
> AMBER.ambermd.org
> http://lists.ambermd.org/mailman/listinfo/amber
>
--
*Domenico Marson, Ph.D.*
Department of Engineering and Architecture (DEA) Postdoctoral Fellow
Molecular Simulation Engineering (MOSE) Laboratory
University of Trieste
Skype: domenicomars
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Thu Sep 21 2017 - 07:00:02 PDT