Trajectory: combine two separate slices into one for other analysis

17 views
Skip to first unread message

Demian Riccardi

unread,
Jun 13, 2022, 4:59:00 PMJun 13
to MDnalysis discussion
Hello,

is there a way to combine slices of trajectory without writing a new trajectory (to memory or a file)?  

to make question clearer, from examples in the docs combining multiple trajectories into a universe is straightforward:

u = mda.Universe(
                             "some.pdb",
                             "some.1.dcd",
                             "some.2.dcd"
                            ) 

but I didn't find anything about appending trajectories to a universe (i saw load_new clobbers to old).  can you do something like this to combine slices?

u_1 = mda.Universe(
                             "some.pdb",
                             "some.1.dcd"
                            ) 

u_2 = mda.Universe(
                             "some.pdb",
                             "some.2.dcd"
                            ) 

u_slice1_slice2 = mda.Universe("some.pdb", u_1.trajectory[ 30:59], u_2.trajectory[ 1:100])

Thank you for your help!

Demian

Demian Riccardi

unread,
Jun 21, 2022, 10:47:59 AMJun 21
to MDnalysis discussion
I should have included the word Ensemble in my OP

I see some related posts with reference to this open pull request:

https://github.com/MDAnalysis/mdanalysis/pull/2664

Oliver Beckstein

unread,
Jun 21, 2022, 10:56:28 AMJun 21
to mdnalysis-...@googlegroups.com
Hi Damian,

As far as I know, we don’t have “append” functionality built in. 


You can also open an issue for the functionality.

Sorry to be not more helpful. 

Oliver 

Am 6/21/22 um 07:48 schrieb Demian Riccardi <demianr...@gmail.com>:


--
You received this message because you are subscribed to the Google Groups "MDnalysis discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mdnalysis-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mdnalysis-discussion/909b2a1e-b3d1-4c66-98e2-7a1fd7de7021n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages