comparison get_length_and_gc_content.r @ 13:ea84562a5115 draft

planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/goseq_1_22_0 commit fdd0811efc61c31f88ff17096fbe8ee8cfacd766-dirty
author mvdbeek
date Thu, 25 Feb 2016 07:15:06 -0500
parents 02e88556ce1d
children 8ce951313688
comparison
equal deleted inserted replaced
12:02e88556ce1d 13:ea84562a5115
39 nGCs = sum(elementMetadata(x)$nGCs) 39 nGCs = sum(elementMetadata(x)$nGCs)
40 width = sum(elementMetadata(x)$widths) 40 width = sum(elementMetadata(x)$widths)
41 c(width, nGCs/width) 41 c(width, nGCs/width)
42 } 42 }
43 output <- t(sapply(split(reducedGTF, elementMetadata(reducedGTF)$gene_id), calc_GC_length)) 43 output <- t(sapply(split(reducedGTF, elementMetadata(reducedGTF)$gene_id), calc_GC_length))
44 output <- setDT(output, keep.rownames = TRUE)[] 44 output <- setDT(data.frame(output), keep.rownames = TRUE)[]
45 colnames(output) <- c("#gene_id", "length", "GC") 45 colnames(output) <- c("#gene_id", "length", "GC")
46 46
47 write.table(output, file=output_file, row.names=FALSE, quote=FALSE, sep="\t") 47 write.table(output, file=output_file, row.names=FALSE, quote=FALSE, sep="\t")