annotate change_o/define_clones.r @ 86:be36df6dd589 draft

"planemo upload commit 78ace939ed7437b8b360588032449a99aad949eb"
author rhpvorderman
date Wed, 27 Oct 2021 10:02:33 +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)