Description Usage Arguments Details Value Author(s) Examples
If given a data frame, exportTable
exports the whole
data frame to file. This could be a data frame of any form. A few options
are available that can be used to determine the format of the file that is
exported, e.g. using a heading for the row names 'column', or omitting row
names altogether.
If a ddpcrWell
is given, exportTable
exports to
a single file with specified/all classification methods.
If a ddpcrPlate
is given, exportTable
exports to a directory in the given location
, where one file is
created for each of the wells. If it does not exist, the directory
location
will be created as long as all other parent directories
exist.
exportZip
takes a ddpcrPlate
object and
exports it as a zip file.
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 | exportTable(theObject, location, delim = ",", ...)
## S4 method for signature 'data.frame'
exportTable(
theObject,
location,
delim = ",",
leadingColName = NULL,
row.names = TRUE
)
## S4 method for signature 'ddpcrWell'
exportTable(theObject, location, delim = ",", cMethod = NULL)
## S4 method for signature 'ddpcrPlate'
exportTable(
theObject,
location,
delim = ",",
cMethod = NULL,
prefix = "",
suffix = "_Amplitude.csv"
)
exportZip(
theObject,
location,
delim = ",",
cMethod = NULL,
prefix = "",
suffix = "_Amplitude.csv"
)
## S4 method for signature 'ddpcrPlate'
exportZip(
theObject,
location,
delim = ",",
cMethod = NULL,
prefix = "",
suffix = "_Amplitude.csv"
)
|
theObject |
The dataframe to export. |
location |
The location to export to. This should be a filename if we
are using |
delim |
The character to use as a field separator. Defaults to ",", i.e. export a CSV. |
... |
Other options depending on the type of |
leadingColName |
The name of the leading column, i.e. the 'row names'
of the dataframe. This could be a patient identifier or the well used in the
ddPCR experiment. If |
row.names |
If |
cMethod |
The name or column number of the classification methods in
a |
prefix |
For |
suffix |
For |
Note that filenames of the form Anything_A01_Amplitude.csv
can be read by readCSVDataFrame
so that the well name can be
extracted successfully (in this case A01
). Where it is used, see the
default value of the parameter suffix
.
Exports a file.
Anthony Chiu, anthony.chiu@cruk.manchester.ac.uk
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 51 52 53 54 | ## Output to a temporary directory.
tmpOut <- file.path(normalizePath(tempdir()))
## Read some counts data and generate a summary data frame.
df <- fullCountsSummary(KRAScountsQS)
summaryDf <- fullCopiesSummary(df)
## Write the summary to a CSV file.
exportTable(summaryDf, file.path(tmpOut, "summary-table.csv"))
## Write the summary to a tab-separated text file.
exportTable(summaryDf, file.path(tmpOut, "summary-table.txt"), delim="\t")
## Write the summary to a CSV file with leading column labelled "Patient".
exportTable(summaryDf, file.path(tmpOut, "summary-table.csv"),
leadingColName="Patient")
## Read a droplet amplitude CSV file to a ddpcrWell object.
ampFile <- system.file("extdata", "amplitudes", "sample_B03_Amplitude.csv",
package="twoddpcr")
aWell <- ddpcrWell(well=ampFile)
## Classify the droplets into 4 clusters.
aWell <- kmeansClassify(aWell, centres=4)
## Write the amplitudes to a CSV file with the old and new classifications.
exportTable(aWell,
location=file.path(tmpOut, "With_Kmeans_B03_Amplitude.csv"))
## Write the amplitudes to a CSV file with the new classification only.
exportTable(aWell,
location=file.path(tmpOut, "With_Kmeans_B03_Amplitude.csv"),
cMethod="kmeans")
## Read all amplitude files in a directory to a ddpcrPlate object.
moreAmpsDir <- system.file("extdata", "more-amplitudes", package="twoddpcr")
krasPlate <- ddpcrPlate(wells=moreAmpsDir)
## Classify the droplets into 4 clusters.
krasPlate <- kmeansClassify(krasPlate, centres=4)
## Write the amplitudes to multiple files in a directory with the old and
## new classifications.
exportTable(krasPlate, location=file.path(tmpOut, "amplitudes-classified"))
## Write the amplitudes to multiple files with the new classification only
## and a custom prefix for the filenames.
exportTable(krasPlate, location=file.path(tmpOut, "amplitudes-classified"),
cMethod="kmeans", prefix="Kmeans_Only_")
## Export to a zip file.
exportZip(krasPlate,
location=file.path(tmpOut, "amplitudes-classified/all.zip"),
cMethod="kmeans", prefix="Kmeans_Only_")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.