annotate get_gff_part.R @ 7:acf12f2e8355 draft

"planemo upload commit 363c9be36812ce7623dad670f881d155209ed2ba"
author petr-novak
date Thu, 19 May 2022 08:37:22 +0000
parents ea6a3059a6af
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
ea6a3059a6af Uploaded
petr-novak
parents:
diff changeset
1 #!/usr/bin/env Rscript
ea6a3059a6af Uploaded
petr-novak
parents:
diff changeset
2 suppressPackageStartupMessages(library(rtracklayer))
ea6a3059a6af Uploaded
petr-novak
parents:
diff changeset
3 g = import(commandArgs(T)[1])
ea6a3059a6af Uploaded
petr-novak
parents:
diff changeset
4 gd = mcols(g)
ea6a3059a6af Uploaded
petr-novak
parents:
diff changeset
5 col_name=commandArgs(T)[2]
ea6a3059a6af Uploaded
petr-novak
parents:
diff changeset
6 col_value=commandArgs(T)[3]
ea6a3059a6af Uploaded
petr-novak
parents:
diff changeset
7 inc = gd[,col_name] %in% col_value
ea6a3059a6af Uploaded
petr-novak
parents:
diff changeset
8 g_part = sort(sortSeqlevels(g[inc]))
ea6a3059a6af Uploaded
petr-novak
parents:
diff changeset
9 export(g_part, format = 'gff3', commandArgs(T)[4])