Question: htSeqTools - naming RangedData objects?
0
gravatar for Ian Donaldson
7.4 years ago by
Ian Donaldson70 wrote:
I am trying to get htSeqTools to create a PCA for my ChIP-seq sample reads. However, by default there are no labels associated with the sample points in my PCA plot. METHOD: I created RangedData objects like this, e.g: RR05 <- readAligned(dirPath , "RR_20111013_filtered_RR05_bfast_hg18_a3 _best_unique_sorted_mapped.bam", type='BAM') RR05ranges <- RangedData(ranges=IRanges(position(RR05),position(RR05)+width(RR05)), space=chromosome(RR05), strand=strand(RR05)) I have assigned my RangedData to a list like this: samples <- RangedDataList(RR05ranges,RR06ranges,RR2_03ranges,RR2_04ranges) Can i assign names like this? names(samples) <- c("RR05","RR06","RR2_03", "RR2_04") It works, but my worry is that the order might be different if objects do not have a fixed order..... Or is there a way of assigning a name to each RangedData object before they are added to a list? Thank you! As you can tell i am no expert at using R/Bioconductor! Ian [[alternative HTML version deleted]]
htseqtools assign • 522 views
ADD COMMENTlink modified 7.4 years ago by Michael Lawrence11k • written 7.4 years ago by Ian Donaldson70
Answer: htSeqTools - naming RangedData objects?
0
gravatar for Michael Lawrence
7.4 years ago by
United States
Michael Lawrence11k wrote:
On Tue, Jan 17, 2012 at 8:22 AM, Ian Donaldson < Ian.Donaldson@manchester.ac.uk> wrote: > I am trying to get htSeqTools to create a PCA for my ChIP-seq sample > reads. However, by default there are no labels associated with the sample > points in my PCA plot. > > METHOD: > I created RangedData objects like this, e.g: > RR05 <- readAligned(dirPath , > "RR_20111013_filtered_RR05_bfast_hg18_a3_best_unique_sorted_mapped.b am", > type='BAM') > > RR05ranges <- > RangedData(ranges=IRanges(position(RR05),position(RR05)+width(RR05)), > space=chromosome(RR05), strand=strand(RR05)) > > I have assigned my RangedData to a list like this: > samples <- RangedDataList(RR05ranges,RR06ranges,RR2_03ranges,RR2_04ranges) > > Can i assign names like this? > names(samples) <- c("RR05","RR06","RR2_03", "RR2_04") > > Yes. > It works, but my worry is that the order might be different if objects do > not have a fixed order..... > > The objects do have a fixed order, and the names will be kept in sync. > Or is there a way of assigning a name to each RangedData object before > they are added to a list? > > You can always name the arguments to the RangedDataList function, like RangedDataList(A = rd_a, B = rd_b). > Thank you! As you can tell i am no expert at using R/Bioconductor! > > I might also point you towards the use of readGappedAlignments in GenomicRanges. A GappedAlignments can be coerced to a GRanges with grlist() and then on to RangedData via as(). You could put the GRanges in a GenomicRangesList in the same way as RangedDataList; however, htSeqTools might not work with that. Ian > > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor@r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > [[alternative HTML version deleted]]
ADD COMMENTlink written 7.4 years ago by Michael Lawrence11k
A brief note, htSeqTools does provide methods for GRanges objects. Best, David -----Original Message----- From: Michael Lawrence <lawrence.michael@gene.com> Date: Tue, 17 Jan 2012 09:44:45 To: Ian Donaldson<ian.donaldson@manchester.ac.uk> Cc: bioconductor@r-project.org<bioconductor@r-project.org>; David Rossell<david.rossell@irbbarcelona.org> Subject: Re: [BioC] htSeqTools - naming RangedData objects? On Tue, Jan 17, 2012 at 8:22 AM, Ian Donaldson < Ian.Donaldson@manchester.ac.uk> wrote: > I am trying to get htSeqTools to create a PCA for my ChIP-seq sample > reads. However, by default there are no labels associated with the sample > points in my PCA plot. > > METHOD: > I created RangedData objects like this, e.g: > RR05 <- readAligned(dirPath , > "RR_20111013_filtered_RR05_bfast_hg18_a3_best_unique_sorted_mapped.b am", > type='BAM') > > RR05ranges <- > RangedData(ranges=IRanges(position(RR05),position(RR05)+width(RR05)), > space=chromosome(RR05), strand=strand(RR05)) > > I have assigned my RangedData to a list like this: > samples <- RangedDataList(RR05ranges,RR06ranges,RR2_03ranges,RR2_04ranges) > > Can i assign names like this? > names(samples) <- c("RR05","RR06","RR2_03", "RR2_04") > > Yes. > It works, but my worry is that the order might be different if objects do > not have a fixed order..... > > The objects do have a fixed order, and the names will be kept in sync. > Or is there a way of assigning a name to each RangedData object before > they are added to a list? > > You can always name the arguments to the RangedDataList function, like RangedDataList(A = rd_a, B = rd_b). > Thank you! As you can tell i am no expert at using R/Bioconductor! > > I might also point you towards the use of readGappedAlignments in GenomicRanges. A GappedAlignments can be coerced to a GRanges with grlist() and then on to RangedData via as(). You could put the GRanges in a GenomicRangesList in the same way as RangedDataList; however, htSeqTools might not work with that. Ian > > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor@r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > [[alternative HTML version deleted]]
ADD REPLYlink written 7.4 years ago by David Rossell100
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: 312 users visited in the last hour