Mercurial > repos > petr-novak > dante
comparison summarize_gff.R @ 13:ab56b34d67d8 draft
Uploaded
author | petr-novak |
---|---|
date | Thu, 15 Aug 2019 07:48:49 -0400 |
parents | ddc6bab20889 |
children |
comparison
equal
deleted
inserted
replaced
12:ddc6bab20889 | 13:ab56b34d67d8 |
---|---|
22 L = sapply(gffattr_list, length) | 22 L = sapply(gffattr_list, length) |
23 short = L < max(L) | 23 short = L < max(L) |
24 if (any(short)){ | 24 if (any(short)){ |
25 gffattr_list[short] = lapply(gffattr_list[short],function(x) c(x, rep(NA, 13 - length(x)))) | 25 gffattr_list[short] = lapply(gffattr_list[short],function(x) c(x, rep(NA, 13 - length(x)))) |
26 } | 26 } |
27 gffattr = as.data.frame(do.call(rbind, gffattr_list)) | 27 gffattr = as.data.frame(do.call(rbind, gffattr_list), stringsAsFactors = FALSE) |
28 | 28 |
29 ## get attributes names | 29 ## get attributes names |
30 attrnames = strsplit(dfraw[1,9],split=c("=|;"))[[1]][c(TRUE,FALSE)] | 30 attrnames = strsplit(dfraw[1,9],split=c("=|;"))[[1]][c(TRUE,FALSE)] |
31 colnames(gffattr) = attrnames | 31 colnames(gffattr) = attrnames |
32 | 32 |