@@ -41,7 +41,6 @@ export interface ProteinViewerProps {
4141 showSurface : boolean ;
4242 showLigands ?: boolean ; // Optional, defaults to true
4343 showIons ?: boolean ; // New prop
44- showInteractions ?: boolean ; // Show H-bonds and interactions
4544 coloring : ColoringType ;
4645 palette : ColorPalette ;
4746 backgroundColor : string ;
@@ -119,7 +118,6 @@ export const ProteinViewer = forwardRef<ProteinViewerRef, ProteinViewerProps>(({
119118 showSurface = false ,
120119 showLigands = false ,
121120 showIons = false ,
122- showInteractions = false ,
123121 isSpinning = false ,
124122 isMeasurementMode = false ,
125123 measurements,
@@ -1856,72 +1854,9 @@ export const ProteinViewer = forwardRef<ProteinViewerRef, ProteinViewerProps>(({
18561854 }
18571855 } ;
18581856
1859- // Update Interactions (H-bonds, Salt bridges, Disulfide bonds)
1860- const updateInteractions = ( ) => {
1861- const component = componentRef . current ;
1862- if ( ! component || ! showInteractions ) {
1863- // Remove existing interaction representations
1864- if ( component ) {
1865- component . removeRepresentation ( component . reprList . filter ( ( r : any ) => r . name && r . name . startsWith ( 'interaction_' ) ) ) ;
1866- }
1867- return ;
1868- }
1869-
1870- try {
1871- // Remove old interaction reps
1872- component . reprList . filter ( ( r : any ) => r . name && r . name . startsWith ( 'interaction_' ) ) . forEach ( ( r : any ) => component . removeRepresentation ( r ) ) ;
1873-
1874-
1875- // 1. Hydrogen Bonds (Backbone N-H...O=C)
1876- // Using distance representation for atoms within H-bond distance
1877- component . addRepresentation ( 'distance' , {
1878- atomPair : [
1879- [ 'protein and .N' , 'protein and .O' ] ,
1880- ] ,
1881- labelVisible : false ,
1882- color : 'lightblue' ,
1883- linewidth : 1 ,
1884- opacity : 0.6 ,
1885- name : 'interaction_hbond' ,
1886- maxDistance : 3.5 , // Typical H-bond distance
1887- } ) ;
1888-
1889- // 2. Salt Bridges (Charged residues)
1890- // Positive: ARG, LYS; Negative: ASP, GLU
1891- component . addRepresentation ( 'distance' , {
1892- atomPair : [
1893- [ '( ARG or LYS ) and ( .NH* or .NZ )' , '( ASP or GLU ) and ( .OD* or .OE* )' ] ,
1894- ] ,
1895- labelVisible : false ,
1896- color : 'orange' ,
1897- linewidth : 2 ,
1898- opacity : 0.7 ,
1899- name : 'interaction_saltbridge' ,
1900- maxDistance : 4.0 , // Salt bridge cutoff
1901- } ) ;
1902-
1903- // 3. Disulfide Bonds (CYS SG-SG)
1904- component . addRepresentation ( 'distance' , {
1905- atomPair : [
1906- [ 'CYS and .SG' , 'CYS and .SG' ] ,
1907- ] ,
1908- labelVisible : false ,
1909- color : 'yellow' ,
1910- linewidth : 3 ,
1911- opacity : 0.9 ,
1912- name : 'interaction_disulfide' ,
1913- maxDistance : 2.5 , // Disulfide bond distance
1914- } ) ;
1915-
1916- } catch ( e ) {
1917- console . warn ( "Error adding interactions:" , e ) ;
1918- }
1919- } ;
1920-
19211857 useEffect ( ( ) => {
19221858 updateRepresentation ( ) ;
1923- updateInteractions ( ) ;
1924- } , [ representation , coloring , customColors , showSurface , showLigands , showIons , colorPalette , showInteractions ] ) ;
1859+ } , [ representation , coloring , customColors , showSurface , showLigands , showIons , colorPalette ] ) ;
19251860
19261861 useEffect ( ( ) => {
19271862 if ( stageRef . current ) {
0 commit comments