comparison plot_comparative_clustering_summary.R @ 20:5a05925340b0 draft

Uploaded
author petr-novak
date Mon, 07 Jun 2021 08:46:07 +0000
parents d14b68e9fd1d
children
comparison
equal deleted inserted replaced
19:2f1b5d5c5dd5 20:5a05925340b0
50 counts_file_valid = ncol(counts) == (length(input_read_counts) + 2) & all(colnames(input_read_counts)[1:2]==c("cluster", "supercluster")) 50 counts_file_valid = ncol(counts) == (length(input_read_counts) + 2) & all(colnames(input_read_counts)[1:2]==c("cluster", "supercluster"))
51 ## find which line is header 51 ## find which line is header
52 header_line = grep(".*Cluster.*Supercluster.*Size", readLines(cluster_annotation)) 52 header_line = grep(".*Cluster.*Supercluster.*Size", readLines(cluster_annotation))
53 annot = read.table(cluster_annotation, sep="\t",header=TRUE,as.is=TRUE, skip = header_line - 1) 53 annot = read.table(cluster_annotation, sep="\t",header=TRUE,as.is=TRUE, skip = header_line - 1)
54 ## validate 54 ## validate
55 annot_file_valid = all(colnames(annot)==c("Cluster","Supercluster","Size","Size_adjusted","Automatic_annotation","TAREAN_annotation","Final_annotation")) 55 annot_file_valid = all(c("Cluster","Supercluster","Size","Size_adjusted","Automatic_annotation","TAREAN_annotation","Final_annotation") %in% colnames(annot))
56 56
57 57
58 if (!annot_file_valid | !counts_file_valid){ 58 if (!annot_file_valid | !counts_file_valid){
59 pdf(output_file) 59 pdf(output_file)
60 plot.new() 60 plot.new()