Hi Stephen,

we have slightly modified the MEDIPS.selectROIs() function and I forgot to
update the manual accordingly, please excuse any inconveniences.

It is not possible to simply specify columns=c("counts") any more but
concrete column names must be given. In case you still want to summarize
all 'count' columns of a result table 'resultTable' you have to specify
something like:

columns = colnames(resultTable)[grep("counts", colnames(resultTable))]

Another example is shown via ?MEDIPS.selectROIs:
columns=names(resultTable)[grep("counts|rpkm|logFC",names(resultTable))]

Please let me know, if this works for you.

Two more things:
1) In addition to the MEDIPS.createSet() function, there is a
MEDIPS.createROIset() function not described in the manual (see also
?MEDIPS.createROIset). In case you want to calculate coverage, rms, and/or
differential coverage for selected regions only, you might want to try this
function. Here, the coverage is only calculated at the given regions
instead of genome wide windows. Please note, normalization, CpG calibration
etc. are calculated based on the given regions only and I have not yet
investigated a minimal number of genomic regions so that the applied models
remain reasonable.

2) Your annotation file contains genomic regions for chrs 1 to 19 plus the
X chromosome. Therefore, I assume that this refers to the mouse genome. I
have processed some sequencing data (bam files) from mouse mapped against
mm9 and specified BSgenome.Mmusculus.UCSC.mm9 in MEDIPS. When specifying
the counts parameter of the MEDIPS.selectROIs() as described above
(summarize = T), I receive only 2602 entries although there are 2611
genomic regions in your annotation file (as reported in your error
message). See below the annotation IDs that are not returned by the
MEDIPS.selectROIs() function. I have checked the first three of them and
the genomic coordinates are outside of the length of the chromosomes. Your
annotations might fit to mm10. I recommend to check, if your annotations
and your bam files refer to the same genome version.

All the best,
Lukas

###
chr10 130111841 130112788 Olfr823 --> chr10 length: 129993255 (mm9)
chr15 103503298 103530052 Pde1b --> chr15 length: 103494974 (mm9)
chr2 181763332 181827797 Myt1 --> chr2 length: 181748087 (mm9)
Polr3k
Vwa1
Agrn
Plekhn1
Frmpd4
CR536618.1


On Tue, Apr 9, 2013 at 7:33 AM, Stephen Turner <vustephen@gmail.com> wrote:

> Thanks Lukas. That solved that problem. I now have another problem.
> I'm trying to look at regions of interest as before. After I've called
> MEDIPS.meth(), I then try to run:
>
> dmr_rois <- MEDIPS.selectROIs(results=dmr_all, rois=roi_file,
> columns=c("counts"), summarize=TRUE)
>
> where roi_file is created using read.csv() on this file of ROIs:
> https://gist.github.com/stephenturner/5346095
>
> I'm now getting the error:
>
> Error in data.frame(..., check.names = FALSE) :
>   arguments imply differing number of rows: 2602, 0
>
> I'm guessing this has something to do with my ROI file, but I'm having
> trouble figuring out what to do. I have 2611 ROIs, not 2602. I've
> double checked that I have no duplicates - these both return 2611:
>
> length(unique(roi_file$ID))
> length(unique(with(roi_file, paste(chr, start, stop))))
>
> There may be some overlapping regions, but I'm unsure how to best
> handle this. Could this be causing the error?
>
> Thanks,
>
> Stephen
>
> On Mon, Apr 8, 2013 at 3:58 PM, Lukas Chavez
> <lukas.chavez.mailings@googlemail.com> wrote:
> >
> > Hi Stephen,
> >
> > I was able to reproduce the error. It appears that you have unmapped
> reads
> > in your bam file which we always filter out during conversion of sam to
> bam
> > files using samtools view -S -F 4 -b -o out.bam in.sam (single end
> sequening
> > data). In case you filter your bam files accordingly, the error message
> > should disappear.  However, I will add an additional flag
> > scanBamFlag(isUnmappedQuery = F) to the according scanBam() function in
> dev.
> > Therefore, unmapped reads in a given bam file should be ignored in the
> > future (MEDIPS version >=1.11.1).
> >
> > Lukas
>

	[[alternative HTML version deleted]]

