Skip to content

Nucleic acid residues name truncated in WatsonCrickDist #5360

@mattiabondanza

Description

@mattiabondanza

Expected behavior

If a_name, c_name etc. arguments are passed as residue names in class initialization, they should be recognized as whole during the analysis, and not assumed to be single-letter.

Actual behavior

Everything except the first letter of the residuename from the groups passed in input is discarded.

Code to reproduce the behavior

from MDAnalysis.analysis import nucleicacids
  wcdist = nucleicacids.WatsonCrickDist(listA, listB, 
                                        a_name='DA', 
                                        c_name='DC',
                                        g_name='DG',
                                        t_name='DT' )
....

My MD for some reasons use this DA DC etc names. for nucleic residues.

Current version of MDAnalysis

MDAnalysis 2.10 on Python 3.13

Proposed solution

In my opinion it should be safe to change resname[0] in resname in lines:

if pair[0].resname[0] in pyrimidines:

elif pair[0].resname[0] in purines:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions