Fix a nasty bug in reading GATK reports with a single line
-- Old version would break during reading with (as usual) a cryptic error message -- Fixed by avoiding collapsing into a single vector type from a matrix when you subset to a single row. I believe this code confirms thats R is truly the worst programming language ever
This commit is contained in:
parent
5bce3a738d
commit
4a84ff4fce
|
|
@ -111,7 +111,13 @@ gsa.read.gatkreportv1 <- function(lines) {
|
||||||
headerRowCount = -1;
|
headerRowCount = -1;
|
||||||
|
|
||||||
finishTable <- function() {
|
finishTable <- function() {
|
||||||
.gsa.assignGATKTableToEnvironment(tableName, tableHeader, tableRows[1:rowCount,], tableEnv);
|
if ( rowCount == 1 )
|
||||||
|
# good I hate R. Work around to avoid collapsing into an unstructured vector when
|
||||||
|
# there's only 1 row
|
||||||
|
sub <- t(as.matrix(tableRows[1:rowCount,]))
|
||||||
|
else
|
||||||
|
sub <- tableRows[1:rowCount,]
|
||||||
|
.gsa.assignGATKTableToEnvironment(tableName, tableHeader, sub, tableEnv);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (line in lines) {
|
for (line in lines) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue