Question: convert "Genome_intervals_stranded" to "Genome_intervals"? (girafe)
0
gravatar for delhomme@embl.de
7.6 years ago by
delhomme@embl.de1.2k wrote:
Sorry for the off list reply. Nico --------------------------------------------------------------- Nicolas Delhomme Genome Biology Computational Support European Molecular Biology Laboratory Tel: +49 6221 387 8310 Email: nicolas.delhomme at embl.de Meyerhofstrasse 1 - Postfach 10.2209 69102 Heidelberg, Germany --------------------------------------------------------------- Begin forwarded message: > From: Nicolas Delhomme <delhomme at="" embl.de=""> > Date: 27 February 2012 22:37:42 CET > To: karlerhard at berkeley.edu > Subject: Re: [BioC] convert "Genome_intervals_stranded" to "Genome_intervals"? (girafe) > > Hello Karl, > > You just need to use the "coerce" function built in genomeIntervals. The code below does that. The first part is from the genomeIntervals help (for the object creation). Then what really interest you is the line: as(j,"Genome_intervals") further down. > >> ?genomeIntervals >> j <- new( > + "Genome_intervals_stranded", > + matrix( > + c(1,2, > + 3,5, > + 4,6, > + 8,9 > + ), > + byrow = TRUE, > + ncol = 2 > + ), > + closed = matrix( > + c( > + FALSE, FALSE, > + TRUE, FALSE, > + TRUE, TRUE, > + TRUE, FALSE > + ), > + byrow = TRUE, > + ncol = 2 > + ), > + annotation = data.frame( > + seq_name = factor( c("chr01","chr01", "chr02","chr02") ), > + strand = factor( c("+", "+", "+", "-") ), > + inter_base = c(FALSE,FALSE,FALSE,TRUE) > + ) > + ) >> j > Object of class Genome_intervals_stranded > 3 base intervals and 1 inter-base interval(*): > chr01 + (1, 2) > chr01 + [3, 5) > chr02 + [4, 6] > chr02 - [8, 9) * > > annotation: > seq_name strand inter_base > 1 chr01 + FALSE > 2 chr01 + FALSE > 3 chr02 + FALSE > 4 chr02 - TRUE >> as(j,"Genome_intervals") > Object of class Genome_intervals > 3 base intervals and 1 inter-base interval(*): > chr01 (1, 2) > chr01 [3, 5) > chr02 [4, 6] > chr02 [8, 9) * > > annotation: > seq_name strand inter_base > 1 chr01 + FALSE > 2 chr01 + FALSE > 3 chr02 + FALSE > 4 chr02 - TRUE > > Cheers, > > Nico > > --------------------------------------------------------------- > Nicolas Delhomme > > Genome Biology Computational Support > > European Molecular Biology Laboratory > > Tel: +49 6221 387 8310 > Email: nicolas.delhomme at embl.de > Meyerhofstrasse 1 - Postfach 10.2209 > 69102 Heidelberg, Germany > --------------------------------------------------------------- > > > > > > On 27 Feb 2012, at 21:59, karlerhard at berkeley.edu wrote: > >> >> Hello all, >> >> Would anyone be willing to help me figure out a way to convert a >> "Genome_intervals_stranded" object into a "Genome_intervals" object (no >> strand information)? >> >> I have gff3 files containing gene annotations and I read these files into >> R using the readGFF3 function, but readGFF3 requires that the input has a >> strand column. I would like to remove that strand information to compare >> antisense reads between two libraries. >> >> Is it as simple as removing the strand column of the >> "Genome_intervals_stranded" object in R? >> >> Or perhaps there is a way of reading in a strand-less GFF3 file as a >> "Genome_intervals" object that does not use the readGFF3 function? >> >> Thanks for any help, I would greatly appreciate it. >> >> Karl Erhard >> Graduate Student >> UC Berkeley >> >> _______________________________________________ >> Bioconductor mailing list >> Bioconductor at r-project.org >> https://stat.ethz.ch/mailman/listinfo/bioconductor >> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor >
ADD COMMENTlink written 7.6 years ago by delhomme@embl.de1.2k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 149 users visited in the last hour