bioexcel / biobb_websites

0 stars 0 forks source link

Non-consecutive residue numbers in MD Analysis workflow bug #1

Closed adamhospital closed 2 years ago

adamhospital commented 2 years ago

Please modify the following function code (saveBfactor) in the MD Analysis workflow to solve this issue:

def saveBfactor(input, output, bfactors):
    # load input into BioPython structure
    structure = PDBParser(QUIET=True).get_structure('structure', input)

    # add B-factor to each structure atoms
    i = 0
    resold = ""
    for atom in structure.get_atoms():
        res = atom.get_parent().get_id()[1]
        if (res != resold):
            i=i+1
        bf = [d for d in bfactors if d['residue'] == i][0]['bfactor']
        atom.set_bfactor(bf)
        resold = res
gbayarri commented 2 years ago

I have modified this function. Please take a look to confirm that it's working properly before closing the issue.

Best.

adamhospital commented 2 years ago

Working now, thanks!