iCn3D |  |

### What is iCn3D Structure Viewer?

"I see in 3D" (iCn3D) Structure Viewer is not only a web-based 3D viewer, but also a structure analysis tool interactively or in the batch mode using NodeJS scripts based on the npm package icn3d. iCn3D synchronizes the display of 3D structure, 2D interaction, and 1D sequences and annotations. Users' custom display can be saved in a short URL or a PNG image. Some features are listed below.

1. View a 3D structure in iCn3D
   Open the link https://structure.ncbi.nlm.nih.gov/icn3d, input a PDB ID, and click "Load". You can also click "File" menu to "Open File" or input other IDs.
   As mentioned in the menu "Help > Transformation Hints", you can use Left mouse button for rotation, Middle mouse wheel for zooming, and Right mouse button for translation.
   The most important point about using iCn3D is the current selection. Any operations on color, style, etc. are working on the current selection. By default, all atoms are selected. Once you select any subset, your operation will work ONLY on the subset. You can switch the selection using the toggle next to the Help menu.
2. VR and AR views in iCn3D
   The Virtual Reality (VR) and Augmented Reality (AR) views are shown in this video.
   You can open a bowser in your Virtual Reality (VR) headset and view a 3D structure in iCn3D. Then click the button "ENTER VR" at the bottom center of your browser to enter the VR view. You can use the right trigger to move forward and use the left trigger tomove backward.
   The Augmented Reality (AR) view is currently only available to iCn3D views in Chrome browser using Android phones. You can view a 3D structure in iCn3D and click the button "START AR" at the bottom center to see the 3D structure in your surroundings. You can tap once on the screen to locate a minimized 3D structure in your tapped location, and tap twice quickly to scale up the 3D structure.
3. Create custom 3D view
   You first open a structure in "File" menu, then select a subset in "Select" menu, view only the selected subset by clicking "View Only Selection" in View menu, finally change styles or colors in "Style" and "Color" menus.
   Each operation has a corresponding command as listed at https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d.html#commands. These commands will show up in the command/log window right beneath the 3D display. To view all previous commands, you can click "Share Link" in "File" menu. Both the original URL and the short URL can be used to display your custom view.
4. Save your work
   You can save "iCn3D PNG Image" in the menu "File > Save File". Both the PNG file and an HTML file are saved. Click the HTML file to see the PNG image, which is linked to the custom display via a shorten URL. The downloaded "iCn3D PNG Image" itself can also be used as an input in the menu "File > Open File" to reproduce the custom display. You can combine these HTML files to generate your own galleries.
   You can also save "Share Link" in "File" menu to share with your colleagues. These URLs are lifelong. You can click "Replay Each Step > On" in "File" menu to learn how a custom display was generated.
   All "Share Link" URLs can show the original view using the archived version of iCn3D by clicking "Open File > Share Link in Archived Ver." in "File" menu.
5. Python scripts" to batch process structures: Python scripts can be used to process 3D structures (e.g., export secondary structures, PNG images, or analysis output) in batch mode. The example scripts are at icn3dpython.
6. Node.js scripts using npm "icn3d" to batch process structures: You can download npm "icn3d" package to write Node.js scripts by calling iCn3D functions. These scripts can be used to process 3D structures (e.g., calculate interactions) in batch mode. The example scripts are at icn3dnode.
7. Annotations for AlphaFold structures: For any custom structures such as AlphaFold structures, you can show conserved domain and 3D domain annotations. For AlphaFold structures, you can also show SNP and ClinVar annotations.
8. Align AlphaFold structures: You can align AlphaFold structures or PDB structures with the menu "File > Align > Multiple Chains" or "File > Align > Protein Complexes > Two AlphaFold Structures". You can also load any structures as usual, then load your custom PDB file with the menu "File > Open File > PDB File (appendable)", then relaign these structures with the meu "File > Realign Selection > by Structure Alignment".
9. Alternate SNPs in 3D
   You can alternate in 3D wild type and mutant of SNPs by clicking the menu "Analysis > Sequences & Annotations", the tab "Details", the checkbox "SNP", and mouseover on SNPs.
10. DelPhi Electrostatic Potential
    You can view the DelPhi Electrostatic Potential in the menu "Analysis > DelPhi Potential".
11. Use iCn3D in Jupyter Notebook
    You can use iCn3D in Jupyter Notebook with the widget "icn3dpy". The instructions are at pypi.org/project/icn3dpy.
12. 2D Cartoons in the chain, domain, and secondary structure levels
    You can use click "Analysis > 2D Cartoon" to show 2D Cartoons in the chain, domain, and secondary structure levels.
13. Contact Map for any Selected Residues
    You can click the menu "Analysis > Contact Map" to show the interactive contact map for any selected residues. You can export the map in PNG or SVG.
14. Show binding site
    You can click "Chem. Binding" in "View" menu to show all hydrogen bonds around chemicals. You can also Show interaction interface by clicking "H-Bonds & Interactions > 2D Interaction Graph, or Highlight Interactionsin Table" in "View" menu.
15. Export models for 3D printing
    You can click "3D Printing" in "File" menu to export models for 3D printing. Both STL and VRML files are supported.
16. Show transmembrane proteins
    If the protein is a transmembrane protein, you can click "File > Retrieve by ID > OPM PDB ID" to input a PDB ID to view the membranes.
17. Show surface, EM map, or electron density map
    You can click "Style > Surface Type", "Style > EM Density Map", or "Style > Electron Density".
18. View 1D sequences and 2D interactions
    In the page https://www.ncbi.nlm.nih.gov/Structure/icn3d/full.html?mmdbid=1TUP, you can click in "Windows" menu to "View Sequences & Annotations", "View Interactions", and see all "Defined Sets", which can be clicked to see any of your selections.
19. Select on 3D, 1D and 2D
    To select on 3D structures: hold "Alt" and use mouse to pick, hold "Ctrl" to union selection, hold "Shift" to select a range, press the up/down arrow to switch among atom/residue/strand/chain/structure. Click "Save Selection" in "Select" menu to save the current selection.
    To select on 1D sequences: drag on the sequences or the blue track title to select.
    To select on 2D interaction diagram: click on the nodes or lines. The nodes are chains and can be united with the Ctrl key. The lines are interactions and can NOT be united. Each click on the lines selects half of the lines, i.e., select the interacting residues in one of the two chains.
20. Align two structures, align multiple chains, or align a protein sequence to a structure
    You can click "File > Align" to see all three alignment options. You can also realign a subset of the structures.
21. Add custom tracks
    You can add custom tracks in various formats (FASTA, bed file, etc.) in the annotation window by clicking the menu "Analysis > View Sequences & Annotations".
22. Show force-directed graph for interactions
    You can show the interactions using 2D force-directed graph in the menu "View > H-Bonds & Interactions > 2D Graph (Force-Directed)".
23. Calculate and show Solvent accessible surface area (SASA)
    You can color structures with SASA, or show the SASA for each residue.
24. Show precalculated symmetry, or calculate symmetry dynamically using SymD.

### AlphaFold-related gallery with live examples

AlphaFold structures with conserved domain
and 3D domain annotations (Uniprot ID A0A044R7Z7)
AlphaFold structures with
SNP and ClinVar annotations (Uniprot ID Q08426)
Align AlphaFold and PDB structures
(chains: P69905_A,P01942_A,1HHO_A)
Membrane for AlphaFold structure
(Uniprot ID A4D1S0)
AlphaFold structure with NCBI
protein accession (NP_001743.1)

### COVID-19-related gallery with live examples

Alternate Wild Type and Mutant of SNP N501Y
in 2019-nCov spike protein (PDB 6M0J)
Alternate Wild Type and Mutant of SNP D614G
in 2019-nCov spike protein (PDB 6VSB)
Cryo-EM structure of the 2019-nCoV spike
in the prefusion conformation (PDB 6VSB)
2019-nCoV RBD/ACE2-B0AT1
complex (PDB 6M17)
DelPhi Electrostatic Potential (25 mV) of
2019-nCoV RBD/ACE2-B0AT1 complex (PDB 6M17)
SARS-COV-2 Receptor Binding domain
interacting with ACE2 receptor (PDB 6M0J)
2D interaction map
in Jupyter Notebook (PDB 6M0J)
2D interaction network
(PDB 6M0J)
Replay each step of
2D interaction graph (PDB 6M0J)
2D interaction display, with force on X-axis,
at "View > H-Bonds & Interactions > 2D Graph (Force-Directed)" (PDB 6M0J)
2D interaction display, with force on Circle,
at "View > H-Bonds & Interactions > 2D Graph (Force-Directed)" (PDB 6M0J)
RBD interacting with
a patient antibody CR3022 (PDB 6W41)
Comparing two antibodies against SARS-COV-1 vs. SARS-COV-2
epitopes on the virus Receptor Binding Domain (PDBs 6W41 and 2DD8)
Show Multiple Sequence Alignment
as Tracks and Add Custom Color (PDB 6M0J)
COVID-19 main protease in complex
with an inhibitor N3 (PDB 6LU7)

### iCn3D gallery with live examples ("iCn3D PNG Images", all images below except the first five snapshots, can be loaded into iCn3D by clicking "Open File > iCn3D PNG Image" in iCn3D File menu)

Synchronized 1D, 2D and 3D Displays (PDB 1TUP)
Mobile-style Menus (PDB 1TUP)
2D Cartoon in the chain level (PDB 1KQ2)
2D Cartoon in the domain level (PDB 6VXX)
2D Cartoon in the secondary structure level (PDB 1TOP)
Contact Map for Selected Residues (PDB 1KQ2)
VAST+ Structure Alignment (PDBs 1HHO and 4N7N)
Align Protein NP_001108451.1 to Structure 1TSR (PDB 1TSR)
Side-by-Side View (PDBs 2AJF and 6W41)
Align chain A of PDB 1HHO with chain A of PDB 4N7N
Hydrogen Bonds and Zn Interactions (PDB 1TUP)
Ligand Binding with Fog and Slab (PDB 3GVU)
Ligand Binding with Thinner Coils (PDB 3GVU)
Ligand Binding with Surfaces and Labels (PDB 3GVU)
Ligand Binding with Electrostatic Potentials (PDB 3GVU)
Charged Residues in Transmembrane (PDB 6JXR)
TCR-epsilon and TCR-delta Interactions (PDB 6JXR)
Custom PDB (load the image in iCn3D)
Multiple Structures (PDB 2KOD, press "a" to alternate)
Electron Density Map (PDB 3GVU)
Electron Density Map for a Subset (PDB 3GVU)
EM Density Map (PDB 6ENY)
EM Density Map for a Subset (PDB 6ENY)
Protein Symmetry (PDB 1KQ2, precalculated)
Protein Symmetry (PDB 3HUJ, dynamically using SymD)
3D Printing (PDB 1TUP)
Schematic Style (PDB 1KQ2)
Solid Surface (PDB 4UN3)
Lipid Bilayer (PDB 2MLR)
Large Structure (PDB 1R09)
Large Structure (PDB 2QZV)
Large Structure (PDB 3J3Q)
Compound with Hydrogens (CID 2244)
Compound without Hydrogens (CID 2244)

### iCn3D Videos

- iCn3D Tutorial Video (2022), Slide
- iCn3D Workshop, by NCBI in October 2022, Slide
- Virtual Reality (VR) and Augmented Reality (AR) views in iCn3D (2022)
- Exploring 3D Molecular Structures with iCn3D, by Dr. Salsbury in July 2022, Slide
- iCn3D in Teaching and OERs, by Dr. Jakubowski in July 2022, Slide
- iCn3D Tutorial by Dr. Jakubowski in July 2021, Slide
- iCn3D Tutorials by Digital World Biology (2021-)
- iCn3D Tutorial by BioMolViz Group (2021)

### Frequently Asked Questions

- Q: How to view a 3D structure in iCn3D?
  You can use iCn3D to view a 3D structure in different platforms such as web browser, Jupyter Notebook, Virtual Reality, or Augmented Reality.
  To view in a web browser, you can open the link https://structure.ncbi.nlm.nih.gov/icn3d and input PDB ID(s) or AlphaFold UniProt ID(s) with the menu "File > Retrieve by ID > MMDB or AlphaFold IDs". You can also open several PDB files with the menu "File > Open File > PDB Files (appendable)".
  To view 3D structures in Jupyter Notebook, you can follow the instructions at icn3dpy.
  Virtual Reality (VR) view in iCn3D:
  You need a VR headset to view 3D structures in VR using iCn3D. In your VR browser, load a 3D structure in iCn3D and click the button "ENTER VR" at the bottom center of the page to enter the VR view.
  Currently you can use the right trigger to move forward and the left trigger to move backward.
  Augmented Reality (AR) view in iCn3D:
  You need to use the Chrome browser in an Android cell phone (not iPhone) to view 3D structures in AR using iCn3D. (Some cell phones may require you to install ARCore.) In your iCn3D view, click the button "START AR" at the bottom center of the page to enter the AR view.
  Currently you can tap once on the screen to locate a minimized 3D structure in your tapped location, and tap twice quickly to scale up the 3D structure.
- Q: How to Rotate/translate/zoom structures in iCn3D?
  - Rotate
    - Left mouse (Click & Drag)
    - Key L: left
    - Key J: right
    - Key I: up
    - Key M: down
    - Shift + Key L: left 90°
    - Shift + Key J: right 90°
    - Shift + Key I: up 90°
    - Shift + Key M: down 90°
  - Zoom
    - Middle mouse (Pinch & Spread)
    - Key Z: zoom in
    - Key X: zoom out
  - Translate
    - Right mouse (Two Finger Click & Drag)
- Q: How to select a subset of structures?
  You can select a subset in 3D structures, 2D interactions, or 1D sequences.
  To pick an atom/residue/strand in the 3D structure, hold "Alt" key and use mouse to pick. Click the second time to deselect. To add more selection to the current selection, hold "Ctrl" key and use mouse to pick. To add a range of selection starting from the current selection, hold "Shift" key and use mouse to pick the ending selection. To change the selected residue to the strand/chain/structure containing the residue, press the up/down arrow.
  To select chains or interactions in the 2D interactions diagram, click on the nodes or lines. The nodes are chains and can be united with the Ctrl key. The lines are interactions and can NOT be united. Each click on the lines selects half of the lines, i.e., select the interacting residues in one of the two chains. The selected residues are saved in the "Select -> Advanced" menu.
  To select residues in the 1D sequence window, drag with mouse or touch to select residues. Drag or touch again to deselect residues. Multiple selection is allowed without the Ctrl key.
  To save the current selection (either on 3D structure, 2D interactions, or 1D sequence), open the menu "Select -> Save Selection", specify the name and description for the selection, and click "Save".
- Q: How to change style and color?
  You can use the "Style" menu to change the styles for your currently selected atoms. You can also use it to show surfaces, or change the background color.
  You can use the "Color" menu to color your currently selected atoms.
  It's important to remember that any operations on color, style, etc. are working on the current selection. By default, all atoms are selected. Once you select any subset, your operation will work ONLY on the subset. You can switch the selection using the toggle next to the Help menu.
- Q: How to save your work?
  There are two ways to save your work: "iCn3D PNG Image" or "Share Link".
  You can save "iCn3D PNG Image" in the menu "File > Save Files". Both the PNG file and an HTML file are saved. Click the HTML file to see the PNG image, which is linked to the custom display via a shorten URL. The downloaded "iCn3D PNG Image" itself can also be used as an input in the menu "File > Open File" to reproduce the custom display. You can combine these HTML files to generate your own galleries.
  You can also save "Share Link" in "File" menu to share with your colleagues. These URLs are lifelong. You can click "Replay Each Step > On" in "File" menu to learn how a custom display was generated.
  All "Share Link" URLs can show the original view using the archived version of iCn3D by clicking "Open File > Share Link in Archived Ver." in "File" menu.
- Q: How to show annotations?
  You can show annotations by clicking the menu "Analysis > Seq. & Annotations". The annotations include "SNPs", "ClinVar", "Conserved Domains", "Functional Sites", "3D Domains", "Interactions", "Disulfide Bonds", "Cross-Linkages", and "PTM (UniProt)". You can also add your own annotations with the button "Add Tack".
  Turn on scroll bars in Mac:
  If you are using Macintosh computer and need to scroll in the sequences/annotations dialog, you can turn on the scroll bars as follows: Systems preferences -> GENERAL -> show scroll bars -> check "always".
- Q: How to export annotations?
  There are three ways to export annotations.
  First, you can save the annotations in an HTML file by clicking the save icon at the upper right corner of the dialog.
  Second, you can retrieve the annotations using the Node.js script annotations.js. The description is at icn3dnode". For example, you can use the following command to retrieve Post Translational Modification (PTM) annotation for the AlphaFold UniProt ID Q08426: "node annotations.js Q08426 9".
  Third, you can retrieve the annotations using the Python script batch_export_panel.py. The description is at icn3dpython.
- Q: How to do interactions analysis?
  Once you load structures into iCn3D, you can click the menu "Analysis > Interactions" to analyze the interactions between any two sets.
  First, you need to define your interested interaction types and their thresholds in the Interactions dialog. Then select two sets. You can check the section "Select Subsets" to define sets. Finally you can show the interactions in different formats, such as "2D Interaction Network", "2D Interaction Map", etc. If you want to clear the current interaction and try a different interaction analysis, you can click the "Reset" button at the bottom of the Interactions dialog.
- Q: How to do mutation analysis ?
  You can start the mutation analysis by clicking the menu "Analysis > Mutation". First you need to define the mutation(s) in the format of "[PDB or AlphaFold ID]_[chain Name]_[residue number]_[Mutant residue in one letter]". Then you can choose whether the ID is PDB ID or AlphaFold UniProt ID.
  Next, if you have not loaded a structure yet, you can choose "Show Mutation in New Page" to launch the mutation analysis.
  If you have already loaded a structure, you can choose "Show Mutation in Current Page". Your loaded structure may come from a custom PDB file without a PDB/AlphaFold ID. You can replace "[PDB or AlphaFold ID]" with the real ID such as "STRU" as shown in the "Defined Sets" by clicking the menu "Analysis > Defined Sets".
  Mutation Analysis can be done only for one structure. If you want to check the effect of mutations between different structures, you can output the current structures as a PDB file, modify the PDB file to have one structure, load the modified PDB, and do mutation analysis on the modified PDB.
- Q: How to show electrostatic potential?
  Once you load structures into iCn3D, you can click the menu "Analysis > DelPhi Potential" to show DelPhi electrostatic potential. You can show the potentials on molecular surface, or as equipotential map. You can define the salt concentration and grid size. The pH is set at 7.0.
  You can also output a PQR file for your structures. The PQR file contains the partial charges and radii information.
- Q: How to find similar PDB structures?
  If you want to find similar PDB structures for an input structure with multiple chains, you can click the menu "File > Search Similar > NCBI VAST+ (PDB Assembly)", input a PDB ID, then click the button "VAST+" to get a list of similar structures. You can expand each similar structure for more details.
  If you want to find similar PDB chains for an input chain, you can click the menu "File > Search Similar > NCBI VAST (PDB)" to get a popup with two options for the input. The first input option is a PDB chain. You can input the PDB ID and the chain name, then click "VAST" to get a list of similar chains. You can select a few chains to view the alignment in iCn3D. The second input option is a custom PDB file. You can select the PDB file and click "Submit" to launch a VAST neighbor search. The search result shows a list of similar chains. You can select a few chains and show the alignment in iCn3D. (The search result will be accessible only for a week. But you can save your alignment in iCn3D permanently using the menu "File > Save File > iCn3D PNG Image". The saved "iCn3D PNG Image" can be loaded back to iCn3D with the menu "File > Open File > iCn3D PNG Image".)
- Q: How to find similar AlphaFold or PDB structures?
  If you want to find similar predicted AlphaFold structures, you can click the menu "File > Search Similar > Foldseek (PDB & AlphaFold)", and click the "Foldseek" link in the popup to search similar structures in Foldseek. If you want to view the alignment of Foldseek in iCn3D, you can input the UniProt IDs or chain names in the popup and align them.
- Q: How to align multiple structures?
  To align multiple structures with PDB IDs or AlphaFold UniProt IDs, you can use the menu "File > Align > Multiple Chains". You can choose to align them by structure alignment, sequence alignment, or residue by residue.
  To align multiple structures loaded from custom PDB files, you can use the menu "File > Realign Selection". You can also choose to align them by structure alignment, sequence alignment, or residue by residue.
- Q: How to analyze many structures with scripts?
  You can use either Node.js scripts or Python scripts to do batch analysis in command line.
  You can use Node.js scripts to retrieve any data in iCn3D, even those unavailable in the UI. Some example scripts are listed at icn3dnode" to retrieve annotations, interactions, electrostatic potentials, and surface areas, etc. For example, you can use the following command to retrieve the residues interacting with the ligand "JFM" in the structure with PDB ID 5R7Y: "node ligand.js 5R7Y JFM".
  You can also use Python scripts to retrieve data in the UI. Some example scripts are at icn3dpython to retrieve secondary structures, iCn3D PNG Images, JSON data for interactions, etc.
- Q: How to embed iCn3D?
  You can follow the instruction here.

### URL parameters

Parameter | Description
--- | ---
mmdbafid | A list of PDB or AlphaFold UniProt IDs for realignment, e.g., https://www.ncbi.nlm.nih.gov/Structure/icn3d/full.html?mmdbafid=1HHO,4N7N,P69905,P01942. You could then input multiple PDB files with the menu "File > Open File > PDB Files (appendable)". Next you could click the menu "File > Realign Selection > by Structure Alignment" to realign all loaded structures.
mmdbid | NCBI MMDB ID or PDB ID, e.g., ?mmdbid=1tup&showanno=1&show2d=1
mmtfid | MMTF ID, e.g., ?mmtfid=1tup
pdbid | PDB ID, e.g., ?pdbid=1tup
mmcifid | mmCIF ID, e.g., ?mmcifid=1tup
gi | NCBI protein gi number, e.g., ?gi=827343227
cid | PubChem Compound ID, e.g., ?cid=2244
blast_rep_id | NCBI protein accession of a chain of a 3D structure. "blast_rep_id" combines with the parameter "query_id" of a protein sequence to show the sequence-structure alignment, e.g., from=icn3d&blast_rep_id=1TSR_A&query_id=NP_001108451.1
align | Two PDB IDs or MMDB IDs for structure alignment, e.g., ?align=1hho,4n7n
chainalign | Two chains for structure alignment, e.g., ?chainalign=1HHO_A,4N7N_A
url | Use the url (encoded) to retrieve the 3D structure. The url requires another parameter "type", e.g., ?type=pdb&url=https%3A%2F%2Ffiles.rcsb.org%2Fview%2F1gpk.pdb
width | Width of the structure image. It can be percentage such as '100%', or pixel values such as 400. The default is "100%".
height | Height of the structure image. It can be percentage such as '100%', or pixel values such as 400. The default is "100%".
resize | Set "true" or "1" to resize the image when the container is resized. The default is "true".
rotate | Set "right", "left", "up", or "down" to rotate the structure when it is displayed at the beginning. The default is "right".
showanno | Set "true" or "1" to show annotations, such as SNPs, ClinVar, domains, binding sites. The default is "false".
showalignseq | Set "true" or "1" to show the aligned sequence window. The default is "false".
showsets | Set "true" or "1" to show the defined sets. The default is "false".
show2d | Set "true" or "1" to show the 2D interaction. The default is "false".
showmenu | Set "false" or "0" to hide the menus and buttons at the top of the structure canvas. The default is "true".
showtitle | Set "false" or "0" to hide the title at the top of the structure canvas. The default is "true".
showcommand | Set "false" or "0" to hide the command window. The default is "true".
mobilemenu | Set "true" or "1" to show the mobile-style menu. Users can click to see all menus. The default is "false".
closepopup | Set "true" or "1" to close the dialogs of "Defined Sets", "Interactions", and "Sequences and Annotations". The default is "false".
command | Besides the "Script/Log" section at the bottom of the canvas, commands can also be attached to the url parameter "command". The easy way to generate the commands is to operate manually to get your custom display and then click "File > Share Link" to find the URL with full commands or just the short URL.
replay | Set "true" or "1" to replay each step of a custom display.
usepdbnum | Set "true" or "1" to use PDB residue numbers instead of NCBI residue numbers when the input is MMDB ID and the residue numbers are different. The default is "true".
hidelicense | Set "true" or "1" to hide the features requiring licenses, such as "Analysis > DelPhi Potential". The default is "false".
shownote | Set "true" or "1" to show the content in "Analysis > Window Title" as the window title. The default is "false".
menuicon | Set "true" or "1" to show icons for those menus requiring internet or license. The default is "false".

### Menus, Commands, and Functions of the advanced interface

To find icn3d commands and functions, you can first generate a custom view in iCn3D interactively. Then you can click the menu "File > Share Link" to see the commands in the section "Original URL with commands". Most commands are processed with functions in the file "src/icn3d/selection/applyCommand.js". Other commands with asynchronized retrieval are processed with functions in the file "src/icn3d/selection/loadScript.js".
1. File

Menu | Command | Function
a) Retrieve by ID
MMDB ID: | load mmdb0 [1GPK] | ic.mmdbParserCls.downloadMmdb
MMTF ID: | load mmtf [1GPK] | ic.mmtfParserCls.downloadMmtf
PDB ID: | load pdb [1GPK] | ic.pdbParserCls.downloadPdb
OPM PDB ID: | load opm [6JXR] | ic.opmParserCls.downloadOpm
mmCIF ID: | load mmcif [1GPK] | ic.mmcifParserCls.downloadMmcif
PubChem CID: | load cid [2244] | ic.sdfParserCls.downloadCid
b) Open File
PDB File: | [no command available] |
mmCIF File: | [no command available] |
Mol2 File: | [no command available] |
SDF File: | [no command available] |
XYZ File: | [no command available] |
URL (Same Host): | load url [https://files.rcsb.org/view/1gpk.pdb] | ic.pdbParserCls.downloadUrl
iCn3D PNG Image: | [no command available] |
State/Script File: | [no command available] | ic.loadScriptCls.loadScript
Selection File: | [no command available] |
Electron Density (DSN6) - Local File: | set map 2fofc sigma 1.5 | ic.dsn6ParserCls.loadDsn6Data()
Electron Density (DSN6) - URL (Same Host): | set map 2fofc sigma 1.5 | [URL] | ic.dsn6ParserCls.dsn6ParserBase()
c) Align
Sequence to Structure: | load seq_struc_ids [23491729,1TUP_A] | ic.mmdbParserCls.downloadBlast_rep_id
Protein Complexes - Invariant Substructure Superposed: | load alignment [1HHO,4N7N] | parameters atype=1 | ic.alignParserCls.downloadAlignment
Protein Complexes - All Matching Molecules Superposed: | load alignment [1HHO,4N7N] | parameters atype=0 | ic.alignParserCls.downloadAlignment
Chain to Chain: | load chainalignment [1HHO_A,4N7N_A] | ic.chainalignParserCls.downloadChainAlignment
d) Realign Selection | realign on seq align | ic.realignParserCls.realignOnSeqAlign
e) 3D Printing
VRML (Color, W/ Stabilizers): | export vrml stabilizer file | ic.export3DCls.saveVrmlFile
STL (W/ Stabilizers): | export stl stabilizer file | ic.export3DCls.saveStlFile
VRML (Color): | export vrml file | ic.export3DCls.saveVrmlFile
STL: | export stl file | ic.export3DCls.saveStlFile
Add All Stabilizers: | stabilizer | ic.threeDPrintCls.addStabilizer
Remove All Stabilizers: | set stabilizer off | ic.threeDPrintCls.hideStabilizer
Add One Stabilizer: | add one stabilizer | [atom serial] [atom serial] |
Remove One Stabilizer: | remove one stabilizer | [atom serial] [atom serial] |
Set Thickness: | set thickness | linerad 0.6 | coilrad 1 | stickrad 0.8 | crosslinkrad 0.8 | ribbonthick 0.8 | proteinwidth 2 | nucleotidewidth 1.2 | ballscale 0.6 |
Reset Thickness: | reset thickness | ic.threeDPrintCls.resetAfter3Dprint
f) Save File
iCn3D PNG Image: | export canvas (URL example: https://www.ncbi.nlm.nih.gov/Structure/icn3d/full.html?mmdbid=1top&command=export%20canvas) | ic.saveFileCls.saveFile([filename], 'png')
State File: | [no command available] | ic.saveFileCls.saveFile
All Selections: | [no command available] | ic.saveFileCls.saveFile
Residue Counts: | [no command available] | ic.saveFileCls.saveFile
PDB: | [no command available] | ic.saveFileCls.getAtomPDB
g) Share Link: | [no command available] | ic.shareLinkCls.shareLink
g) Replay Each Step: | replay on | replayon

2. Select

Menu | Command | Method
a) Defined Sets: | defined sets | ic.definedSetsCls.showSets
Select sets: | select saved atoms [name1] or/and/not [name2] | ic.definedSetsCls.changeCustomAtoms
Delete selected sets: | delete selected sets | ic.definedSetsCls.deleteSelectedSets
b) All: | select all | ic.selectionCls.selectAll
c) Displayed Set: | select displayed set | ic.hAtoms = me.HashUtilsCls.cloneHash(ic.dAtoms)
d) by Distance
Display: | select zone cutoff [cutoff in angstrom] | ic.showInterCls.pickCustomSphere
e) by Property
Positive: | select prop positive | ic.resid2specCls.selectProperty
Negative: | select prop negative | ic.resid2specCls.selectProperty
Hydrophobic: | select prop hydrophobic | ic.resid2specCls.selectProperty
Polar: | select prop polar | ic.resid2specCls.selectProperty
B-factor: | select prop b factor | ic.resid2specCls.selectProperty
Solvent Accessibility: | select prop percent out | ic.resid2specCls.selectProperty
f) Inverse: | select complement | ic.resid2specCls.selectComplement
g) Main Chains: | select main chains | ic.selectionCls.selectMainChains
h) Side Chains: | select side chains | ic.selectionCls.selectSideChains
i) Advanced | select [command] | name [commandname] | ic.selectByCommandCls.selectByCommand
j) Select on 3D
Chain (Alt): | set pk chain | ic.pk = 5; ic.opts['pk'] = 'chain';
3D Domain (Alt): | set pk domain | ic.pk = 4; ic.opts['pk'] = 'domain';
Strand/Helix (Alt): | set pk strand | ic.pk = 3; ic.opts['pk'] = 'strand';
Residue (Alt): | set pk residue | ic.pk = 2; ic.opts['pk'] = 'residue';
Atom (Alt): | set pk atom | ic.pk = 1; ic.opts['pk'] = 'atom';
k) Save Selection: | select [command] | name [commandname] | ic.selectByCommandCls.selectByCommand
l) Clear Selection: | clear all | ic.selectionCls.selectAll
m) Highlight Color
Yellow: | set highlight color yellow |
Green: | set highlight color green |
Red: | set highlight color red |
n) Highlight Style
Outline: | set highlight style outline | ic.bHighlight = 1;
3D Objects: | set highlight style 3d | ic.bHighlight = 2;
o) Toggle Highlight | toggle highlight | ic.hlUpdateCls.toggleHighlight
p) Switch Highlight Level
↑: | highlight level up | ic.resid2specCls.switchHighlightLevelUp
↓: | highlight level down | ic.resid2specCls.switchHighlightLevelDown

2b. Selection Definition
In the dialog Select -> Advanced, users can use simple specification to select atoms:
Specification: In the selection "$1HHO,4N7N.A,B,C:5-10,LV,3LeuVal,chemicals@CA,C":

- "$1HHO,4N7N" uses "$" to indicate structure selection.
- ".A,B,C" uses "." to indicate chain selection.
- ":5-10,LV,3LeuVal,chemicals" uses the colon ":" to indicate residue selection. Residue selection could be residue number(5-10), one-letter IUPAC residue name abbreviations(LV), three-letter residue names(AlaVal, "3" indicates each residue name has three letters), or predefined names: "proteins", "nucleotides", "chemicals", "ions", and "water". IUPAC abbreviations can be written either as a contiguous string(e.g., ":LV"), in order to find all instances of that sequence in the structure, or they can be separated by commas(e.g., ":L,V") to select all residues of a given type in the structure(in the latter case, select all Leucine and Valine in the structure).
- "@CA,C" uses "@" to indicate atom selection.
- Partial definition is allowed, e.g., ":1-10" selects all residue IDs 1-10 in all chains.
- Different selections can be united (with "or", default), intersected (with "and"), or negated (with "not"). For example, ":1-10 or :K" selects all residues 1-10 and all Lys residues. ":1-10 and :K" selects all Lys residues in the range of residue number 1-10. ":1-10 or not :K" selects all residues 1-10, which are not Lys residues.
- The wild card character "X" or "x" can be used to represent any character.

Set Operation:

- Users can select multiple sets in the menu "Select > Defined Sets".
- Different sets can be unioned (with "or", default), intersected (with "and"), or excluded (with "not"). For example, if the "Defined Sets" menu has four sets ":1-10", ":11-20", ":5-15", and ":7-8", the command "saved atoms :1-10 or :11-20 and :5-15 not :7-8" unions all residues 1-10 and 11-20 to get the residues 1-20, then intersects with the residues 5-15 to get the residues 5-15, then exclude the residues 7-8 to get the final residues 5-6 and 9-15.

Full commands in url or command window:

- Select without saving the set: select $1HHO,4N7N.A,B,C:5-10,KRDE,chemicals@CA,C
- Select and save: select $1HHO,4N7N.A,B,C:5-10,KRDE,chemicals@CA,C | name my_name

3. View

Menu | Command | Method
a) View -> View Only Selection: | show selection | ic.selectionCls.showSelection
b) View -> Zoom in Selection: | zoom selection | ic.resizeCanvasCls.zoominSelection
c) View -> Center Selection: | center selection | ic.applyCenterCls.centerSelection
d) View -> View Full Structure: | show all | ic.selectionCls.showAll
e) View -> Show Side by Side: | side by side | [url] | window.open()
f) View -> Rotate
f1) Rotate 90°
X-axis: | rotate x | ic.transformCls.setRotation
Y-axis: | rotate y | ic.transformCls.setRotation
Z-axis: | rotate z | ic.transformCls.setRotation
f2) Auto Rotation
Rotate Left: | rotate left | ic.transformCls.rotStruc
Rotate Right: | rotate right | ic.transformCls.rotStruc
Rotate Up: | rotate up | ic.transformCls.rotStruc
Rotate Down: | rotate down | ic.transformCls.rotStruc
g) View -> Camera
Perspective: | set camera perspective | ic.opts['camera'] = 'perspective';
Orthographic: | set camera orthographic | ic.opts['camera'] = 'orthographic';
h) View -> Fog for Selection
On: | set fog on | ic.opts['fog'] = 'yes';
Off: | set fog off | ic.opts['fog'] = 'no';
i) View -> Slab for Selection
On: | set slab on | ic.opts['slab'] = 'yes';
Off: | set slab off | ic.opts['slab'] = 'no';
j) View -> XYZ-axes
Show: | set axis on | ic.opts['axis'] = 'yes';
Hide: | set axis off | ic.opts['axis'] = 'no';
k) View -> Reset:
All: | reset | ic.loadScriptCls.renderFinalStep
Orientation: | reset orientation | ic.transformCls.resetOrientation
l) View -> Undo: | back | ic.resizeCanvasCls.back
m) View -> Redo: | forward | ic.resizeCanvasCls.forward
n) View -> Full Screen: | [no command available] |

4. Style

Menu | Command | Method
a) Style -> Protein
Ribbon: | style proteins ribbon | ic.setOptionCls.setStyle
Strand: | style proteins strand | ic.setOptionCls.setStyle
Cylinder and Plate: | style proteins cylinder and plate | ic.setOptionCls.setStyle
Schematic: | style proteins schematic | ic.setOptionCls.setStyle
C Alpha Trace: | style proteins c alpha trace | ic.setOptionCls.setStyle
Backbone: | style proteins backbone | ic.setOptionCls.setStyle
B-factor Tube: | style proteins b factor tube | ic.setOptionCls.setStyle
Lines: | style proteins lines | ic.setOptionCls.setStyle
Stick: | style proteins stick | ic.setOptionCls.setStyle
Ball and Stick: | style proteins ball and stick | ic.setOptionCls.setStyle
Sphere: | style proteins sphere | ic.setOptionCls.setStyle
Hide: | style proteins nothing | ic.setOptionCls.setStyle
b) Style -> Side Chains
Lines: | style sidec lines | ic.setOptionCls.setStyle
Stick: | style sidec stick | ic.setOptionCls.setStyle
Ball and Stick: | style sidec ball and stick | ic.setOptionCls.setStyle
Sphere: | style sidec sphere | ic.setOptionCls.setStyle
Hide: | style sidec nothing | ic.setOptionCls.setStyle
c) Style -> Nucleotides
Nucleotide Cartoon: | style nucleotides nucleotide cartoon | ic.setOptionCls.setStyle
O3' Trace: | style nucleotides o3 trace | ic.setOptionCls.setStyle
Backbone: | style nucleotides backbone | ic.setOptionCls.setStyle
Schematic: | style nucleotides schematic | ic.setOptionCls.setStyle
Lines: | style nucleotides lines | ic.setOptionCls.setStyle
Stick: | style nucleotides stick | ic.setOptionCls.setStyle
Ball and Stick: | style nucleotides ball and stick | ic.setOptionCls.setStyle
Sphere: | style nucleotides sphere | ic.setOptionCls.setStyle
Hide: | style nucleotides nothing | ic.setOptionCls.setStyle
d) Style -> Chemicals
Lines: | style chemicals lines | ic.setOptionCls.setStyle
Stick: | style chemicals stick | ic.setOptionCls.setStyle
Ball and Stick: | style chemicals ball and stick | ic.setOptionCls.setStyle
Schematic: | style chemicals schematic | ic.setOptionCls.setStyle
Sphere: | style chemicals sphere | ic.setOptionCls.setStyle
Hide: | style chemicals nothing | ic.setOptionCls.setStyle
d2) Style -> Hydrogens
Show: | hydrogens | ic.setOptionCls.showHydrogens
Hide: | set hydrogens off | ic.setOptionCls.hideHydrogens
e) Style -> Ions
Sphere: | style ions sphere | ic.setOptionCls.setStyle
Dot: | style ions dot | ic.setOptionCls.setStyle
Hide: | style ions nothing | ic.setOptionCls.setStyle
f) Style -> Water
Sphere: | style water sphere | ic.setOptionCls.setStyle
Dot: | style water dot | ic.setOptionCls.setStyle
Hide: | style water nothing | ic.setOptionCls.setStyle
g) Style -> Set Thickness: | set thickness | linerad 0.6 | coilrad 1 | stickrad 0.8 | crosslinkrad 0.8 | ribbonthick 0.8 | proteinwidth 2 | nucleotidewidth 1.2 | ballscale 0.6 |
h) Style -> Save Style: | save style | ic.setOptionCls.saveStyle
i) Style -> Apply Saved Style: | apply saved style | ic.setOptionCls.applySavedStyle
j) Style -> Surface Type
Van der Waals: | set surface Van der Waals surface | ic.applyMapCls.applySurfaceOptions
VDW with Context: | set surface Van der Waals surface with context | ic.applyMapCls.applySurfaceOptions
Molecular Surface: | set surface molecular surface | ic.applyMapCls.applySurfaceOptions
MS with Context: | set surface molecular surface with context | ic.applyMapCls.applySurfaceOptions
Solvent Accessible: | set surface solvent accessible surface | ic.applyMapCls.applySurfaceOptions
SA with Context: | set surface solvent accessible surface with context | ic.applyMapCls.applySurfaceOptions
k) Style -> Remove Surface: | set surface nothing | ic.applyMapCls.applySurfaceOptions
l) Style -> Surface Opacity
1.0: | set surface opacity 1.0 | ic.applyMapCls.applySurfaceOptions
0.9: | set surface opacity 0.9 | ic.applyMapCls.applySurfaceOptions
0.8: | set surface opacity 0.8 | ic.applyMapCls.applySurfaceOptions
0.7: | set surface opacity 0.7 | ic.applyMapCls.applySurfaceOptions
0.6: | set surface opacity 0.6 | ic.applyMapCls.applySurfaceOptions
0.5: | set surface opacity 0.5 | ic.applyMapCls.applySurfaceOptions
0.4: | set surface opacity 0.4 | ic.applyMapCls.applySurfaceOptions
0.3: | set surface opacity 0.3 | ic.applyMapCls.applySurfaceOptions
0.2: | set surface opacity 0.2 | ic.applyMapCls.applySurfaceOptions
0.1: | set surface opacity 0.1 | ic.applyMapCls.applySurfaceOptions
m) Style -> Surface Wireframe
Yes | set surface wireframe on | ic.applyMapCls.applySurfaceOptions
No | set surface wireframe off | ic.applyMapCls.applySurfaceOptions
n) Style -> Electron Density
2Fo-Fc Map: | set map 2fofc sigma 1.5 | ic.loadScriptCls.applyCommandMap
Fo-Fc Map: | set map 2fofc sigma 3 | ic.loadScriptCls.applyCommandMap
o) Style -> Remove Map: | set map nothing | ic.applyMapCls.applyMapOptions
p) Style -> Map Wireframe
Yes | set map wireframe on | ic.applyMapCls.applyMapOptions
No | set map wireframe off | ic.applyMapCls.applyMapOptions
q) Style -> EM Density Map: | set emmap percentage 20 | ic.loadScriptCls.applyCommandEmmap
r) Style -> Remove EM Map: | set emmap nothing | ic.applyMapCls.applyEmmapOptions
s) Style -> EM Map Wireframe
Yes | set emmap wireframe on | ic.applyMapCls.applyEmmapOptions
No | set emmap wireframe off | ic.applyMapCls.applyEmmapOptions
t) Style -> Background
Transparent: | set background transparent | ic.opts['background'] = 'transparent'
Black: | set background black | ic.opts['background'] = 'black'
Grey: | set background grey | ic.opts['background'] = 'grey'
White: | set background white | ic.opts['background'] = 'white'
u) Style -> Dialog Color
Blue: | set theme blue | ic.setMenuCls.setTheme
Orange: | set theme orange | ic.setMenuCls.setTheme
Black: | set theme black | ic.setMenuCls.setTheme

5. Color

Menu | Command | Method
a)
Color -> Spectrum: | color spectrum | ic.setColorCls.setColorByOptions
Color -> Secondary (Sheet in Green): | color secondary structure | ic.setColorCls.setColorByOptions
Color -> Secondary (Sheet in Yellow): | color secondary structure yellow | ic.setColorCls.setColorByOptions
Color -> Secondary (Spectrum): | color secondary structure spectrum | ic.setColorCls.setColorByOptions
Color -> Charge: | color charge | ic.setColorCls.setColorByOptions
Color -> Wimley-White Hydrophobicity: | color hydrophobic | ic.setColorCls.setColorByOptions
Color -> B-factor (Original): | color b factor | ic.setColorCls.setColorByOptions
Color -> B-factor (Percentile): | color b factor percentile | ic.setColorCls.setColorByOptions
Color -> Solvent Accessibility: | color area | 35 | ic.setColorCls.setColorByOptions
Color -> Chain: | color chain | ic.setColorCls.setColorByOptions
Color -> 3D Domain: | color 3ddomain | ic.setColorCls.setColorByOptions
Color -> Residue - Default: | color residue | ic.setColorCls.setColorByOptions
Color -> Residue - Custom: | color residue custom | ic.setColorCls.setColorByOptions
Color -> Atom: | color atom | ic.setColorCls.setColorByOptions
b) Color -> Unicolor
Red: | color red | ic.setColorCls.setColorByOptions
Green: | color green | ic.setColorCls.setColorByOptions
Blue: | color blue | ic.setColorCls.setColorByOptions
Magenta: | color magenta | ic.setColorCls.setColorByOptions
Yellow: | color yellow | ic.setColorCls.setColorByOptions
Cyan: | color cyan | ic.setColorCls.setColorByOptions
White: | color white | ic.setColorCls.setColorByOptions
Grey: | color grey | ic.setColorCls.setColorByOptions
c) Color -> Color Picker
Apply: | color [e.g., FF0000] | ic.setColorCls.setColorByOptions
Color -> Save Color: | save color | ic.setOptionCls.saveColor
Color -> Apply Saved Color: | apply saved color | ic.setOptionCls.applySavedColor

6. Analysis

Menu | Command | Method
a) Analysis -> View Sequences & Annotations: | view annotations | ic.loadScriptCls.applyCommandAnnotationsAndCddSite
b) Analysis -> View 2D Diagram | view interactions | ic.parserUtilsCls.set2DDiagrams
c) Analysis -> Defined Sets | defined sets | ic.definedSetsCls.showSets
d) Analysis -> H-Bonds & Interactions: | hbonds 3.5 | sets non-selected selected; salt bridges 4 | sets non-selected selected; interactions 4 | sets non-selected selected | ic.showInterCls.showHbonds;ic.showInterCls.showSaltbridge;ic.showInterCls.pickCustomSphere
e) Analysis -> Bring to Front: | window ... | ic.dialogCls.openDlg
f) Analysis -> DelPhi Potential
Local Phi/Cube File: | [no command available] | ic.delphiCls.loadPhiFile
URL (Same Host) Phi/Cube: | set phimap cubeurl contour 1 | [url] | ic.delphiCls.loadPhiFileUrl
g) Analysis -> Remove Potential: | setoption phimap nothing | ic.setOptionCls.setOption('phimap', 'nothing')
h) Analysis -> Chemical Binding
Show: | set chemicalbinding show | me.ic.setOptionCls.setOption('chemicalbinding', 'show');
Hide: | set hbonds off | me.ic.setOptionCls.setOption('chemicalbinding', 'hide');
i) Analysis -> Disulfide Bonds
Show: | disulfide bonds | ic.showInterCls.showSsbonds
Export Pairs: | [no command available] |
Hide: | set disulfide bonds off | ic.opts["ssbonds"] = "no
j) Analysis -> Cross-Linkages
Show: | cross linkage | ic.bShowCrossResidueBond = true;
Hide: | set cross linkage off | ic.bShowCrossResidueBond = false;
k) Analysis -> Assembly (PDB, mmCIF, or MMTF files only)
yes: | set assembly on | ic.bAssembly = true;
no: | set assembly off | ic.bAssembly = false;
l) Analysis -> Symmetry: | symmetry C6 (global) | ic.symdCls.retrieveSymmetry; ic.applySymdCls.applySymmetry
m) Analysis -> Distance
between Two Atoms: | add label [label text] | x [x] y [y] z [z] | size [label size] | color [FF0000] | background [FFFFFF] | ic.analysisCls.addLabel
add line | x1 [x1] y1 [y1] z1 [z1] | x2 [x2] y2 [y2] z2 [z2] | color [FFFF00] | dashed [true] | ic.analysisCls.addLine
between Two Sets: | dist | [set1] [set2] | ic.analysisCls.measureDistTwoSets
Hide: | set lines off | ic.labels['distance'] = []; ic.lines['distance'] = [];
n) Analysis -> Label
by Picking Atoms: | add label [label text] | x [x] y [y] z [z] | size [label size] | color [FF0000] | background [FFFFFF] | ic.analysisCls.addLabel
per Selection: | add label [label text] | size [label size] | color [FF0000] | background [FFFFFF] | ic.analysisCls.addLabel
per Atom: | add atom labels | ic.residueLabelsCls.addAtomLabels
per Residue: | add residue labels | ic.residueLabelsCls.addResiudeLabels
per Chain: | add chain labels | ic.analysisCls.addLabel
N- & C- Termini: | add terminal labels | ic.residueLabelsCls.addTerminiLabels
Remove: | set labels off | ic.residueLabelsCls.addChainLabels
o) Analysis -> Label Scale
0.1: | set label scale 0.1 | ic.labelScale=0.1
0.2: | set label scale 0.2 | ic.labelScale=0.2
0.4: | set label scale 0.4 | ic.labelScale=0.4
0.6: | set label scale 0.6 | ic.labelScale=0.6
0.8: | set label scale 0.8 | ic.labelScale=0.8
1.0: | set label scale 1.0 | ic.labelScale=1.0
2.0: | set label scale 2.0 | ic.labelScale=2.0
4.0: | set label scale 4.0 | ic.labelScale=4.0
6.0: | set label scale 6.0 | ic.labelScale=6.0
8.0: | set label scale 8.0 | ic.labelScale=8.0
10.0: | set label scale 10.0 | ic.labelScale=10.0
p) Analysis -> Your Note / Window Title | your note | [text] |
q) Analysis -> View Links
Structure Summary: | [no command available] |
Find Similar Structures: | [no command available] |
Literature: | [no command available] |
Protein: | [no command available] |

7. Help

Menu | Command |
a) Help -> About iCn3D: | [no command available] |
b) Help -> Help DOc: | [no command available] |
c) Help -> Web Methods: | [no command available] |
d) Help -> Transform Hints: | [no command available] |
e) Help -> Selection Hints: | [no command available] |

### Citing iCn3D:

|  | Wang J, Youkharibache P, Zhang D, Lanczycki CJ, Geer RC, Madej T, Phan L, Ward M, Lu S, Marchler GH, Wang Y, Bryant SH, Geer LY, Marchler-Bauer A. iCn3D, a Web-based 3D Viewer for Sharing 1D/2D/3D Representations of Biomolecular Structures. Bioinformatics. 2020 Jan 1;36(1):131-135. (Epub 2019 June 20.) doi: 10.1093/bioinformatics/btz502. [PubMed PMID: 31218344] [Full Text at Oxford Academic] |  |
|  | Wang J, Youkharibache P, Marchler-Bauer A, Lanczycki C, Zhang D, Lu S, Madej T, Marchler GH, Cheng T, Chong LC, Zhao S, Yang K, Lin J, Cheng Z, Dunn R, Malkaram SA, Tai C-H, Enoma D, Busby B, Johnson NL, Tabaro F, Song G, Ge Y. iCn3D: From Web-Based 3D Viewer to Structural Analysis Tool in Batch Mode. Front. Mol. Biosci. 2022 9:831740. (Epub 2022 Feb 17.) doi: 10.3389/fmolb.2022.831740. [PubMed PMID: 35252351] [Full Text at Frontiers] |  |

### iCn3D source code:

- GitHub (browser)
- npm (Node.js)
- pypi (Jupyter Notebook)

### Develop

### How to embed iCn3D Structure Viewer in your html page:

- Embed using iframe

  To embed iCn3D Structure Viewer in your own HTML page using iframe, simply add the following to your page. Note the URL should be the original URL with commands, not the shorten share link.

  `<iframe allowFullScreen="true" src="https://www.ncbi.nlm.nih.gov/Structure/icn3d/full.html?mmdbid=1tup&width=300&height=300&showcommand=0&shownote=0&mobilemenu=1&showtitle=0" width="320" height="320" style="border:none"></iframe>`
- Embed as a Web Server
  1. Go to iCn3D GitHub page: github.com/ncbi/icn3d
  2. Download the zip file near "Complete Package", e.g., https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d-3.4.9.zip
  3. Copy all unzipped files to your server directory, e.g., "http://[domain name]/icn3d".
  4. Launch iCn3D in your server, e.g., http://[domain name]/icn3d.
- Embed as a Javascript Widget

  To embed iCn3D Structure Viewer in your own HTML page using the distribution files on NCBI servers, simply follow these 3 steps. Note the changes to iCn3D version 3 are colored in red. (To embed multiple iCn3D viewers, see the source code of the example page for reference)

  1. Include the CSS and JavaScript libraries in the <head> of your html page, as shown here.

      <link rel="stylesheet" href="https://www.ncbi.nlm.nih.gov/Structure/icn3d/lib/jquery-ui.min.css">
      <link rel="stylesheet" href="https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d.css">
      <script src="https://www.ncbi.nlm.nih.gov/Structure/icn3d/lib/jquery.min.js"></script>
      <script src="https://www.ncbi.nlm.nih.gov/Structure/icn3d/lib/jquery-ui.min.js"></script>
      <script src="https://www.ncbi.nlm.nih.gov/Structure/icn3d/lib/threeClass.min.js"></script>
      <script src="https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d.min.js"></script>

  2. Position the widget with an html div

            <div id="icn3dwrap"></div>

  The widget will be rendered inside of the div.
  3. Initialize the widget with desired parameters:

        <script type="text/javascript">
          $( document ).ready(async function() {
                var cfg = {
                    divid: 'icn3dwrap',
                    width: '100%',
                    height: '100%',
                    resize: true,
                    rotate: 'right',
                    mobilemenu: true,
                    showcommand: false,
                    showtitle: false
                };
                cfg['mmdbid'] = '1tup';

                var icn3dui = new icn3d.iCn3DUI(cfg);

                //communicate with the 3D viewer with chained functions
                await icn3dui.show3DStructure();
                //icn3dui.setOption('color', 'cyan');
          });
        </script>

### Data Structure

- Atom Object

      var atomDetails = {
          serial: serial,         // required, unique atom id
          structure: structure,   // required, used to identify the structure
          chain: chain,           // required, used to identify the chain
          resi: resi,             // required, used to identify residue ID, has to be a integer
          name: atom,             // required, atom name
          coord: coord,           // required, used to draw 3D shape
          coord2: ribbonCoord,    // optional, ribbon's real positions, used to draw stabilizers for 3D printing
          bonds: [],              // required, used to connect atoms

          color: color,           // optional, used to assign atom color, default is grey
          style: style,           // optional, used to assign atom style as one of 13 styles: ribbon, strand, cylinder and plate,
                                  //   nucleotide cartoon, o3' trace, schematic, c alpha trace, b factor tube, lines, stick,
                                  //   ball and stick, sphere, dot, nothing
          style2: sideChainStyle, // optional, used to assign protein side chain style as one of 13 styles: ribbon, strand, cylinder and plate,
                                  //   nucleotide cartoon, o3' trace, schematic, c alpha trace, b factor tube, lines, stick,
                                  //   ball and stick, sphere, dot, nothing
          het: false,             // optional, used to determine chemicals, water, ions, etc
          resn: resn,             // optional, used to determine protein or nucleotide
          b: b,                   // optional, used to draw B-factor tube
          elem: elem,             // optional, used to determine hydrogen bond
          ss: 'coil',             // optional, used to show secondary structures
          ssbegin: false,         // optional, used to show the beginning of secondary structures
          ssend: false            // optional, used to show the end of secondary structures
      }

- Data required from the input to set up 3D viewer

      atoms: {};          // REQUIRED, all atoms in the input: atom index => atom details, ONLY THIS HASH STORE ALL ATOM DETAILS
      dAtoms: {};         // REQUIRED, atoms used to display: atom index => 1
      pmin: pmin;         // REQUIRED, the position with minimum x,y,z
      pmax: pmax;         // REQUIRED, the position with maximum x,y,z
      cnt: cnt;           // REQUIRED, total number of atoms
      maxD: pmax.distanceTo(pmin);             // REQUIRED, max dimension of the structure
      center: psum.multiplyScalar(1.0 / cnt);  // REQUIRED, center position of the structure

      hAtoms: {};         // OPTIONAL, atoms used to highlight: atom index => 1
      structures: {};         // OPTIONAL, structure name => array of chain IDs
      chains: {};           // OPTIONAL, structure_chain name => (atom index => 1)
      residues: {};          // OPTIONAL, structure_chain_resi name => (atom index => 1)

      chainsSeq: {};        // OPTIONAL, structure_chain name => array of residue object: {"name":[residue name], "resi": [residue number]}
      chainsAn: {};         // OPTIONAL, structure_chain name => array of annotation
      chainsAnTitle: [];    // OPTIONAL, the titles for the array of annotation
      molTitle: "";       // OPTIONAL, ID and name
      hbondpnts: [];      // OPTIONAL, array of positions of hydrogen bond
      ssbondpnts: {};     // OPTIONAL, structure name => positions of disulfide bonds
      residueId2Name: {}; // OPTIONAL, structure_chain_resi => one letter abbreviation

      proteins: {};       // OPTIONAL, proteins: atom index => 1
      sidec: {};          // OPTIONAL, protein sidechains: atom index => 1
      calphas: {};        // OPTIONAL, protein C alphas: atom index => 1
      nucleotides: {};    // OPTIONAL, DNA, RNA: atom index => 1
      nucleotidesO3: {};  // OPTIONAL, DNA, RNA O3': atom index => 1
      chemicals: {};        // OPTIONAL, chemicals: atom index => 1
      ions: {};           // OPTIONAL, ions: atom index => 1
      water: {};          // OPTIONAL, water: atom index => 1

### Class Structure

iCn3D uses JavaScript classes starting from version 3.0.0. In both the browser version (GitHub) and the Node.js version (npm), a global variable "icn3d" is used to access all classes in iCn3D. As shown in the table below, the variable "icn3d" can access the class "iCn3DUI" (with the instance "icn3dui"). The instance "icn3dui" can access all util classes (e.g., "icn3d.icn3dui.utilsCls") and two major classes "iCn3D" (with the instance "icn3d", which is different from the global variable "icn3d") and "Html" (with the instance "htmlCls"), which can access all the rest classes. For example, the class "AlignSeq" (with the instance "alignSeqCls") can be called using "icn3d.icn3dui.htmlCls.alignSeqCls". All class names except "icn3dui" and "icn3d" start with an upper-case letter.
Since static functions are not supported in Safari, all classes (e.g., "AlignSeq") don't have static functions. The instance names of the classes convert the first letter to lower-case and add the postfix "Cls" (e.g., "alignSeqCls"). Each class has its own file with the file name the same as the class name with the first letter lower-case (e.g., "alignSeq.js").
Each function in classes in the directory "icn3d" has a variable "ic" to represent the instance "icn3d". "ic.icn3dui" can be used to represent the instance "icn3dui".
Each function in classes in the directory "html" has a variable "me" to represent the instance "icn3dui". "me.icn3d" can be used to represent the instance "icn3d".

Global | Class (directory) | Class (directory) | Class (directory) | Functions
--- | --- | --- | --- | ---
icn3d | icn3dui (src) | utilsCls (utils) |  | setIcn3d, setDialogAjax
icn3d | icn3dui | utilsCls (utils) |  | isIE, isMobile, isMac, isSessionStorageSupported, hexToRgb, isCalphaPhosOnly, hasCovalentBond, residueName2Abbr, residueAbbr2Name, getJSONFromArray, checkFileAPI, getIdArray, compResid, toggle, setViewerWidthHeight
icn3d | icn3dui | hashUtilsCls (utils) |  | cloneHash, intHash, exclHash, unionHash, unionHashInPlace, unionHashNotInPlace, intHash2Atoms, exclHash2Atoms, unionHash2Atoms, hash2Atoms, hashvalue2array
icn3d | icn3dui | parasCls (utils) |  | Parameters: glycanHash, nucleotidesArray, ionsArray, cationsTrimArray, anionsTrimArray, ionCharges, vdwRadii, covalentRadii, surfaces, atomColors, defaultAtomColor, stdChainColors, backgroundColors, residueColors, residueArea, defaultResidueColor, chargeColors, hydrophobicColors, ssColors, ssColors2, b62ResArray, b62Matrix Functions: thr
icn3d | icn3dui | myEventCls (utils) |  | onId, onIds
icn3d | icn3dui | subdivideCls (utils) |  | subdivide, getKnot, getValueFromKnot
icn3d | icn3dui | rmsdSuprCls (utils) |  | getRmsdSuprCls, eigen_values, null_basis, getEigenForSelection, getEigenVectors
icn3d | icn3dui | convertTypeCls (utils) |  | passFloat32, passInt8, passInt16, passInt32, getUint8View, getDataView, getView, getBlobFromBufferAndText
icn3d | icn3dui (src) | htmlCls (html) |  | N/A
icn3d | icn3dui | htmlCls | alignSeqCls (html) | getAlignSequencesAnnotations
icn3d | icn3dui | htmlCls | clickMenuCls (html) | clickMenu1, clickMenu2, clickMenu3, clickMenu4, clickMenu5, clickMenu6, setLogCmd
icn3d | icn3dui | htmlCls | dialogCls (html) | openDlg, addSaveButton, addHideButton, getDialogStatus, openDlgHalfWindow, openDlg2Ddgm, openDlgRegular, openDlgNotebook
icn3d | icn3dui | htmlCls | eventsCls (html) | fullScreenChange, allEventFunctions
icn3d | icn3dui | htmlCls | setDialogCls (html) | setCustomDialogs, setDialogs
icn3d | icn3dui | htmlCls | setHtmlCls (html) | getLink, getLinkWrapper, getRadio, getRadioColor, setAdvanced, getOptionHtml, setColorHints, setThicknessHtml, setSequenceGuide, setAlignSequenceGuide, getSelectionHints, addGsizeSalt, getFootHtml, getPotentialHtml, exportPqr, clickReload_pngimage, setLineThickness, updateSurfPara, exportPdb
icn3d | icn3dui | htmlCls | setMenuCls (html) | setTopMenusHtml, setTopMenusHtmlMobile, setReplayHtml, setTools, setButton, setTools_base, setTheme, setLogWindow, setMenu1, setMenu1_base, setMenu2, setMenu2_base, setMenu2b, setMenu2b_base, setMenu3, setMenu3_base, setMenu4, setMenu4_base, setMenu5, setMenu5_base, setMenu6, setMenu6_base, hideMenu, showMenu
icn3d | icn3dui (src) | icn3d (icn3d) |  | init, init_base, reinitAfterLoad, resetConfig
icn3d | icn3dui | icn3d | analysisCls (analysis) | calculateArea, calcBuriedSurface, measureDistTwoSets, addLine, addLineFromPicking, addLabel, addChainLabels, addTerminiLabels
icn3d | icn3dui | icn3d | applySymdCls (analysis) | applySymd, applySymmetry
icn3d | icn3dui | icn3d | delphiCls (analysis) | CalcPhiUrl, CalcPhi, PhiParser, loadPhiData, loadCubeData, applyCommandPhi, applyCommandDelphi, loadDelphiFile, loadPhiFile, loadPhiFileUrl
icn3d | icn3dui | icn3d | diagram2dCls (analysis) | draw2Ddgm, set2DdgmNote, highlightNode, removeLineGraphSelection, removeScatterplotSelection, click2Ddgm, selectInteraction, selectInteractionAtoms, draw2DProtein, draw2DNucleotide, draw2DChemical
icn3d | icn3dui | icn3d | cartoon2dCls (analysis) | draw2Dcartoon, click2Dcartoon
icn3d | icn3dui | icn3d | dsspCls (analysis) | applyDssp, parseDsspData
icn3d | icn3dui | icn3d | scapCls (analysis) | applyCommandScap, adjust2DWidth, retrieveScap
icn3d | icn3dui | icn3d | symdCls (analysis) | applyCommandSymd, retrieveSymd, getResObj, setSeqAlignForSymmetry, retrieveSymmetry, getPolygonColor, getAxisColor
icn3d | icn3dui | icn3d | addTrackCls (annotations) | clickAddTrackButton, showNewTrack, alignSequenceToStructure, defineSecondary, simplifyText, checkGiSeq, getFullText, setCustomFile
icn3d | icn3dui | icn3d | annoCddSiteCls (annotations) | showCddSiteAll, setDomainFeature, showAnnoType, setToolTip
icn3d | icn3dui | icn3d | annoContactCls (annotations) | showInteraction, showInteraction_base
icn3d | icn3dui | icn3d | annoPTMCls (annotations) | showPTM
icn3d | icn3dui | icn3d | annoCrossLinkCls (annotations) | showCrosslink, showCrosslink_base
icn3d | icn3dui | icn3d | annoDomainCls (annotations) | showDomainPerStructure, showDomainAll, showDomainWithData
icn3d | icn3dui | icn3d | annoSnpClinVarCls (annotations) | navClinVar, showClinVarLabelOn3D, getSnpLine, processSnpClinvar, showClinvarPart2, showSnp, showClinvar, showSnpClinvar, showSnpPart2, processNoClinvar, processNoSnp
icn3d | icn3dui | icn3d | annoSsbondCls (annotations) | showSsbond, showSsbond_base
icn3d | icn3dui | icn3d | annoTransMemCls (annotations) | showTransmem, showTransmem_base
icn3d | icn3dui | icn3d | annotationCls (annotations) | hideAllAnno, hideAllAnnoBase, setAnnoSeqBase, setAnnoTabBase, setAnnoTabAll, hideAnnoTabAll, resetAnnoAll, resetAnnoTabAll, setAnnoTabCustom, hideAnnoTabCustom, setAnnoTabClinvar, hideAnnoTabClinvar, setAnnoTabSnp, hideAnnoTabSnp, setAnnoTabCdd, hideAnnoTabCdd, setAnnoTab3ddomain, hideAnnoTab3ddomain, setAnnoTabSite, hideAnnoTabSite, setAnnoTabInteraction, hideAnnoTabInteraction, setAnnoTabSsbond, hideAnnoTabSsbond, setAnnoTabCrosslink, hideAnnoTabCrosslink, setAnnoTabTransmem, hideAnnoTabTransmem, setTabs, clickCdd, showAnnoSelectedChains, showAnnoAllChains, setAnnoView, setAnnoDisplay, showFixedTitle, hideFixedTitle, setAnnoViewAndDisplay, updateClinvar, updateSnp, updateDomain, updateInteraction, updatPTM, updateSsbond, updateCrosslink, updateTransmem
icn3d | icn3dui | icn3d | showAnnoCls (annotations) | showAnnotations, showAnnoSeqData, getAnnotationData, getSequenceData, getCombinedSequenceData, processSeqData, enableHlSeq, getAnDiv, addButton, addSnpButton, conservativeReplacement, getColorhexFromBlosum62
icn3d | icn3dui | icn3d | showSeqCls (annotations) | showSeq, insertGap, insertGapOverview, setAlternativeSeq, getProteinName
icn3d | icn3dui | icn3d | alternateCls (display) | alternateStructures, alternateWrapper
icn3d | icn3dui | icn3d | applyCenterCls (display) | applyCenterOptions, setRotationCenter, setCenter, centerSelection, centerAtoms, setWidthHeight
icn3d | icn3dui | icn3d | applyClbondsCls (display) | applyClbondsOptions, applyClbondsOptions_base
icn3d | icn3dui | icn3d | applyDisplayCls (display) | applyDisplayOptions, selectMainChainSubset
icn3d | icn3dui | icn3d | applyOtherCls (display) | applyOtherOptions, applyChemicalbindingOptions, updateStabilizer, getResidueRepPos
icn3d | icn3dui | icn3d | applySsbondsCls (display) | applySsbondsOptions
icn3d | icn3dui | icn3d | cameraCls (display) | setCamera
icn3d | icn3dui | icn3d | drawCls (display) | draw, applyTransformation, render
icn3d | icn3dui | icn3d | fogCls (display) | setFog
icn3d | icn3dui | icn3d | sceneCls (display) | rebuildScene, rebuildSceneBase
icn3d | icn3dui | icn3d | setColorCls (display) | setColorByOptions, setAtmClr, updateChainsColor, setMmdbChainColor, setConservationColor, applyOriginalColor, applyPrevColor, setOutlineColor
icn3d | icn3dui | icn3d | setOptionCls (display) | setOption, setStyle, saveStyle, applySavedStyle, saveColor, applySavedColor
icn3d | icn3dui | icn3d | setStyleCls (display) | setStyle2Atoms, setAtomStyleByOptions, setBackground, saveCommandsToSession, getCommandsBeforeCrash, handleContextLost, adjustIcon
icn3d | icn3dui | icn3d | export3DCls (export) | exportStlFile, exportVrmlFile, getFaceCnt, saveStlFile, updateArray, processStlMeshGroup, saveVrmlFile, processVrmlMeshGroup
icn3d | icn3dui | icn3d | saveFileCls (export) | saveFile, saveSvg, getSvgXml, savePng, exportCustomAtoms, getAtomPDB, getSelectedResiduePDB, getPDBHeader, showTitle, getLinkToStructureSummary, setEntrezLinks
icn3d | icn3dui | icn3d | shareLinkCls (export) | shareLink, shareLinkUrl, getPngText
icn3d | icn3dui | icn3d | threeDPrintCls (export) | setThichknessFor3Dprint, prepareFor3Dprint, resetAfter3Dprint, removeOneStabilizer, outputSelection, addStabilizer, hideStabilizer, getResidueRepAtom
icn3d | icn3dui | icn3d | axesCls (geometry) | buildAxes, buildAllAxes, createArrow, setPc1Axes
icn3d | icn3dui | icn3d | boxCls (geometry) | createBox, createBox_base, createBoxRepresentation_P_CA
icn3d | icn3dui | icn3d | brickCls (geometry) | createBrick
icn3d | icn3dui | icn3d | cartoonNuclCls (geometry) | drawStrandNucleicAcid, drawNucleicAcidStick
icn3d | icn3dui | icn3d | curveCls (geometry) | createCurveSub
icn3d | icn3dui | icn3d | curveStripArrowCls (geometry) | createCurveSubArrow, createStripArrow, prepareStrand
icn3d | icn3dui | icn3d | cylinderCls (geometry) | createCylinder, createCylinder_base, createCylinderHelix, createCylinderCurve
icn3d | icn3dui | icn3d | glycanCls (geometry) | showGlycans
icn3d | icn3dui | icn3d | impostorCls (geometry) | setParametersForShader , drawImpostorShader , getShader , createImpostorShaderBase, createImpostorShaderCylinder, createImpostorShaderSphere, clearImpostors
icn3d | icn3dui | icn3d | instancingCls (geometry) | positionFromGeometry, colorFromGeometry, indexFromGeometry, normalFromGeometry, drawSymmetryMates, applyMat, drawSymmetryMatesNoInstancing, createInstancedGeometry, getInstancedMaterial, createInstancedMesh, drawSymmetryMatesInstancing
icn3d | icn3dui | icn3d | labelCls (geometry) | makeTextSprite, createLabelRepresentation, hideLabels
icn3d | icn3dui | icn3d | lineCls (geometry) | createLineRepresentation, createConnCalphSidechain, createSingleLine, createLines
icn3d | icn3dui | icn3d | reprSubCls (geometry) | createRepresentationSub
icn3d | icn3dui | icn3d | residueLabelsCls (geometry) | addResidueLabels, addNonCarbonAtomLabels, addAtomLabels
icn3d | icn3dui | icn3d | sphereCls (geometry) | createSphere, createSphereBase, createSphereRepresentation
icn3d | icn3dui | icn3d | stickCls (geometry) | createStickRepresentation
icn3d | icn3dui | icn3d | strandCls (geometry) | createStrand, getSSExpandedAtoms
icn3d | icn3dui | icn3d | stripCls (geometry) | createStrip, setCalphaDrawnCoord
icn3d | icn3dui | icn3d | tubeCls (geometry) | createTube, getCustomtubesize, createTubeSub, getRadius
icn3d | icn3dui | icn3d | hlObjectsCls (highlight) | addHlObjects, removeHlObjects
icn3d | icn3dui | icn3d | hlSeqCls (highlight) | selectSequenceNonMobile, selectSequenceMobile, selectChainMobile, selectTitle, selectResidues
icn3d | icn3dui | icn3d | hlUpdateCls (highlight) | update2DdgmContent, changeSeqColor, removeHlAll, removeHlObjects, removeHlSeq, removeHl2D, removeHlMenus, updateHlAll, updateHlObjects, updateHlSeq, updateHlSeqInChain, updateHl2D, updateHlMenus, hlSequence, hlSeqInChain, toggleHighlight, clearHighlight, showHighlight, highlightChains, hlSummaryDomain3ddomain, updateHlAll
icn3d | icn3dui | icn3d | contactCls (interaction) | getAtomsWithinAtom, getNeighboringAtoms, getExtent, hideContact
icn3d | icn3dui | icn3d | drawGraphCls (interaction) | drawGraph
icn3d | icn3dui | icn3d | getGraphCls (interaction) | getGraphData, drawResNode, getNodeTopBottom, updateGraphJson, updateGraphColor, handleForce, getNodesLinksForSet, getHbondLinksForSet, getIonicLinksForSet, getHalogenPiLinksForSet, getContactLinksForSet, getContactLinks, compNode, getGraphLinks, convertLabel2Resid
icn3d | icn3dui | icn3d | hBondCls (interaction) | isHbondDonorAcceptor, calcAngles, calcPlaneAngle, isValidHbond, calculateChemicalHbonds, setHbondsContacts, hideHbonds
icn3d | icn3dui | icn3d | lineGraphCls (interaction) | drawLineGraph, drawLineGraph_base, drawScatterplot_base, copyStylesInline
icn3d | icn3dui | icn3d | piHalogenCls (interaction) | calculateHalogenPiInteractions, getHalogenDonar, getHalogenAcceptor, getPi, getCation, getHalogenPiInteractions, getRingNormal, getAromaticRings, dfs_cycle, getAromaticPisLigand, hideHalogenPi
icn3d | icn3dui | icn3d | saltbridgeCls (interaction) | calculateIonicInteractions, hideSaltbridge
icn3d | icn3dui | icn3d | showInterCls (interaction) | showInteractions, showHbonds, showHydrogens, hideHydrogens, hideHbondsContacts, showIonicInteractions, showHalogenPi, showClbonds, showSsbonds, pickCustomSphere, pickCustomSphere_base
icn3d | icn3dui | icn3d | viewInterPairsCls (interaction) | viewInteractionPairs, clearInteractions, resetInteractionPairs, retrieveInteractionData, getAllInteractionTable, getInteractionPerResidue, getInteractionPairDetails, getContactPairDetails, exportInteractions, exportSsbondPairs, exportClbondPairs, exportHbondPairs, exportSaltbridgePairs, exportHalogenPiPairs, exportSpherePairs
icn3d | icn3dui | icn3d | alignParserCls (parsers) | downloadAlignment, downloadAlignmentPart2, loadOpmDataForAlign
icn3d | icn3dui | icn3d | chainalignParserCls (parsers) | downloadChainalignmentPart2, downloadChainalignmentPart3, downloadChainalignment, parseChainAlignData, loadOpmDataForChainalign
icn3d | icn3dui | icn3d | densityCifParserCls (parsers) | densityCifParser, parseChannels, getChannel, CIFParse, BinaryParse, MessagePackParse
icn3d | icn3dui | icn3d | dsn6ParserCls (parsers) | dsn6Parser, dsn6ParserBase, loadDsn6Data, getMatrix, loadDsn6File, loadDsn6FileUrl
icn3d | icn3dui | icn3d | loadAtomDataCls (parsers) | loadAtomDataIn
icn3d | icn3dui | icn3d | loadPDBCls (parsers) | loadPDB, adjustSeq, setSsbond, getChainCalpha
icn3d | icn3dui | icn3d | mmcifParserCls (parsers) | downloadMmcif, downloadMmcifSymmetry, loadMmcifData
icn3d | icn3dui | icn3d | mmdbParserCls (parsers) | parseMmdbData, downloadMmdb, downloadBlast_rep_id, loadMmdbOpmData
icn3d | icn3dui | icn3d | mmtfParserCls (parsers) | downloadMmtf, parseMmtfData
icn3d | icn3dui | icn3d | mol2ParserCls (parsers) | loadMol2Data, loadMol2AtomData
icn3d | icn3dui | icn3d | opmParserCls (parsers) | downloadOpm, loadOpmData, setOpmData, parseAtomData
icn3d | icn3dui | icn3d | ParserUtilsCls (parsers) | alignCoords, getMissingResidues, set2DDiagramsForAlign, set2DDiagramsForChainalign, parse2DDiagramsData, set2DDiagrams, showLoading, hideLoading, setYourNote, transformToOpmOri, transformToOpmOriForAlign, addOneDumAtom, addMemAtoms, setMaxD, renderStructure
icn3d | icn3dui | icn3d | pdbParserCls (parsers) | downloadPdb, downloadUrl, loadPdbData, loadPdbDataRender
icn3d | icn3dui | icn3d | realignParserCls (parsers) | realign, parseChainRealignData, realignOnSeqAlign, realignChainOnSeqAlign
icn3d | icn3dui | icn3d | sdfParserCls (parsers) | downloadCid, loadSdfData, loadSdfAtomData
icn3d | icn3dui | icn3d | setSeqAlignCls (parsers) | setSeqAlign, setSeqAlignChain, setSeqAlignForRealign, setSeqPerResi
icn3d | icn3dui | icn3d | xyzParserCls (parsers) | loadXyzData, setXyzAtomSeq, loadXyzAtomData
icn3d | icn3dui | icn3d | controlCls (picking) | setControl, mouseMove
icn3d | icn3dui | icn3d | pickingCls (picking) | showPicking, showPickingBase, showPickingHilight, select3ddomainFromAtom, selectStrandHelixFromAtom
icn3d | icn3dui | icn3d | rayCls (picking) | rayCasterBase, isIntersect, getAtomsFromPosition
icn3d | icn3dui | icn3d | applyCommandCls (selection) | applyCommand, setStrengthPara, getThresholdNameArrays, setQueryresi2score, getMenuFromCmd
icn3d | icn3dui | icn3d | definedSetsCls (selection) | setProtNuclLigInMenu, setPredefinedInMenu, setAtomMenu, setChainsInMenu, setTransmemInMenu, showSets, clickCustomAtoms, deleteSelectedSets, changeCustomAtoms, setHAtomsFromSets, updateAdvancedCommands, combineSets, commandSelect, clickCommand_apply, selectCombinedSets, clickModeswitch, setModeAndDisplay, setMode, getAtomsFromOneSet, getAtomsFromSets, getAtomsFromNameArray
icn3d | icn3dui | icn3d | firstAtomObjCls (selection) | getFirstAtomObj, getFirstCalphaAtomObj, getFirstAtomObjByName, getLastAtomObj, getResiduesFromAtoms, getResiduesFromCalphaAtoms, getChainsFromAtoms, getAtomFromResi, getAtomCoordFromResi
icn3d | icn3dui | icn3d | loadScriptCls (selection) | loadScript, execCommands, execCommandsBase, pressCommandtext, applyCommandLoad, applyCommandMap, applyCommandEmmap, applyCommandRealign, applyCommandGraphinteractionBase, applyCommandGraphinteraction, applyCommandAnnotationsAndCddSite, applyCommandClinvarBase, applyCommandSnpBase, applyCommandClinvar, applyCommandSnp, applyCommand3ddomainBase, applyCommand3ddomain, applyCommandViewinteractionBase, applyCommandViewinteraction, renderFinalStep, replayFirstStep
icn3d | icn3dui | icn3d | resid2specCls (selection) | residueids2spec, atoms2spec, atoms2residues, selectProperty, selectComplement, switchHighlightLevel, switchHighlightLevelUp, switchHighlightLevelDown
icn3d | icn3dui | icn3d | selectByCommandCls (selection) | selectByCommand, selectBySpec
icn3d | icn3dui | icn3d | selectionCls (selection) | selectAll, selectAll_base, selectAChain, selectResidueList, selectMainChains, selectSideChains, selectMainSideChains, clickShow_selected, clickHide_selected, getGraphDataForDisplayed, updateSelectionNameDesc, addCustomSelection, showSelection, hideSelection, saveSelection, removeSelection, resetAll, loadSelection, oneStructurePerWindow, showAll, saveSelectionIfSelected, saveSelectionPrep, selectOneResid, toggleSelection, toggleMembrane, adjustMembrane, selectBtwPlanes
icn3d | icn3dui | icn3d | applyMapCls (surface) | applySurfaceOptions, applyMapOptions, applyEmmapOptions, applyPhimapOptions, applyphisurfaceOptions, removeSurfaces, removeLastSurface, removeMaps, removeEmmaps, removePhimaps, removeLastMap, removeLastEmmap, removeLastPhimap
icn3d | icn3dui | icn3d | electronMapCls (surface) | getFacesAndVertices, initparm, transformMemPro, fillvoxels, buildboundary, marchingcubeinit, counter, marchingcube
icn3d | icn3dui | icn3d | marchingCubeCls (surface) | march, laplacianSmooth
icn3d | icn3dui | icn3d | proteinSurfaceCls (surface) | getVDWIndex, inOrigExtent, getFacesAndVertices, initparm, boundingatom, fillvoxels, fillAtom, fillvoxelswaals, fillAtomWaals, buildboundary, fastdistancemap, fastoneshell, marchingcubeinit, counter, marchingcube
icn3d | icn3dui | icn3d | surfaceCls (surface) | createSurfaceRepresentation, transformMemPro, SetupSurface, SetupMap
icn3d | icn3dui | icn3d | resizeCanvasCls (transform) | resizeCanvas, windowResize, openFullscreen, rotStruc, back, forward, replayon, replayoff, closeDialogs
icn3d | icn3dui | icn3d | transformCls (transform) | resetOrientation, rotateLeft , rotateRight , rotateUp , rotateDown , rotate_base , setRotation, translateLeft, translateRight, translateUp, translateDown, translate_base, zoomIn, zoomOut, zoominSelection, getTransformationStr

### Add New Classes

To contribute new classes to iCn3D, you can follow the example of "module.html". You need to do the following steps:

1. Comment out icn3d library: <!--script src="icn3d.min.js"></script-->
2. Script type should be "module": <script type="module">
3. Import iCn3D module: "import * as icn3d from './icn3d.module.js';"
4. Import your custom class (e.g., "LoadStateFile"): "import {LoadStateFile} from './loadStateFile.js';"
5. Remove "$( document ).ready(async function() {" and the coresponding "//});" since module will always be run after the document is ready.
6. Call your class after the function "await icn3dui.show3DStructure()". You first define the class instance "loadStateFileCls" and pass the iCn3D instance "icn3dui.icn3d". Then call the functions of your class.

           var loadStateFileCls = new LoadStateFile(icn3dui.icn3d);
           loadStateFileCls.loadStateFile('color spectrum');

7. Your custom class could look like the following.

           // import any classes from icn3d.module.js to be used in your class
           import {LoadScript} from './icn3d.module.js';

           // class name starts with a upper-case letter
           class LoadStateFile {
               // pass the instance of the class iCn3D
               constructor(icn3d) {
                   this.icn3d = icn3d;
               }

               // functions start with a lower-case letter
               // use "ic" to access the instance of iCn3D class
               loadStateFile(fileStr) { var ic = this.icn3d;
                   // "ic" has a lot of class instances such as "loadScriptCls"
                   ic.loadScriptCls.loadScript(fileStr, true);
               }
           }

           // export your class
           export {LoadStateFile}

8. Install static-server and run "static-server -i module.html -o" to test your code. "import" and "export" do not work in "file://" protocol.
9. Specify the ID of the structure in the URL, e.g., "localhost:9080/module.html?mmdbid=1kq2".

### Modify Functions in Classes

To modify functions in some classes of iCn3D, you can follow the example of "example.html". You can add the modified functions after the line containing "icn3d.min.js". The line to define the function starts with the global variable "icn3d", then the class name (e.g., "Picking"), then the keyword "prototype", then the function name. One example is as follows:

        icn3d.Picking.prototype.showPicking = function(atom, x, y) { var ic = this.icn3d, me = ic.icn3dui;
            // 1. copy the function showPicking() here
            // 2. Modify the function as if it is in the class "Picking"
        }

### RESTful APIs

delphi.cgi
The "DelPhi" program from the Honig lab calculates electrostatic potentials. It was licensed to be used in iCn3D by Columbia University. A typical use of the API https://www.ncbi.nlm.nih.gov/Structure/delphi/delphi.cgi is to post data to this API with a few parameters. The parameter "pdb2pqr" inputs the Protein Data Bank (PDB) string and outputs the PQR string with atom partial charge and atom size. The parameters "pdb2phi" and "pqr2phi" input the PDB string or PQR string, respectively, and both output the calculated potential. The parameters "gsize" and "salt" are used to define the grid size and salt concentration (M), respectively. The parameter "cube" is used to output the potential in the text format, not the default binary format.
scap.cgi
The "scap" program from the Honig lab predicts side chains due to mutations. A typical use of the API https://www.ncbi.nlm.nih.gov/Structure/scap/scap.cgi is to post data to this API with a few parameters. The parameters "pdb" and "snp" input the PDB string and the SNP in the format "[chain ID],[residue number],[mutant]". For example, "A,10,K" means that the residue with a residue number 10 in the chain A will be mutated to Lys. The parameter "json=1" outputs the mutant's PDB string in the JSON format.
tmalign.cgi
The "TM-align" program from the Zhang lab aligns two structures. A typical use of the API https://www.ncbi.nlm.nih.gov/Structure/tmalign/tmalign.cgi is to post data to this API with two parameters: "pdb_query" and "pdb_target", which are the query and target PDB files, respectively.
symd.cgi
The "SymD" program from NCI determines symmetries in structures. A typical use of the API https://www.ncbi.nlm.nih.gov/Structure/symd/symd.cgi is to post a PDB string to this API with the parameter "pdb". The output is a JSON blob describing the symmetry.
cdannots.fcgi
The "cdannots.fcgi" backend returns conserved domains and binding sites information from NCBI in JSON format. An example use of the API is https://www.ncbi.nlm.nih.gov/Structure/cdannots/cdannots.fcgi?fmt&live=lcl&queries=1KQ2_A,22219082,Q76EI6. The input is a list of accessions such as NCBI protein accession, NCBI gi, or UniProt IDs. The parsing code is in the file https://github.com/ncbi/icn3d/blob/master/src/icn3d/annotations/annoCddSite.js.

### Codeathon Contributors

- 2016 NCBI Codeathon (Organizers: Ben Busby)
  - Visualizations of SNPs and Protein Interaction Data:
    Jiyao Wang, Eric Weitz, Peter Meric, Rajeeva Lochan Musunuri, Elise Flynn, and Ben Busby
- 2016 ISMB Codeathon (Organizers: Ben Busby and Philippe Youkharibache)
  - 2D Interaction Schematic:
    Qiangling Li, Spencer Bliven, Eli Draizen, Jose Duarte, Keiichiro Oto, Tim Schaefer, Jiyao Wang, and Philippe Youkharibache
  - Use MMTF in iCn3D:
    Jiyao Wang, and Alexander S. Rose
- 2020 ISMB Codeathon (Organizers: Ravinder Abrol, Philippe Youkharibache, and Allissa Dillman)
  - iCn3D in Jupyter Notebook:
    Jiyao Wang, Ben Busby, Nicholas Johnson, Francesco Tabaro, David Enoma, Jiyao Wang, Guangfeng Song, and Yuchen Ge
  - Differential analysis of viral protein sequence variants interactions with host proteins:
    Philippe Youkharibache, Adriaan Ludl, Mingzhang Yang, Yuchen Ge, Yuk Kei Wan, Ariel Aptekmann, Awtum Brashear, Xavier Watkins, Tom Madej, and Jiyao Wang
  - ExoDATA:
    Raul Cachau, Giulia Babbi, Matthew Sinnott, Todd Smith, and Francesco Tabaro
- 2020 NCBI Codeathon
  - Variation Analysis and Visualization of SARS-CoV-2 sequences in GenBank:
    Brad Holmes, Jiyao Wang, Vichet Hem, Eric Cox, Kurtis Haro, and Carl Leubsdorf, Jr.
- 2020 STRIDES Codeathon (Organizer: Allissa Dillman)
  - View SNPs in 3D, Dynamic Symmetry Calculation:
    Jiyao Wang, Rachel Dunn, Sridhar Acharya Malkaram, Chin-Hsien Tai, Thomas Madej, and David Enoma
- 2021 ISMB Codeathon (Organizers: Ravinder Abrol, Philippe Youkharibache, and Allissa Dillman)
  - 2D Cartoons:
    Jiyao Wang, Li Chuin Chong, Kevin Yang, Sarah Zhao, Zhiyu Cheng, and Jack Lin
  - ProteoMaps:
    Philippe Youkharibache, Matteo Manfredi, Chiragkumar Patel, Stephanie Byrum, and Raul Cachau
  - SARS2 antibody interface analysis:
    Marcus Mendes, Mahita Jarjapu, Henry Webel, and David Bell
  - Molecular Sentry:
    Todd Smith, Sandra Porter, Elzbieta Gralinska, Sachendra Kumar, Giovanni Madeo, Luis Jaimes Santiago, and Sheela Vemu
- 2022 Antibody Engineers Codeathon (Organizers: Sandra Porter, Todd Smith, and Allissa Dillman)
  - Antibody Engineers - iCn3D:
    Todd Smith, Jiyao Wang, Ami Johanson, Chetna Patel, David Menshew, Kate Johnston, Madhavan Narayanan, Khalid Tantawi, Nik Tsotakos, Selena Lu, and Christain John Ventura
  - Break an Antibody:
    Margaret Bryans, Andrew Givone, Hetal Doshi, Savita, David Menshew, Feather Ives, and Annie
  - Anti-SARS vs variants:
    Sandra Porter, Arshdeep Kaur, Ben Bekey, Uwe Hilgert, Erica Lannan, and Michelle Stieber
- 2022 ISMB Codeathon (Organizers: Ravinder Abrol, Philippe Youkharibache, Allissa Dillman, and Alexa Salsbury)
  - Annotations in iCn3D:
    Jiyao Wang, Raphael Trevizani, Sachendra Kumar, and Li Chuin Chong
  - Differential analysis of residue interactions of a SNP based on side chain prediction:
    Zachery Mielko, Kailash Adhikari, David Bell, Jiyao Wang, Marina Herrera Sarrias, and Ravinder Abrol
  - Visualizing the effect of SNPs extracted from genomic data on protein structure using iCn3D:
    Bonface Onyango, Manoj M Wagle, Michael Sierk, and Pranavathiyani G
  - Standardization of Ig datasets using universal numbering system and auto generating Bridged 1D maps:
    Umesh Khaniya, Chirag Patel, Caesar Tawfeeq, Siddhi Jani, Sujitkumar, Prasanthkumar, and Philippe Youkharibache
  - ImmunoZoo - Making iCn3D accessble for many audiences:
    Sandra Porter, Todd Smith, Sheela Vemu, Carsten Fortmann-Grote, Yagoub Adam, Shikha Kathrani, and Jack Lin
  - Analysis of multiple structures for automatic capture of conformational changes:
    Tom Madej, David Bell, Chase Freschlin, Gabby Vent, and Lianna Khachikyan

### Help Doc:

www.ncbi.nlm.nih.gov/Structure/icn3d/docs/icn3d_help.html