I would like to load a residue type from a string of a params file and not a filename.
I can generate a mutable residue type, but get stuck there:
pose = pyrosetta.rosetta.core.pose.Pose() rts = pose.residue_type_set_for_pose() # topo : str akin to doing topo = open('XXX.params').read() buffer = pyrosetta.rosetta.std.stringbuf(topo) stream = pyrosetta.rosetta.std.istream(buffer) new = pyrosetta.rosetta.core.chemical.read_topology_file(stream, 'XXX', rts) # no idea what the second argument does
The `new` residue type is not included in rts as proven by `rts.name_map( 'XXX' )` and that is where I go stuck.
I cannot seem to add the new residue type to an residue type set. These appear to be frozen sets, with no add, append, extend, push etc. `
pyrosetta.rosetta.core.chemical.ResidueTypeSetCache` seems promising, but it is unclear to me how to make that a `ResidueTypeSet` from it that can be fed into pose.
The `new` residue type is a `pyrosetta.rosetta.core.chemical.MutableResidueType` and not a `pyrosetta.rosetta.core.chemical.ResidueType`. The former does not inherit the latter —how does one convert the latter to the former?
This is obviously a minor problem as I current write to the params string to disk, read it and delete it. But I have stumbled across this issue three times —the testing method in my RDKit to Params module, in an internal webserver (with uploaded params) and in a high throughput fragment screen module— so as it seems like something simple I thought I'd best ask! Thanks!