why makeGRangesFromDataFrame don't do the IRange
0
0
Entering edit mode
18 months ago

I have a dataframe with 4 columns:

chromosome start end score and for each columns I have multiple rows, like this:

seqnames    start      end       V5
1       chrI  1540683  1540683  6.33554
2       chrI  1838049  1838049  2.81938
3       chrI  2706245  2706245  4.10906

I want to trasform my dataframe in a GRanges object so I try with makeGRangesFromDataFrame

neuron_gr <- makeGRangesFromDataFrame(neuron_df, keep.extra.columns = TRUE)

but my neuron_gr don't have a IRange valid, is like this:

>neuron_gr
GRanges object with 176 ranges and 1 metadata column:
        seqnames    ranges strand |        V5
           <Rle> <IRanges>  <Rle> | <numeric>
    [1]     chrI   1540683      * |   6.33554
    [2]     chrI   1838049      * |   2.81938
    [3]     chrI   2706245      * |   4.10906

I only have the start number and not the range in IRanges.

gr <- GRanges(seqnames=neuron_df$seqnames,
              ranges = IRanges(neuron_df$start, end=neuron_df$end),
              strand = Rle(strand(c(rep("*", length(neuron_df$strand))))),
              Conc = neuron_df$V5)

I also try with this command but also in this case it don't work How I can solve this problem? Thank you

GRanges • 476 views
ADD COMMENT
0
Entering edit mode

It's valid IRanges, it just doesn't show the end when printing to the screen because all of your ranges are a single base.

ADD REPLY
0
Entering edit mode

But when I try to do a matrix:

mat1 = normalizeToMatrix(neuron_gr, promoter, value_column = "V5",
                         extend = 500, mean_mode = "w0", w = 50)

it is emty even if the output is like this

> mat1
Normalize neuron_gr to promoter:
  Upstream 500 bp (10 windows)
  Downstream 500 bp (10 windows)
  Include target regions (13 windows)
  46887 target regions

because I want to do a heatmap but is completely withe

ADD REPLY

Login before adding your answer.

Traffic: 2017 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6