TITLE: Fitting PDB files to SAXS data using FOXS web server
AUTHORS: Chris Berndsen

[DESCRIPTION]
<div class = "text-blocks"><div class = "text-block">FOXS is a server for fitting models to SAXS data. It can also predict the SAXS data for protein models in the absence of SAXS data. </div><div class = "text-block">Schneidman-Duhovny D, Hammel M, Tainer JA, and Sali A. Accurate SAXS profile computation and its assessment by contrast variation experiments. Biophysical Journal 2013. 105 (4), 962-974 </div><div class = "text-block">Schneidman-Duhovny D, Hammel M, Tainer JA, and Sali A. FoXS, FoXSDock and MultiFoXS: Single-state and multi-state structural modeling of proteins and their complexes based on SAXS profiles NAR 2016</div></div>

[STEPS]
?. [.dat file]
To perform this analysis you will need subtracted SAXS data in a .dat file that has the structure shown below:
?. [.dat file]
If you do not have subtracted SAXS data see the protocol on SCATTER or ATSAS to generate this file.
?. [Loading the data into webserver]
Navigate to the FOXS webserver
?. [Loading the data into webserver]
Provide the PDB file to be fit for the Input Molecule option.
This can be provided as a PDB code, a PDB file, or a zipped file of PDB. This latter option is appropriate for fitting structures from molecular dynamics simulations.
?. [Loading the data into webserver]
Provide the experimental data set as a .dat file in the Experimental Profile box.
?. [Loading the data into webserver]
Record the input files:  AB1PDB file2Experimental profile file
AB1PDB file2Experimental profile file
?. [Loading the data into webserver]
Advanced options can also be set. These options are useful for fitting to energy minimized structures or ones from simulations.Options to set:Maximal q: If data are bad at high q, reduce this valueImplicit hydrogens: Uncheck if hydrogens are in the PDB file(s)Offset: Add a constant offset when fitting. This option should be used when fitting.
?. [Loading the data into webserver]
Press Submit Form and wait 1 to 30 minutes depending on the number of structures to be fitted.
?. [Analyzing fitted profile]
The results are shown in three regions:Top left side shows a fit of the PDB to the dataTop right is visualization of the PDBBottom table showing statistics of the fit
?. [Analyzing fitted profile]
The data table is ranked by Χ2 values which range from infinity to 1, with 1 being the target value.
Ideally the Χ2 value would be ~1 with c1 and c2 values ~1 and no more than 4. If either of the c1 or c2 is red, this suggests some issue with the fitting.
?. [Analyzing fitted profile]
Record the numbers of the top 5 fits.  ABCDEF1X^2c1c2Rgfile_name2132435465
ABCDEF1X^2c1c2Rgfile_name2132435465
?. [Analyzing fitted profile]
A useful visuaization of the data is plotting Χ2 vs. Rg (radius of gyration). However, the table can be quite large and hard to record by hand. The code below runs in R and will "scrape" the table from the web into a .csv file.Paste the URL into the spot listed as "web link from FOXS" and change the protein name and data set name in "proteinname_datasetname_FOXS.csv" as appropriate.# Packages needed to scrape library(rvest) library(tidyverse)  # Assign web link to the variable "page" page # Pull the table nodes from the page tbl %      html_nodes("table") %>%  # isolate the 7th table which is the data table      .[7] %>%  # make it a table file      html_table(fill = TRUE)   # convert the list into a data frame tbl_df # Write a csv file to the working directory. write.csv(tbl_df, "proteinname_datasetname_FOXS.csv")
Sometimes the table is the 6th element in the page, if the data table does not look correct, change the .[7] to .[6]
?. [Analyzing fitted profile]
Record the name and location of the FOXS table as a note on this step.
?. [Analyzing fitted profile]
Click on the fit file link for any structures that fit particularly well.
?. [Analyzing fitted profile]
Record the location of the fit files as a note on this step.
?. [multi-FOXS]
If multiple PDB files were provided for fitting, FOXS will also run multi-FOXS which tries combinations of PDB files to produce a better fit. This can reveal the conformational ensemble of the molecule in solution.These results can be access by clicking the multi-FOXS link.
?. [multi-FOXS]
Record any multi-FOXS results as a note on this step.