# HG changeset patch # User shian_su # Date 1393213299 -39600 # Node ID f8af57d6f60b6517dcccfac863bca5dc64e46da6 # Parent 076ca575208fd68ffa729afba0b2d394ea78206c Fixed bug causing fastq input to break - Moved misplaced error check causing fastq inputs to not function diff -r 076ca575208f -r f8af57d6f60b hairpinTool.R --- a/hairpinTool.R Fri Feb 21 12:52:56 2014 +1100 +++ b/hairpinTool.R Mon Feb 24 14:41:39 2014 +1100 @@ -170,10 +170,6 @@ offenders, " are repeated") } # Check that IDs in sample annotation are unique -if (any(is.na(match(samples$ID, colnames(counts))))) { - stop("not all samples have groups specified") -} # Check that a group has be specifed for each sample - if (inputType=="fastq") { if (any(table(hairpins$ID)>1)){ @@ -182,8 +178,11 @@ stop("ID column of hairpin annotation must have unique values, values ", offenders, " are repeated") } # Check that IDs in hairpin annotation are unique - + } else if (inputType=="counts") { + if (any(is.na(match(samples$ID, colnames(counts))))) { + stop("not all samples have groups specified") + } # Check that a group has be specifed for each sample if (any(table(counts$ID)>1)){ tab <- table(counts$ID) @@ -293,7 +292,7 @@ # Make the names of groups syntactically valid (replace spaces with periods) data$samples$group <- make.names(data$samples$group) -} else { +} else if (inputType=="counts") { # Process counts information, set ID column to be row names rownames(counts) <- counts$ID counts <- counts[ , !(colnames(counts)=="ID")]