Adapter
auto_detect_tool(external_files)
Auto-detect the external tool based on file patterns.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
external_files
|
List[str]
|
List of external tool output file paths |
required |
Returns:
| Type | Description |
|---|---|
ExternalTool
|
ExternalTool enum value based on detected patterns |
Source code in src/rnapolis/adapter.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | |
parse_external_output(file_paths, tool, structure3d)
Parse the output from an external tool (FR3D, DSSR, etc.) and convert it to BaseInteractions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_paths
|
List[str]
|
List of paths to external tool output files |
required |
tool
|
ExternalTool
|
The external tool that generated the output |
required |
structure3d
|
Structure3D
|
The 3D structure parsed from PDB/mmCIF |
required |
Returns:
| Type | Description |
|---|---|
BaseInteractions
|
BaseInteractions object containing the interactions found by the external tool |
Source code in src/rnapolis/adapter.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | |
process_external_tool_output(structure3d, external_file_paths, tool, input_file_path, find_gaps=False, decompose_pseudoknot_free=False)
Process external tool output and create a secondary structure representation.
This function can be used from other code to process external tool outputs and get a Structure2D object with the secondary structure information.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
structure3d
|
Structure3D
|
The 3D structure parsed from PDB/mmCIF |
required |
external_file_paths
|
List[str]
|
List of paths to external tool output files (empty for MAXIT) |
required |
tool
|
ExternalTool
|
The external tool that generated the output (FR3D, DSSR, etc.) |
required |
input_file_path
|
str
|
Path to the input file (used when external_file_paths is empty) |
required |
find_gaps
|
bool
|
Whether to detect gaps in the structure |
False
|
decompose_pseudoknot_free
|
bool
|
If True, structural elements are decomposed from the pseudoknot-free structure while retaining pseudoknot characters in dot-bracket strings. Pseudoknotted stems are reported separately. |
False
|
Returns:
| Type | Description |
|---|---|
Tuple[Structure2D, Mapping2D3D]
|
A tuple containing the Structure2D object and the Mapping2D3D object. |
Source code in src/rnapolis/adapter.py
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | |