RosettaCommons / RFdiffusion

Code for running RFdiffusion
Other
1.72k stars 336 forks source link

Issue with controlling motif scaffold length? #221

Open luiswyss opened 6 months ago

luiswyss commented 6 months ago

I'm trying to generate some scaffolds with constraints on their length and I am running into issues.

The readme suggests using contigmap.length=55-55 and 'contigmap.contigs=[5-15/A10-25/30-40]' (with adapted numbers) to achieve this. However passing both contigmap.length and contigmap.contigs to the inference script returns the following error:

Contig string incompatible with --length range

Indeed, in the example for motif scaffolding provided the length parameter is not used:

../scripts/run_inference.py inference.output_prefix=example_outputs/design_motifscaffolding inference.input_pdb=input_pdbs/5TPN.pdb 'contigmap.contigs=[10-40/A163-181/10-40]' inference.num_designs=10

Any help on how motif scaffolds of specified length can be generated would be much appreciated.

Edit: Removed some issue that I was able to fix myself.

roccomoretti commented 1 week ago

The way contigmap.length works is that the standard random length generation is applied, and the resultant length is checked against the allowed length range. If the generated length is outside the allowed length range, then the random sampling is repeated for the whole contigmap. This is repeated until a length which fits is generated. If over 100,000 different random samples are made and none of them work, then you get the error message you observed.

I'm guessing the "adapted numbers" you've provided in your contigmap generates a minimum or maximum length which means that the randomly sampled lengths always fall outside the provided contigmap.length range.