@@ -681,6 +681,7 @@ class AlignTraj(AnalysisBase):
681
681
def __init__ (self , mobile , reference , select = 'all' , filename = None ,
682
682
prefix = 'rmsfit_' , weights = None ,
683
683
tol_mass = 0.1 , match_atoms = True , strict = False , force = True , in_memory = False ,
684
+ writer_kwargs = None ,
684
685
** kwargs ):
685
686
"""Parameters
686
687
----------
@@ -720,6 +721,8 @@ def __init__(self, mobile, reference, select='all', filename=None,
720
721
verbose : bool (optional)
721
722
Set logger to show more information and show detailed progress of
722
723
the calculation if set to ``True``; the default is ``False``.
724
+ writer_kwargs : dict (optional)
725
+ kwarg dict to be passed to the constructed writer
723
726
724
727
725
728
Attributes
@@ -780,6 +783,9 @@ def __init__(self, mobile, reference, select='all', filename=None,
780
783
:attr:`rmsd` results are now stored in a
781
784
:class:`MDAnalysis.analysis.base.Results` instance.
782
785
786
+ .. versionchanged:: 2.8.0
787
+ Added ``writer_kwargs`` kwarg dict to pass to the writer
788
+
783
789
"""
784
790
select = rms .process_selection (select )
785
791
self .ref_atoms = reference .select_atoms (* select ['reference' ])
@@ -816,10 +822,12 @@ def __init__(self, mobile, reference, select='all', filename=None,
816
822
self .ref_atoms , self .mobile_atoms , tol_mass = tol_mass ,
817
823
strict = strict , match_atoms = match_atoms )
818
824
825
+ if writer_kwargs is None :
826
+ writer_kwargs = {}
819
827
# with self.filename == None (in_memory), the NullWriter is chosen
820
828
# (which just ignores input) and so only the in_memory trajectory is
821
829
# retained
822
- self ._writer = mda .Writer (self .filename , natoms )
830
+ self ._writer = mda .Writer (self .filename , natoms , ** writer_kwargs )
823
831
824
832
self ._weights = get_weights (self .ref_atoms , weights )
825
833
@@ -1661,4 +1669,4 @@ def get_atoms_byres(g, match_mask=np.logical_not(mismatch_mask)):
1661
1669
logger .error (errmsg )
1662
1670
raise SelectionError (errmsg )
1663
1671
1664
- return ag1 , ag2
1672
+ return ag1 , ag2
0 commit comments