This is a test version of Biostars. For the public version, visit https://www.biostars.org.
why makeGRangesFromDataFrame don't do the IRange

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

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.

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

0 answers

No answers yet.

Log in to answer this question.