annotate change_o/define_clones.r @ 96:385dea3c6cb5 draft

planemo upload commit 423a48569c69301fdbf893ac3a649128404dfff5
author rhpvorderman
date Fri, 05 Jan 2024 08:53:22 +0000
parents c33d93683a09
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
c33d93683a09 Uploaded
davidvanzessen
parents:
diff changeset
1 args <- commandArgs(trailingOnly = TRUE)
c33d93683a09 Uploaded
davidvanzessen
parents:
diff changeset
2
c33d93683a09 Uploaded
davidvanzessen
parents:
diff changeset
3 input=args[1]
c33d93683a09 Uploaded
davidvanzessen
parents:
diff changeset
4 output=args[2]
c33d93683a09 Uploaded
davidvanzessen
parents:
diff changeset
5
c33d93683a09 Uploaded
davidvanzessen
parents:
diff changeset
6 change.o = read.table(input, header=T, sep="\t", quote="", stringsAsFactors=F)
c33d93683a09 Uploaded
davidvanzessen
parents:
diff changeset
7
c33d93683a09 Uploaded
davidvanzessen
parents:
diff changeset
8 freq = data.frame(table(change.o$CLONE))
c33d93683a09 Uploaded
davidvanzessen
parents:
diff changeset
9 freq2 = data.frame(table(freq$Freq))
c33d93683a09 Uploaded
davidvanzessen
parents:
diff changeset
10
c33d93683a09 Uploaded
davidvanzessen
parents:
diff changeset
11 freq2$final = as.numeric(freq2$Freq) * as.numeric(as.character(freq2$Var1))
c33d93683a09 Uploaded
davidvanzessen
parents:
diff changeset
12
c33d93683a09 Uploaded
davidvanzessen
parents:
diff changeset
13 names(freq2) = c("Clone size", "Nr of clones", "Nr of sequences")
c33d93683a09 Uploaded
davidvanzessen
parents:
diff changeset
14
c33d93683a09 Uploaded
davidvanzessen
parents:
diff changeset
15 write.table(x=freq2, file=output, sep="\t",quote=F,row.names=F,col.names=T)