Output several poses in a silent file

Member Site Forums PyRosetta PyRosetta – General Output several poses in a silent file

  • This topic has 1 reply, 2 voices, and was last updated 6 years ago by Anonymous.
Viewing 1 reply thread
  • Author
    Posts
    • #2876
      Anonymous

        Hi,

        If I have a list of poses, how can I go about writing a single silent file that contains these poses?  I see there’s a SilentFilePoseInputStream class, but I can’t find a way to output in silent format.  Can someone point me to those functions?

         

        Thanks in advance.

      • #14532
        Anonymous

          I was having the same question as you and I found some half answer lying around as a comment for another problem. I will paste a very raw code I managed to put together that actually can work for what you want:


          silentOptions = core.io.silent.SilentFileOptions()
          silentOptions.in_fullatom(True)
          silentFile = core.io.silent.SilentFileData(silentOptions)
          for pose in poses:
              silentStruct = core.io.silent.BinarySilentStruct(silentOptions,pose)
              silentFile.add_structure(silentStruct)
          silentFile.write_all('silent.out')

          Of course you can play with some options (e.g. tags) to make it more elegant. 

      Viewing 1 reply thread
      • You must be logged in to reply to this topic.