comparison create_genome_tracks.R @ 6:d46bbaa386de draft

Uploaded
author greg
date Fri, 10 Nov 2017 14:00:06 -0500
parents 47f6ba0fc3f4
children b090efba1fe1
comparison
equal deleted inserted replaced
5:a149688bd1bb 6:d46bbaa386de
1 #!/usr/bin/env Rscript 1 #!/usr/bin/env Rscript
2 2
3 suppressPackageStartupMessages(library("data.table"))
3 suppressPackageStartupMessages(library("optparse")) 4 suppressPackageStartupMessages(library("optparse"))
4 5
5 option_list <- list( 6 option_list <- list(
6 make_option(c("-b", "--build"), action="store", dest="build", help="Genome build"), 7 make_option(c("-b", "--build"), action="store", dest="build", help="Genome build"),
7 make_option(c("-c", "--chrom_len_file"), action="store", dest="chrom_len_file", help="Chromosome length file"), 8 make_option(c("-c", "--chrom_len_file"), action="store", dest="chrom_len_file", help="Chromosome length file"),
48 return(rt); 49 return(rt);
49 } 50 }
50 51
51 create_track<-function(state_files, chrom_len_file, outpref, state_color, header, state_name) { 52 create_track<-function(state_files, chrom_len_file, outpref, state_color, header, state_name) {
52 message("Reading state file: ", appendLF=FALSE); 53 message("Reading state file: ", appendLF=FALSE);
53 library("data.table");
54 genomesz = read.table(chrom_len_file); 54 genomesz = read.table(chrom_len_file);
55 g = NULL; 55 g = NULL;
56 for(i in state_files) { 56 for(i in state_files) {
57 message(paste(i, " ", sep=""), appendLF=F); 57 message(paste(i, " ", sep=""), appendLF=F);
58 tg = as.matrix(fread(i)); 58 tg = as.matrix(fread(i));