#How to obtain coordinates of sampling spots?
First of all, you need to settle upon a type of visualization you want to achieve. Namely, sampling spots can be rendered onto a picture or 3D model. Below you will find a manual for these two cases.
A common remark: on this page "sample name" means a file name without extension where spectral information about an LC-MS sample is stored. E.g. if you have a file with LC-MS called
PA14_EM_D-6_2738.mzML, a corresponding sample name will be
- Create an empty spreadsheet in a spreadsheet software of your choice.
- Ultimately, you will fill in the first four columns with the following information (order matters): sample name, x coordinate, y coordinate, z coordinate and sampling spot radius. So, you need to type any column names in the first row according to this structure, e.g. "sample", "x", "y", "z", "radius". Then, each sampling point will correspond to a row in this table.
- Fill in the first column with names of your samples.
- Fill in the fourth column with zeros. As you are going to render your sampling points onto a 2D image, the 3rd coordinate component is not used.
- Open an image you are going to use for visualization in an image viewer application that is capable of displaying a cursor position in the coordinate system of an image. E.g. Paint suits this task on Windows.
- For each sample, fill in the second and third columns with
ycoordinates of a sample you see in the image viewer when hovering cursor over a point where the sample is located.
- Fill in the fifth column with approximate values of radii of sampling points. You can do it using your image viewer to estimate, for example, half of a difference between boundaries of a sampling point in a horizontal or vertical dimension.
- No need in high precision at this stage because you will be able to change the file later after you see the first visualization.
- Save the spreadsheet as a CSV file.
- Download and install Meshlab, an application for working with 3D models, from the official downloads page.
- Launch Meshlab, go to
File => Import mesh...and select a file with your 3D model.
- After the model has shown up, call a dialog for point selection using
Edit => PickPoints.
- Select all sampling points on the 3D model one by one using mouse right click. Note, that, once selected, points appear in the dialog you opened at the previous step. Also, you will need to assign names to selected points that should correspond to names of your samples. To change a name of a point double-click on the corresponding item in the dialog and type a new name.
- After all points are selected and names of your samples are assigned to them, you need to click "Save" in the dialog and select a result file.
If you are doing signal processing with Optimus and want to visualize result LC-MS features in `ili you can use the *.pp file produced by Meshlab as input for an Optimus node reading coordinates. Otherwise, you have two options to generate a CSV table with coordinates of the sampling points.
- KNIME workflow. It might be convenient if you already have KNIME installed.
- Download and open in KNIME [a workflow](./PP2CSV Conversion.zip) for conversion of files produced by Meshlab to CSV files compatible with Optimus.
- Select a path to an output CSV file in the configuration of
Save output filenode.
- In the configuration dialog of
Convert PP to CSVnode, select the file produced by Meshlab as a first parameter. You may keep the default value of the second parameter, sampling point radii. After you get the first visualization, you will be able to rerun the workflow to generate larger or smaller sampling points. Also, it is possible to change the radii manually in the result CSV file produced by the workflow.
- Run the workflow to generate the CSV file with coordinates of sampling spots.
- Python script.
- Download a python script from this repository.
- Run it using the following command:
python pp2csv.py <path to the *.pp file created with Meshlab> <sampling point radius>. After you get the first visualization, you will be able to rerun the script to generate larger or smaller sampling points. Also, it is possible to change the radii manually in the result CSV file produced by the script.
- A file
coords.csvwill appear in your working directory.