Question: TCGABioLinks getManifest() function. How to alter saved file name?
0
gravatar for ivykosater
5 weeks ago by
ivykosater0
Philadelphia
ivykosater0 wrote:

In the TCGABioLinks R package there is a function called getManifest() which allows you to download queries samples manifest files. I have two datasets that I'm trying to pull. One is a set of tumor samples with a specific mutation, the other is the set of samples without said mutation.

What I've done so far is to query these both using the GDCquery() function. My code is below

query <- GDCquery(project = "TCGA-BRCA", 
                 data.category = "Transcriptome Profiling",
                 data.type = "Gene Expression Quantification", 
                 workflow.type = "HTSeq - FPKM",
                 barcode = samples$V2)

# Samples without mutation
control_query <- GDCquery(project = "TCGA-BRCA", 
data.category = "Transcriptome Profiling", 
data.type = "Gene Expression Quantification", workflow.type = "HTSeq - FPKM", barcode = control$V2)

#Download manifest files
 getManifest(query, save=TRUE)
 getManifest(control_query, save=TRUE)

However, the problem lies with the fact that the saved manifest file is named gdc-manifest.txt, and there is no argument to change file name, so when I try to download two manifest files, one gets overwritten. How would I go about changing the file name?

tcga bioconductor R • 103 views
ADD COMMENTlink modified 5 weeks ago • written 5 weeks ago by ivykosater0

The code for getManifest is:

getManifest <- function(query, save = FALSE) {
    manifest <- query$results[[1]][,c("file_id","file_name","md5sum","file_size","state")]
    colnames(manifest) <- c("id","filename","md5","size","state")
    if(save)  {
        fname <- "gdc_manifest.txt"
        write_delim(manifest,fname,delim = "\t")
        file <- file.path(getwd(),fname)
        message("Manifest saved as: ", file)
    }
    return(manifest)
}

Maybe overwrite it with a modified version so it can write to a custom file name?

ADD REPLYlink written 5 weeks ago by Ram32k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1943 users visited in the last hour
_