view define_clones.r @ 4:c75b30eb0b07 draft

Uploaded
author davidvanzessen
date Mon, 15 Aug 2016 09:35:26 -0400
parents 5173675d0d10
children 3d97839fda21
line wrap: on
line source

args <- commandArgs(trailingOnly = TRUE)

input=args[1]
output=args[2]

change.o = read.table(input, header=T, sep="\t", quote="", stringsAsFactors=F)

freq = data.frame(table(change.o$CLONE))
freq2 = data.frame(table(freq$Freq))
freq2$final = freq2$Freq * as.numeric(freq2$Var1)

names(freq2) = c("Clone size", "Nr of clones", "Nr of sequences")

write.table(x=freq2, file=output, sep="\t",quote=F,row.names=F,col.names=T)