number of residues in a specific chain

Member Site Forums PyRosetta PyRosetta – General number of residues in a specific chain

Viewing 1 reply thread
  • Author
    Posts
    • #2159
      Anonymous

        Dear all

        sorry for the dumb question, but how can I get the number of residues on a specific chain of a complex?

        thanks in advance

        felipet

      • #10865
        Anonymous

          Hey Felipet,

          There seems to be a few ways to do this. If you have loaded a pose as my_pose – First, you could use len(my_pose.chain_sequence( chain_id ). You could also use the chain_end and chain_begin functions from the conformation object:

          start = my_pose.conformation().chain_begin( chain_id )
          end = my_pose.conformation().chain_end( chain_id )

          and then end – start +1 to get the length.

          There are a number of chain utilities for converting to and from chain_id/char/string in core/pose/util. They should be imported with the ‘from rosetta import *’ command. Here are a few (the core::Size corresponds to the chain id ):

          bool
          has_chain(std::string const & chain, core::pose::Pose const & pose);

          bool
          has_chain(char const & chain, core::pose::Pose const & pose);

          bool
          has_chain(core::Size chain_id, core::pose::Pose const & pose);

          std::set
          get_jump_ids_from_chain_ids(std::set
          const chain_ids, core::pose::Pose const & pose);

          core::Size
          get_jump_id_from_chain_id(core::Size const & chain_id, core::pose::Pose const & pose);

          //std::set get_chain_ids(core::pose::Pose const & pose);

          core::Size
          get_chain_id_from_chain(std::string const & chain, core::pose::Pose const & pose);

          core::Size
          get_chain_id_from_chain(char const & chain, core::pose::Pose const & pose);

          utility::vector1
          get_chain_ids_from_chain(std::string const & chain, core::pose::Pose const & pose);

          utility::vector1
          get_chain_ids_from_chain(char const & chain, core::pose::Pose const & pose);

          utility::vector1
          get_chain_ids_from_chains(utility::vector1 const & chains, core::pose::Pose const & pose);

          char
          get_chain_from_chain_id(core::Size const & chain_id, core::pose::Pose const & pose);

          core::conformation::ResidueCOPs
          get_chain_residues(core::pose::Pose const & pose, core::Size chain_id);

          Hope this helps!

          -Jared

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