ExportFilesForGViz | R Documentation |
Export data as files that can be directly used with Gviz Package (making tracks + displaying). Except for gff3 format, all available format allows streaming while making and displaying tracks with Gviz package. Multiple objects can be exported at the same time. All arguments (except "dnastringsetGenome" argument) must have the same length.
ExportFilesForGViz( dnastringsetGenome, cFileNames, listObjects, cFileFormats, cBigwigParameters = rep(NA, length(cFileNames)), lBigwigParametersByStrand = rep(NA, length(cFileNames)), cBamXaParameters = rep(NA, length(cFileNames)) )
dnastringsetGenome |
A DNAStringSet object containing the sequence for each contig. |
cFileNames |
A character vector giving the names of the files to be exported. |
listObjects |
A list of objects to be exported. Required format of the objects is described in "cFileFormats" argument documentation. |
cFileFormats |
A character vector giving the format for each file to be exported. The following exportation formats are supported:
|
cBigwigParameters |
A character vector describing the name of the parameter to be stored in bigwig files. Must correspond to the name of a column in the provided Granges object. Use NA as value in the vector if the associated file is not to be exported as a bigwig. Defaults to "rep(NA, length(cFileNames)))" |
lBigwigParametersByStrand |
A logical vector: if TRUE, the bigwig parameter will be negative for each range that is located on the reverse strand in the GRanges object provided. Use NA as value in the vector if the associated file is not to be exported as a bigwig. Defaults to "rep(NA, length(cFileNames)))" |
cBamXaParameters |
A character vector describing a parameter to be stored as a "Xa" optional field in the exported bam file. Use NA as value in the vector if the associated file is not to be exported as a bam. If the exported file is a bam and if the value is NA or NULL, the bam will be exported without the "Xa" optional field. Defaults to "rep(NA, length(cFileNames)))" |
# loading genome myGenome <- Biostrings::readDNAStringSet(system.file( package = "DNAModAnnot", "extdata", "ptetraurelia_mac_51_sca171819.fa" )) # Preparing a grangesPacBioCSV dataset myGposPacBioCSV <- ImportPacBioCSV( cPacBioCSVPath = system.file( package = "DNAModAnnot", "extdata", "ptetraurelia.bases.sca171819.csv" ), cSelectColumnsToExtract = c( "refName", "tpl", "strand", "base", "score", "ipdRatio", "coverage" ), lKeepExtraColumnsInGPos = TRUE, lSortGPos = TRUE, cContigToBeAnalyzed = names(myGenome) ) ## NOT RUN! ## Export files for Gviz # ExportFilesForGViz(dnastringsetGenome = myGenome, # cFileNames = c("ipdRatio_for_each_A.bw", # "score_for_all_bases.bw", # "newFastaOnlyscaffold51_17.fa"), # listGRangesObjects = c(myGposPacBioCSV[myGposPacBioCSV$base == "A"], # myGposPacBioCSV, # myGenome["scaffold51_17"]), # cFileFormats = c("bw", "bw", "fa"), # cBigwigParameters = c("ipdRatio", "score", NA), # lBigwigParametersByStrand = c(TRUE, TRUE, NA), # cBamXaParameters = c(NA, NA, NA)) # loading annotation library(rtracklayer) myAnnotations <- readGFFAsGRanges(system.file( package = "DNAModAnnot", "extdata", "ptetraurelia_mac_51_annotation_v2.0_sca171819.gff3" )) ## NOT RUN! ## Export files for Gviz # ExportFilesForGViz(dnastringsetGenome = myGenome, # cFileNames = c("genes.bam"), # listGRangesObjects = list(myAnnotations[myAnnotations$type == "gene"]), # cFileFormats = c("bam"), # cBamXaParameters = c("Name") )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.