comparison get_length_and_gc_content.r @ 6:d4b5942ed347 draft

planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/goseq_1_22_0 commit fdd0811efc61c31f88ff17096fbe8ee8cfacd766-dirty
author mvdbeek
date Thu, 25 Feb 2016 05:49:08 -0500
parents f9b964d1d386
children 15ce6435ab83
comparison
equal deleted inserted replaced
5:f9b964d1d386 6:d4b5942ed347
1 # originally by Devon Ryan, https://www.biostars.org/p/84467/ 1 # originally by Devon Ryan, https://www.biostars.org/p/84467/
2 sink(stdout(), type = "message")
2 3
3 library(GenomicRanges) 4 library(GenomicRanges)
4 library(rtracklayer) 5 library(rtracklayer)
5 library(Rsamtools) 6 library(Rsamtools)
6 library(optparse) 7 library(optparse)
17 GTFfile = args$gtf 18 GTFfile = args$gtf
18 FASTAfile = args$fasta 19 FASTAfile = args$fasta
19 output = args$output 20 output = args$output
20 21
21 #Load the annotation and reduce it 22 #Load the annotation and reduce it
22 GTF <- import.gff(GTFfile, format="gtf", genome=NA, asRangedData=F, feature.type="exon") 23 GTF <- import.gff(GTFfile, format="gtf", genome=NA, feature.type="exon")
23 grl <- reduce(split(GTF, elementMetadata(GTF)$gene_name)) 24 grl <- reduce(split(GTF, elementMetadata(GTF)$gene_name))
24 reducedGTF <- unlist(grl, use.names=T) 25 reducedGTF <- unlist(grl, use.names=T)
25 elementMetadata(reducedGTF)$gene_name <- rep(names(grl), elementLengths(grl)) 26 elementMetadata(reducedGTF)$gene_name <- rep(names(grl), elementLengths(grl))
26 27
27 #Open the fasta file 28 #Open the fasta file