Skip to content

Commit

Permalink
Fix bug in resutls output
Browse files Browse the repository at this point in the history
When extracting only one row
from the matrix, it is automatically
converted to vector. To prevent this
drop=FALSE should be added
  • Loading branch information
michael-kotliar committed May 11, 2018
1 parent 3c6633c commit e3296fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ROSE_callSuper.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ convert_stitched_to_bed <- function(inputStitched,trackName,trackDescription,out
write.table(file= outputFile,outMatrix,sep="\t",quote=FALSE,row.names=FALSE,col.names=FALSE,append=TRUE)
if(splitSuper==TRUE){
cat("\ntrack name=\"Super_", tName,'" description="Super ', trackDescription,'" itemRGB=On color=', superColor,"\n",sep="",file=outputFile,append=TRUE)
write.table(file= outputFile,outMatrix[superRows,],sep="\t",quote=FALSE,row.names=FALSE,col.names=FALSE,append=TRUE)
write.table(file= outputFile,outMatrix[superRows,,drop=FALSE],sep="\t",quote=FALSE,row.names=FALSE,col.names=FALSE,append=TRUE)
}
}

Expand Down Expand Up @@ -78,7 +78,7 @@ convert_stitched_to_gateway_bed <- function(inputStitched,outputFileRoot,splitSu
if(splitSuper==TRUE){
outputFile2 = paste(outputFileRoot,'_Gateway_SuperEnhancers.bed',sep='')

write.table(file= outputFile2,outMatrix[superRows,],sep="\t",quote=FALSE,row.names=FALSE,col.names=FALSE,append=TRUE)
write.table(file= outputFile2,outMatrix[superRows,,drop=FALSE],sep="\t",quote=FALSE,row.names=FALSE,col.names=FALSE,append=TRUE)
}
}

Expand Down

0 comments on commit e3296fe

Please sign in to comment.