knitr::opts_chunk$set(dpi=300, fig.pos="H", fig.width=8, fig.height=6, echo=FALSE, warning=FALSE, message=FALSE);

rerun.all<-FALSE; 

source_url<-"sftp-cancer.sanger.ac.uk/cosmic/grch38/cosmic/v75";
file_home<-paste(Sys.getenv('RCHIVE_HOME'), 'data/variant/public/cosmic/src', sep='/');
file_out<-paste(Sys.getenv('RCHIVE_HOME'), 'data/variant/public/cosmic/r', sep='/');
genome<-'GRCh38'; 

library(VariantAnnotation); 

File source and locations

Processing of individual files

!Quoted description was copied from COSMIC

CosmicCodingMuts.vcf

fn<-paste(file_out, 'CosmicCodingMuts', sep='/'); 
if (rerun.all | !file.exists(paste(fn, '.rds', sep=''))) {
  GtUtility::loadVcf(paste(file_home, 'CosmicCodingMuts.vcf', sep='/'), fn, genome); 
  load(paste(fn, '.rdata', sep='')); 
  gr<-rowData(vcf); 
  elementMetadata(gr)<-cbind(elementMetadata(gr), info(vcf)); 
  saveRDS(gr, paste(fn, '.rds', sep='')); 
  file.remove(paste(fn, '.rdata', sep='')); 
} else vcf<-readRDS(paste(fn, '.rds', sep='')); 

cat("head(info(vcf))\n"); 
head(info(vcf)); 

cancer_gene_census.csv

fn<-paste(file_out, 'cancer_gene_census.rds', sep='/'); 
tbl<-read.csv(paste(file_home, 'cancer_gene_census.csv', sep='/')); 
saveRDS(tbl, fn); 
##############################################################################################################
tm<-strsplit(as.character(Sys.time()), ' ')[[1]][1];
fn0<-paste(Sys.getenv("RCHIVE_HOME"), '/source/script/update/variant/ProcessCosmic.Rmd', sep='');
fn1<-paste(Sys.getenv("RCHIVE_HOME"), '/source/script/update/variant/log/', tm, '_ProcessCosmic.Rmd' , sep='');
file.copy(fn0, fn1)

END OF DOCUMENT



zhezhangsh/rchive documentation built on June 17, 2020, 3:55 a.m.