annotate change_o/define_clones.r @ 85:a539d14d66b6 draft

"planemo upload commit 95767c430ea956636f95ec28bb749a84eabe0156"
author rhpvorderman
date Wed, 27 Oct 2021 09:41:34 +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)