# Command Files

  Functions to parse and interpret the content of constraint-formats-file.

  Defines

  VRNA_CMD_PARSE_HC
    #include <ViennaRNA/commands.h>

    Command parse/apply flag indicating hard constraints.

    See also

    vrna_cmd_t, vrna_file_commands_read(), vrna_file_commands_apply(), vrna_commands_apply()

  VRNA_CMD_PARSE_SC
    #include <ViennaRNA/commands.h>

    Command parse/apply flag indicating soft constraints.

    See also

    vrna_cmd_t, vrna_file_commands_read(), vrna_file_commands_apply(), vrna_commands_apply()

  VRNA_CMD_PARSE_UD
    #include <ViennaRNA/commands.h>

    Command parse/apply flag indicating unstructured domains.

    See also

    vrna_cmd_t, vrna_file_commands_read(), vrna_file_commands_apply(), vrna_commands_apply()

  VRNA_CMD_PARSE_SD
    #include <ViennaRNA/commands.h>

    Command parse/apply flag indicating structured domains.

    See also

    vrna_cmd_t, vrna_file_commands_read(), vrna_file_commands_apply(), vrna_commands_apply()

  VRNA_CMD_PARSE_DEFAULTS
    #include <ViennaRNA/commands.h>

    Command parse/apply flag indicating default set of commands.

    See also

    vrna_cmd_t, vrna_file_commands_read(), vrna_file_commands_apply(), vrna_commands_apply()

  VRNA_CMD_PARSE_SILENT
    #include <ViennaRNA/commands.h>

  Typedefs

  typedef struct vrna_command_s *vrna_cmd_t
    #include <ViennaRNA/commands.h>

    A data structure that contains commands.

  Functions

  vrna_cmd_t vrna_file_commands_read(const char *filename, unsigned int options)
    #include <ViennaRNA/commands.h>

    Extract a list of commands from a command file.

    Read a list of commands specified in the input file and return them as list of abstract commands

    SWIG Wrapper Notes:

      This function is available as global function `file_commands_read()`. See, e.g. `RNA.file_commands_read()` in the Python API .

    See also

    vrna_commands_apply(), vrna_file_commands_apply(), vrna_commands_free()

    Parameters:

      - filename – The filename

      - options – Options to limit the type of commands read from the file

    Returns:

      A list of abstract commands

  int vrna_file_commands_apply(vrna_fold_compound_t *fc, const char *filename, unsigned int options)
    #include <ViennaRNA/commands.h>

    Apply a list of commands from a command file.

    This function is a shortcut to directly parse a commands file and apply all successfully parsed commands to a vrna_fold_compound_t data structure. It is the same as:

          int                   r;
          struct vrna_command_s *cmds;

          cmds  = vrna_file_commands_read(filename, options);
          r     = vrna_commands_apply(vc, cmds, options);

          vrna_commands_free(cmds);

          return r;

    SWIG Wrapper Notes:

      This function is attached as method `file_commands_apply()` to objects of type `fold_compound`. See, e.g. `RNA.fold_compound.file_commands_apply()` in the Python API .

    Parameters:

      - fc – The vrna_fold_compound_t the command list will be applied to

      - filename – The filename

      - options – Options to limit the type of commands read from the file

    Returns:

      The number of commands successfully applied

  int vrna_commands_apply(vrna_fold_compound_t *fc, vrna_cmd_t commands, unsigned int options)
    #include <ViennaRNA/commands.h>

    Apply a list of commands to a vrna_fold_compound_t.

    SWIG Wrapper Notes:

      This function is attached as method `commands_apply()` to objects of type `fold_compound`. See, e.g. `RNA.fold_compound.commands_apply()` in the Python API .

    Parameters:

      - fc – The vrna_fold_compound_t the command list will be applied to

      - commands – The commands to apply

      - options – Options to limit the type of commands read from the file

    Returns:

      The number of commands successfully applied

  void vrna_commands_free(vrna_cmd_t commands)
    #include <ViennaRNA/commands.h>

    Free memory occupied by a list of commands.

    Release memory occupied by a list of commands

    Parameters:

      - commands – A pointer to a list of commands