it's not the complete preprocessing, but I think this should provide enough information. How can I change this script to include the gene lengths?
mrna_query <- GDCquery(project = "TCGA-KIRC",
data.category = "Transcriptome Profiling",
data.type = "Gene Expression Quantification",
workflow.type = "HTSeq - Counts",
experimental.strategy = "RNA-Seq")
GDCdownload(mrna_query, method = "api", files.per.chunk = 100,
directory = "~/Desktop/TCGA/mRNA/")
mrna_df <- GDCprepare(mrna_query, directory = "~/Desktop/TCGA/mRNA/")
mrna_df <- assay(mrna_df)
mart <- useMart(biomart = "ensembl", dataset = "hsapiens_gene_ensembl") #,host="useast.ensembl.org")
mrna_attributes <- getBM(attributes=c("external_gene_name",
"ensembl_gene_id",
"gene_biotype"),
filters = c("ensembl_gene_id"),
values = rownames(mrna_df),
mart = mart)
mrna_df <- mrna_df[which(rownames(mrna_df) %in% mrna_attributes$ensembl_gene_id),]
mrna_df$Gene_id <- mrna_attributes$external_gene_name
Please edit your post and add a link to the paper you're trying to replicate.