-
Notifications
You must be signed in to change notification settings - Fork 0
/
Raman2imzML_test.Rmd
51 lines (40 loc) · 2.16 KB
/
Raman2imzML_test.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
---
title: "Raman2imzML.Rmd"
output: pdf_document
---
Usage
The converter currently supports two types of text file formats coming from Renishaw and WiTec. To do so, the package has two different functions: WiRe_convert() and FIVE_convert().
WiRe 5.2
To convert a WiRe text file into an imzML just do as follows in your R session terminal or script:
```{r}
#Set paths
txt_path <- "~/path/to/txt/file.txt"
imzML_path <- "~/path/to/imzML/folder/"
#Converter call
Raman2imzML::WiRe_convert(txt_path = txt_path,
imzML_path = imzML_path)
#You can also just input the text file path and the imzML file is going to be created in the same folder
Raman2imzML::WiRe_convert(txt_path = txt_path)
```
FIVE 5.1
To transform FIVE data into an imzML you first need to export two different text files. One containing the run info and another containing the whole imaging data table. Sometimes, the raman shift axis of the data table file is wrong. To solve this the converter accepts a third text file in which, the spectrum of a single pixel is recorded which normally has the correct raman shift axis.
To convert the text files into an imzML just do as follows in your R session terminal or script:
```{r}
#Set paths
info_txt_path <- "~/path/to/info/txt/file.txt"
table_txt_path <- "~/path/to/table/txt/file.txt"
spectrum_txt_path <- "~/path/to/spectrum/txt/file.txt" # Only if raman shift axis in table is wrong
imzML_path <- "~/path/to/imzML/folder/"
# Converter call
Raman2imzML::FIVE_convert(info_txt_path = info_txt_path,
table_txt_path = table_txt_path,
imzML_path = imzML_path)
# Converter call with spectrum file
Raman2imzML::FIVE_convert(info_txt_path = info_txt_path,
table_txt_path = table_txt_path,
spectrum_txt_path = spectrum_txt_path,
imzML_path = imzML_path)
#You can also just input the text file path and the imzML file is going to be created in the same folder
Raman2imzML::FIVE_convert(info_txt_path = info_txt_path,
table_txt_path = table_txt_path)
```