Mercurial > repos > petr-novak > repeat_annotation_pipeline3
view split_and_filter_tracks.R @ 7:acf12f2e8355 draft
"planemo upload commit 363c9be36812ce7623dad670f881d155209ed2ba"
author | petr-novak |
---|---|
date | Thu, 19 May 2022 08:37:22 +0000 |
parents | ea6a3059a6af |
children |
line wrap: on
line source
#!/usr/bin/env Rscript suppressPackageStartupMessages(library(rtracklayer)) gff = import(commandArgs(T)[1]) BN = gsub("[.]gff(3){0,1}","",basename(commandArgs(T)[1])) min_width = as.numeric(commandArgs(T)[2]) outdir = commandArgs(T)[3] gff_min_width=gff[width(gff)>=min_width] dir.create(outdir, recursive = TRUE, showWarnings = FALSE) gff_min_width_parts = split(gff_min_width, f=gff_min_width$Name) x = sapply(names(gff_min_width_parts), function(x) export( gff_min_width_parts[[x]], format="gff3", con=paste0( outdir,"/", gsub("/","_",x), "_", min_width ,"plus.gff3" ) ))