Question: ChIPpeakAnno-problem exporting data due to "arguments imply differing number of rows"
0
gravatar for jmKeith
2.7 years ago by
jmKeith0
jmKeith0 wrote:

Hello,

I have been doing a three way analysis of ChIP-Seq data (histone modifications) using ChIPpeakAnno and I am having difficulty exporting my data.  I am able to find overlapping peaks for my three peak files, but am unable to write out the file using any "write" function that I have tried due to the differing numbers of rows.  I get this same error while trying to export my enrichedGO data file as well.  I have searched around and am unable to configure a solution so if anyone can help me out, I'd really appreciate it!

 

I am able to call the correct object from the overlappingPeaks object and can print it out in R, but am unable to export. 

Script:

>Ol <- findOverlapsOfPeaks(d3.p300.TGR, d3.k4m1.TGR,d3.k27Ac.TGR, maxgap = 1000, minoverlap = 1L, ignore.strand = TRUE, connectedPeaks = "min")

>annotated.overlaplist <- Ol$overlappingPeaks

>annotated.overlaplist

> write.table(annotated.overlaplist,"C:/Users/jkeith/Desktop/R/annotatedoverlaps.txt")
Error in (function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE,  : 
  arguments imply differing number of rows: 30641, 251, 117

 

Many thanks for any assistance.

 

chippeakanno • 1.2k views
ADD COMMENTlink modified 2.7 years ago by Julie Zhu4.0k • written 2.7 years ago by jmKeith0
Answer: ChIPpeakAnno-problem exporting data due to "arguments imply differing number of
1
gravatar for Ou, Jianhong
2.7 years ago by
Ou, Jianhong1.1k
United States
Ou, Jianhong1.1k wrote:

Hi,

Because the annotated.overlaplist is a list, you'd better export the results like this,

null <- mapply(write.table, annotated.overlaplist, gsub("\\/+", ".", paste0("annotated.overlaplist_", names(annotated.overlaplist), ".txt")))

Let me known if you still have any question.

ADD COMMENTlink written 2.7 years ago by Ou, Jianhong1.1k
Answer: ChIPpeakAnno-problem exporting data due to "arguments imply differing number of
1
gravatar for Julie Zhu
2.7 years ago by
Julie Zhu4.0k
United States
Julie Zhu4.0k wrote:

FYI, Ol$overlappingPeaks does not contain the peaks common to all of the three input peak list. Peaks common to all three peak list are stored in Ol$peaklist, which is also a list.  Are you interested in obtaining the merged peaks or the original input peak lists paired with overlapping peaks in the other input peak list(s)? Ol$peaklist contains the merged peaks as well as peaks unique to any input list.

Ol <- findOverlapsOfPeaks(d3.p300.TGR, d3.k4m1.TGR,d3.k27Ac.TGR, maxgap = 1000, minoverlap = 1L, ignore.strand = TRUE, connectedPeaks = "min")

Function getEnrichedGO also returns a named list with the following three components assuming enriched.GO contains the result from getEnrichedGO.

#'mf': enriched molecular function

 enriched.GO$mf

#'bp': enriched biological process 

 enriched.GO$bp

#enriched cellular component

 enriched.GO$cc

 

Best,

 

Julie

ADD COMMENTlink modified 2.7 years ago • written 2.7 years ago by Julie Zhu4.0k

Thanks very much!

ADD REPLYlink written 2.7 years ago by jmKeith0
Answer: ChIPpeakAnno-problem exporting data due to "arguments imply differing number of
0
gravatar for jmKeith
2.7 years ago by
jmKeith0
jmKeith0 wrote:

Hi,

Again, thank you for your help.  I've tried the script that you sent, but what I get is an almost entirely blank object.  

> overlapping <- mapply(write.table, annotated.overlaplist, gsub("\\/+", ".", paste0("annotated.overlaplist_", names(annotated.overlaplist), ".txt")))
> overlapping
$`d3.k4m1.TGR///d3.k27Ac.TGR`
NULL

$`d3.p300.TGR///d3.k27Ac.TGR`
NULL

$`d3.p300.TGR///d3.k4m1.TGR`
NULL

I'm not sure how to fix this problem.  

ADD COMMENTlink written 2.7 years ago by jmKeith0

Check your working path, there should be several text files there.

ADD REPLYlink written 2.7 years ago by Ou, Jianhong1.1k
Answer: ChIPpeakAnno-problem exporting data due to "arguments imply differing number of
0
gravatar for jmKeith
2.7 years ago by
jmKeith0
jmKeith0 wrote:

In contrast, my annotated.overlaplist list object is the full list at 7MB --the first few lines are below.  

> annotated.overlaplist
$`d3.k4m1.TGR///d3.k27Ac.TGR`
                                                       peaks1     seqnames     start
d3.k27Ac.TGR__X00003_d3.k4m1.TGR__X00002 d3.k27Ac.TGR__X00003         chr1   4774643
d3.k27Ac.TGR__X00015_d3.k4m1.TGR__X00007 d3.k27Ac.TGR__X00015         chr1   6373096
d3.k27Ac.TGR__X00018_d3.k4m1.TGR__X00008 d3.k27Ac.TGR__X00018         chr1   6443451
d3.k27Ac.TGR__X00019_d3.k4m1.TGR__X00008 d3.k27Ac.TGR__X00019         chr1   6444261
d3.k27Ac.TGR__X00020_d3.k4m1.TGR__X00010 d3.k27Ac.TGR__X00020         chr1   6457086
d3.k27Ac.TGR__X00020_d3.k4m1.TGR__X00011 d3.k27Ac.TGR__X00020         chr1   6457086

 

 

Thanks again

ADD COMMENTlink written 2.7 years ago by jmKeith0

I think I've got it--thank you for pointing out the fact that I was trying to write out a list, without thinking about the fact that it's a list!  

This is the script that I've used-

>lapply(annotated.overlaplist, function(x) write.table( data.frame(x), 'annotated.overlaplist.txt'  , append= T, sep=',' ))

 

 

ADD REPLYlink written 2.7 years ago by jmKeith0
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: 288 users visited in the last hour