Mercurial > repos > petr-novak > repeat_annotation_pipeline3
comparison clean_rm_output.R @ 1:814cba36e435 draft
Uploaded
| author | mvdbeek | 
|---|---|
| date | Mon, 21 Feb 2022 10:21:39 +0000 | 
| parents | ea6a3059a6af | 
| children | 7f1032da7a0a | 
   comparison
  equal
  deleted
  inserted
  replaced
| 0:ea6a3059a6af | 1:814cba36e435 | 
|---|---|
| 1 #!/usr/bin/env Rscript | 1 #!/usr/bin/env Rscript | 
| 2 suppressPackageStartupMessages(library(rtracklayer)) | 2 suppressPackageStartupMessages(library(rtracklayer)) | 
| 3 suppressPackageStartupMessages(library(parallel)) | |
| 4 | |
| 3 | 5 | 
| 4 gff_cleanup = function(gff){ | 6 gff_cleanup = function(gff){ | 
| 5 ## remove overlapin annotation track - assign new annot | 7 ## remove overlapin annotation track - assign new annot | 
| 6 gff_disjoin = disjoin(gff, with.revmap=TRUE) | 8 gff_disjoin = disjoin(gff, with.revmap=TRUE) | 
| 7 ## append annotation: | 9 ## append annotation: | 
| 48 infile = commandArgs(T)[1] | 50 infile = commandArgs(T)[1] | 
| 49 outfile = commandArgs(T)[2] | 51 outfile = commandArgs(T)[2] | 
| 50 | 52 | 
| 51 ## infile = "./test_data/raw_rm.out" | 53 ## infile = "./test_data/raw_rm.out" | 
| 52 | 54 | 
| 53 rm_out = read.table(infile, as.is=TRUE, sep="", skip = 2, fill=TRUE, header=FALSE) | 55 rm_out = read.table(infile, as.is=TRUE, sep="", skip = 2, fill=TRUE, header=FALSE, col.names=paste0("V",1:16)) | 
| 54 | 56 | 
| 55 gff = GRanges(seqnames = rm_out$V5, ranges = IRanges(start = rm_out$V6, end=rm_out$V7)) | 57 gff = GRanges(seqnames = rm_out$V5, ranges = IRanges(start = rm_out$V6, end=rm_out$V7)) | 
| 56 | 58 | 
| 57 # repeat class after # symbol - syntax 1 | 59 # repeat class after # symbol - syntax 1 | 
| 58 gff$Name=rm_out$V11 | 60 gff$Name=rm_out$V11 | 
