-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 049f8f9
Showing
68 changed files
with
24,094 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# History files | ||
.Rhistory | ||
.Rapp.history | ||
|
||
# Session Data files | ||
.RData | ||
.RDataTmp | ||
|
||
# User-specific files | ||
.Ruserdata | ||
|
||
# Example code in package build process | ||
*-Ex.R | ||
|
||
# Output files from R CMD build | ||
/*.tar.gz | ||
|
||
# Output files from R CMD check | ||
/*.Rcheck/ | ||
|
||
# RStudio files | ||
.Rproj.user/ | ||
|
||
# produced vignettes | ||
vignettes/*.html | ||
vignettes/*.pdf | ||
|
||
# OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3 | ||
.httr-oauth | ||
|
||
# knitr and R markdown default cache directories | ||
*_cache/ | ||
/cache/ | ||
|
||
# Temporary files created by R markdown | ||
*.utf8.md | ||
*.knit.md | ||
|
||
# R Environment Variables | ||
.Renviron | ||
|
||
# pkgdown site | ||
docs/ | ||
|
||
# translation temp files | ||
po/*~ | ||
|
||
# RStudio Connect folder | ||
rsconnect/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"hash": "127e0c74e08b57523f8019ce51a35998", | ||
"result": { | ||
"markdown": "---\ntitle: \"FluorPLA\"\n---\n\n\n## Quarto\n\nQuarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see <https://quarto.org>.\n\n\n::: {.cell}\n\n```{.r .cell-code}\n1 + 1\n```\n\n::: {.cell-output .cell-output-stdout}\n```\n[1] 2\n```\n:::\n:::\n", | ||
"supporting": [], | ||
"filters": [ | ||
"rmarkdown/pagebreak.lua" | ||
], | ||
"includes": {}, | ||
"engineDependencies": {}, | ||
"preserve": {}, | ||
"postProcess": true | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
.quarto/_freeze/supplementary_fig02/execute-results/html.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"hash": "ee3e66bb65c1abd229894992e738c549", | ||
"result": { | ||
"markdown": "---\ntitle: \"supplementary_fig02\"\nauthor: \"Daniel Fürth\"\nformat: html\n---\n\n\n## Create a table of raw data files\n\nThe raw data text files are in the folder `./data/lc/`.\nLets list the content of that folder:\n\n::: {.cell}\n\n```{.r .cell-code}\nfolder <- './data/lc'\nfiles <- dir(folder)\nfiles\n```\n\n::: {.cell-output .cell-output-stdout}\n```\n [1] \"Azido_PEG_tetrazine_chromatogram_280nm.txt\"\n [2] \"Azido_PEG_tetrazine_MS.txt\" \n [3] \"DBCO488_chromatogram_280nm.txt\" \n [4] \"DBCO488_MS.txt\" \n [5] \"DBCO594_chromatogram_280nm.txt\" \n [6] \"DBCO594_MS.txt\" \n [7] \"RXN488_chromatogram_280nm.txt\" \n [8] \"RXN488_MS.txt\" \n [9] \"RXN594_chromatogram_280nm.txt\" \n[10] \"RXN594_MS.txt\" \n```\n:::\n:::\n\nWe have two types of files: `MS` and `chromatogram`. Lets check the presence of string `MS` and `chromatogram` in the filenames using `grepl()` command and make a boolean index based on it:\n\n::: {.cell}\n\n```{.r .cell-code}\nms <- grepl(\"MS\", files)\nchromatogram <- grepl(\"chromatogram\", files)\n```\n:::\n\nLets make a data frame object, `myfiles`, that stores all info about our files including the full file path:\n\n::: {.cell}\n\n```{.r .cell-code}\nmyfiles<-data.frame(folder, files, ms, chromatogram)\n#show the data frame in console\nmyfiles\n```\n\n::: {.cell-output .cell-output-stdout}\n```\n folder files ms chromatogram\n1 ./data/lc Azido_PEG_tetrazine_chromatogram_280nm.txt FALSE TRUE\n2 ./data/lc Azido_PEG_tetrazine_MS.txt TRUE FALSE\n3 ./data/lc DBCO488_chromatogram_280nm.txt FALSE TRUE\n4 ./data/lc DBCO488_MS.txt TRUE FALSE\n5 ./data/lc DBCO594_chromatogram_280nm.txt FALSE TRUE\n6 ./data/lc DBCO594_MS.txt TRUE FALSE\n7 ./data/lc RXN488_chromatogram_280nm.txt FALSE TRUE\n8 ./data/lc RXN488_MS.txt TRUE FALSE\n9 ./data/lc RXN594_chromatogram_280nm.txt FALSE TRUE\n10 ./data/lc RXN594_MS.txt TRUE FALSE\n```\n:::\n\n```{.r .cell-code}\n#get the names of the the variables\nnames(myfiles)\n```\n\n::: {.cell-output .cell-output-stdout}\n```\n[1] \"folder\" \"files\" \"ms\" \"chromatogram\"\n```\n:::\n:::\n\nadd full file paths:\n\n::: {.cell}\n\n```{.r .cell-code}\nmyfiles$path<-dir(folder, full.names=TRUE)\n#get the names of the the variables\nnames(myfiles)\n```\n\n::: {.cell-output .cell-output-stdout}\n```\n[1] \"folder\" \"files\" \"ms\" \"chromatogram\" \"path\" \n```\n:::\n:::\n\n\n## Running Code\n\nWhen you click the **Render** button a document will be generated that includes both content and the output of embedded code. You can embed code like this:\n\n\n::: {.cell}\n\n```{.r .cell-code}\n1 + 1\n```\n\n::: {.cell-output .cell-output-stdout}\n```\n[1] 2\n```\n:::\n:::\n\n\nYou can add options to executable code like this \n\n\n::: {.cell}\n::: {.cell-output .cell-output-stdout}\n```\n[1] 4\n```\n:::\n:::\n\n\nThe `echo: false` option disables the printing of code (only output is displayed).\n", | ||
"supporting": [ | ||
"supplementary_fig02_files" | ||
], | ||
"filters": [ | ||
"rmarkdown/pagebreak.lua" | ||
], | ||
"includes": {}, | ||
"engineDependencies": {}, | ||
"preserve": {}, | ||
"postProcess": true | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
.quarto/_freeze/supplementary_fig02/execute-results/md.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"hash": "7aa29be84029e763510164e63ad578cb", | ||
"result": { | ||
"markdown": "---\ntitle: \"supplementary_fig02\"\nauthor: \"Daniel Fürth\"\nformat: gfm\n---\n\n\n## Create a table of raw data files\n\nThe raw data text files are in the folder `./data/lc/`.\nLets list the content of that folder:\n\n::: {.cell}\n\n```{.r .cell-code}\nfolder <- './data/lc'\nfiles <- dir(folder)\nfiles\n```\n\n::: {.cell-output .cell-output-stdout}\n```\n [1] \"Azido_PEG_tetrazine_chromatogram_280nm.txt\"\n [2] \"Azido_PEG_tetrazine_MS.txt\" \n [3] \"DBCO488_chromatogram_280nm.txt\" \n [4] \"DBCO488_MS.txt\" \n [5] \"DBCO594_chromatogram_280nm.txt\" \n [6] \"DBCO594_MS.txt\" \n [7] \"RXN488_chromatogram_280nm.txt\" \n [8] \"RXN488_MS.txt\" \n [9] \"RXN594_chromatogram_280nm.txt\" \n[10] \"RXN594_MS.txt\" \n```\n:::\n:::\n\nWe have two types of files: `MS` and `chromatogram`. Lets check the presence of string `MS` and `chromatogram` in the filenames using `grepl()` command and make a boolean index based on it:\n\n::: {.cell}\n\n```{.r .cell-code}\nms <- grepl(\"MS\", files)\nchromatogram <- grepl(\"chromatogram\", files)\n```\n:::\n\nLets make a data frame object, `myfiles`, that stores all info about our files including the full file path:\n\n::: {.cell}\n\n```{.r .cell-code}\nmyfiles<-data.frame(folder, files, ms, chromatogram)\n#show the data frame in console\nmyfiles\n```\n\n::: {.cell-output .cell-output-stdout}\n```\n folder files ms chromatogram\n1 ./data/lc Azido_PEG_tetrazine_chromatogram_280nm.txt FALSE TRUE\n2 ./data/lc Azido_PEG_tetrazine_MS.txt TRUE FALSE\n3 ./data/lc DBCO488_chromatogram_280nm.txt FALSE TRUE\n4 ./data/lc DBCO488_MS.txt TRUE FALSE\n5 ./data/lc DBCO594_chromatogram_280nm.txt FALSE TRUE\n6 ./data/lc DBCO594_MS.txt TRUE FALSE\n7 ./data/lc RXN488_chromatogram_280nm.txt FALSE TRUE\n8 ./data/lc RXN488_MS.txt TRUE FALSE\n9 ./data/lc RXN594_chromatogram_280nm.txt FALSE TRUE\n10 ./data/lc RXN594_MS.txt TRUE FALSE\n```\n:::\n\n```{.r .cell-code}\n#get the names of the the variables\nnames(myfiles)\n```\n\n::: {.cell-output .cell-output-stdout}\n```\n[1] \"folder\" \"files\" \"ms\" \"chromatogram\"\n```\n:::\n:::\n\nadd full file paths:\n\n::: {.cell}\n\n```{.r .cell-code}\nmyfiles$path<-dir(folder, full.names=TRUE)\n#get the names of the the variables\nnames(myfiles)\n```\n\n::: {.cell-output .cell-output-stdout}\n```\n[1] \"folder\" \"files\" \"ms\" \"chromatogram\" \"path\" \n```\n:::\n:::\n\n\n## Import the data\n\nNext lets import a chromatogram file. We can open the file manually and find that on line 76 we have the text `Raw data:` followed by the data in TSV format. \n```\n76 Raw Data:\n77 Time(min)\tStep(sec)\tValue(mAU)\n78 0.000000\t0.00\t0.000000\t\n79 0.001667\t0.10\t0.000030\t\n80 0.003333\t0.10\t0.000580\t\n81 0.005000\t0.10\t0.002410\t\n```\nWe can simply then import the data into a data frame by adding `skip = 76` and the `read.table()`command will skip all the line suntil line 77. If we also add `header=TRUE` we will import the variable names into the header of the data frame.\n\n\n::: {.cell}\n\n```{.r .cell-code}\ndata<-read.table(myfiles$path[1], skip=76, header=TRUE)\nhead(data) #just show the first 6 lines of the table, tail() command shows the last 6 lines.\n```\n\n::: {.cell-output .cell-output-stdout}\n```\n Time.min. Step.sec. Value.mAU.\n1 0.000000 0.0 0.00000\n2 0.001667 0.1 0.00003\n3 0.003333 0.1 0.00058\n4 0.005000 0.1 0.00241\n5 0.006667 0.1 0.00534\n6 0.008333 0.1 0.00690\n```\n:::\n:::\n\n\nLets plot the chromatogram as a line plot:\n\n::: {.cell}\n\n```{.r .cell-code}\nplot(data$Time.min., data$Value.mAU., type='l')\n```\n\n::: {.cell-output-display}\n![](supplementary_fig02_files/figure-commonmark/unnamed-chunk-6-1.png)\n:::\n:::\n\n\n# Make a master data frame with all data.\n\nLets examine the different files we have from the chromatogram:\n\n::: {.cell}\n\n```{.r .cell-code}\nmyfiles[myfiles$chromatogram,]\n```\n\n::: {.cell-output .cell-output-stdout}\n```\n folder files ms chromatogram\n1 ./data/lc Azido_PEG_tetrazine_chromatogram_280nm.txt FALSE TRUE\n3 ./data/lc DBCO488_chromatogram_280nm.txt FALSE TRUE\n5 ./data/lc DBCO594_chromatogram_280nm.txt FALSE TRUE\n7 ./data/lc RXN488_chromatogram_280nm.txt FALSE TRUE\n9 ./data/lc RXN594_chromatogram_280nm.txt FALSE TRUE\n path\n1 ./data/lc/Azido_PEG_tetrazine_chromatogram_280nm.txt\n3 ./data/lc/DBCO488_chromatogram_280nm.txt\n5 ./data/lc/DBCO594_chromatogram_280nm.txt\n7 ./data/lc/RXN488_chromatogram_280nm.txt\n9 ./data/lc/RXN594_chromatogram_280nm.txt\n```\n:::\n:::\n\nWe can see that the sample name preceeds the first `_` in the file name so lets add a variable `sample` with that text string:\n\n::: {.cell}\n\n```{.r .cell-code}\n#split the string by _ character\nunderscore_split<-strsplit( myfiles$files, \"_\")\nunderscore_split\n```\n\n::: {.cell-output .cell-output-stdout}\n```\n[[1]]\n[1] \"Azido\" \"PEG\" \"tetrazine\" \"chromatogram\" \"280nm.txt\" \n\n[[2]]\n[1] \"Azido\" \"PEG\" \"tetrazine\" \"MS.txt\" \n\n[[3]]\n[1] \"DBCO488\" \"chromatogram\" \"280nm.txt\" \n\n[[4]]\n[1] \"DBCO488\" \"MS.txt\" \n\n[[5]]\n[1] \"DBCO594\" \"chromatogram\" \"280nm.txt\" \n\n[[6]]\n[1] \"DBCO594\" \"MS.txt\" \n\n[[7]]\n[1] \"RXN488\" \"chromatogram\" \"280nm.txt\" \n\n[[8]]\n[1] \"RXN488\" \"MS.txt\"\n\n[[9]]\n[1] \"RXN594\" \"chromatogram\" \"280nm.txt\" \n\n[[10]]\n[1] \"RXN594\" \"MS.txt\"\n```\n:::\n:::\n\nHere `underscore_split` is a list object where each file name is an entry in the list and it then has a nested list within where text between each \"_\" is entered as a single entry. We can then extract the first entry from each list using `lapply()`\"list apply\" function:\n\n::: {.cell}\n\n```{.r .cell-code}\n# Create a new list 'sample.name' by applying a function to each element of 'underscore_split'\nsample.name <- lapply(underscore_split, function(x) {\n return(x[1]) # Return the first element (index 1) of each element in 'underscore_split'\n})\n\n# Display the resulting 'sample.name' list\nsample.name\n```\n\n::: {.cell-output .cell-output-stdout}\n```\n[[1]]\n[1] \"Azido\"\n\n[[2]]\n[1] \"Azido\"\n\n[[3]]\n[1] \"DBCO488\"\n\n[[4]]\n[1] \"DBCO488\"\n\n[[5]]\n[1] \"DBCO594\"\n\n[[6]]\n[1] \"DBCO594\"\n\n[[7]]\n[1] \"RXN488\"\n\n[[8]]\n[1] \"RXN488\"\n\n[[9]]\n[1] \"RXN594\"\n\n[[10]]\n[1] \"RXN594\"\n```\n:::\n\n```{.r .cell-code}\n# Check class of the object\nclass(sample.name)\n```\n\n::: {.cell-output .cell-output-stdout}\n```\n[1] \"list\"\n```\n:::\n:::\n\nHere `sample.name`is a object with the class list. If we now want to go from list object to a character vector to insert it into our data frame we can do like this:\n\n::: {.cell}\n\n```{.r .cell-code}\nmyfiles$sample<-unlist(sample.name)\nmyfiles\n```\n\n::: {.cell-output .cell-output-stdout}\n```\n folder files ms chromatogram\n1 ./data/lc Azido_PEG_tetrazine_chromatogram_280nm.txt FALSE TRUE\n2 ./data/lc Azido_PEG_tetrazine_MS.txt TRUE FALSE\n3 ./data/lc DBCO488_chromatogram_280nm.txt FALSE TRUE\n4 ./data/lc DBCO488_MS.txt TRUE FALSE\n5 ./data/lc DBCO594_chromatogram_280nm.txt FALSE TRUE\n6 ./data/lc DBCO594_MS.txt TRUE FALSE\n7 ./data/lc RXN488_chromatogram_280nm.txt FALSE TRUE\n8 ./data/lc RXN488_MS.txt TRUE FALSE\n9 ./data/lc RXN594_chromatogram_280nm.txt FALSE TRUE\n10 ./data/lc RXN594_MS.txt TRUE FALSE\n path sample\n1 ./data/lc/Azido_PEG_tetrazine_chromatogram_280nm.txt Azido\n2 ./data/lc/Azido_PEG_tetrazine_MS.txt Azido\n3 ./data/lc/DBCO488_chromatogram_280nm.txt DBCO488\n4 ./data/lc/DBCO488_MS.txt DBCO488\n5 ./data/lc/DBCO594_chromatogram_280nm.txt DBCO594\n6 ./data/lc/DBCO594_MS.txt DBCO594\n7 ./data/lc/RXN488_chromatogram_280nm.txt RXN488\n8 ./data/lc/RXN488_MS.txt RXN488\n9 ./data/lc/RXN594_chromatogram_280nm.txt RXN594\n10 ./data/lc/RXN594_MS.txt RXN594\n```\n:::\n:::\n\nYou can see how we now have a variable `myfiles$sample` with all the sample names:\n\n::: {.cell}\n\n```{.r .cell-code}\nmyfiles$sample\n```\n\n::: {.cell-output .cell-output-stdout}\n```\n [1] \"Azido\" \"Azido\" \"DBCO488\" \"DBCO488\" \"DBCO594\" \"DBCO594\" \"RXN488\" \n [8] \"RXN488\" \"RXN594\" \"RXN594\" \n```\n:::\n:::\n\nSome stats, showing that each sample has two files (one `MS` and one `chromatogram`):\n\n::: {.cell}\n\n```{.r .cell-code}\ntable(myfiles$sample)\n```\n\n::: {.cell-output .cell-output-stdout}\n```\n\n Azido DBCO488 DBCO594 RXN488 RXN594 \n 2 2 2 2 2 \n```\n:::\n:::\n\n\nLets create a new data frame called `trace` where we have all the traces from each experiment into one file:\n\n::: {.cell}\n\n```{.r .cell-code}\n#create an empty data frame where we will store our data\ntrace<-data.frame(sample = character(), time = numeric(), value = numeric())\n\n#loop through each chromatogram file and load it in and add it to trace data frame\nfor(i in which(myfiles$chromatogram)){\n tmp<-read.table(myfiles$path[i], skip=76, header=TRUE)\n \n trace.tmp<-data.frame(\n sample = myfiles$sample[i], \n time = tmp$Time.min, \n value = tmp$Value.mAU\n )\n \n #add the just loaded file into master data frame, trace\n trace <- rbind(trace, trace.tmp)\n}\n```\n:::\n\n\nLets check the new data frame `trace`:\n\n\n::: {.cell}\n\n```{.r .cell-code}\ntable(trace$sample)\n```\n\n::: {.cell-output .cell-output-stdout}\n```\n\n Azido DBCO488 DBCO594 RXN488 RXN594 \n 1801 1801 1801 1801 1801 \n```\n:::\n:::\n\nSo we have each sample loaded with 1801 measurements in each.\n\n# Make a plot\n\n\n::: {.cell}\n\n```{.r .cell-code}\nmysamples<- rev(unique(trace$sample)) #reverse order because we want reactions RXN at bottom so one reads the graph top to bottom.\n\nscale.factor.y <- 1.2 #adds some space between lines when we stack them on top. \ntext.under.y <- 0.2 #placement of the text label under the trace. \ntext.under.x <- 0.1 #placement of the text label under the trace. \n\n\nplot(trace$time[trace$sample == mysamples[1]], \n trace$value[trace$sample == mysamples[1]], \n type='l',\n xlab='Time',\n ylab='',\n ylim=c(-max(trace$value)*text.under.y, scale.factor.y*max(trace$value)*length(mysamples))\n )\n\nfor(i in seq_along(mysamples)){\n #k is a variable that adds some space for sample 3 and above so the two reactions are vertically seperated from the rest.\n if(i > 2){\n k <- 280\n }else{\n k <- 0\n }\n lines(trace$time[trace$sample == mysamples[i]], \n trace$value[trace$sample == mysamples[i]]+scale.factor.y*max(trace$value)*(i-1)+k, col=i )\n \n text(max(trace$time)*text.under.x, scale.factor.y*max(trace$value)*(i-1)-max(trace$value)*text.under.y+k, mysamples[i], col=i)\n}\n```\n\n::: {.cell-output-display}\n![](supplementary_fig02_files/figure-commonmark/unnamed-chunk-15-1.png)\n:::\n:::\n", | ||
"supporting": [ | ||
"supplementary_fig02_files" | ||
], | ||
"filters": [ | ||
"rmarkdown/pagebreak.lua" | ||
], | ||
"includes": {}, | ||
"engineDependencies": {}, | ||
"preserve": null, | ||
"postProcess": false | ||
} | ||
} |
Binary file added
BIN
+35.6 KB
.quarto/_freeze/supplementary_fig02/figure-commonmark/unnamed-chunk-15-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+28.7 KB
.quarto/_freeze/supplementary_fig02/figure-commonmark/unnamed-chunk-6-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.