This is a test version of Biostars. For the public version, visit https://www.biostars.org.
RTrackLayer import bed without name and strand orientation

I have a bed file like this

ChrIII_A_nidulans_FGSC_A4   0   10  0.83700
ChrIII_A_nidulans_FGSC_A4   10  43  1.11600
ChrIII_A_nidulans_FGSC_A4   43  59  1.39500
ChrIII_A_nidulans_FGSC_A4   59  65  1.67400
ChrIII_A_nidulans_FGSC_A4   65  74  1.95300

As you can see there are no Strand name columns or Strand orientation column. If I try to import this file into R, it calls the score column as the name column

library(GenomicRanges)
library(rtracklayer)
library(IRanges)
file <- import.bed(file.path('C:/Users/ami/Downloads', file.bdg'))

The output for this is below

GRanges object with 4233716 ranges and 1 metadata column:
                         seqnames         ranges strand |        name
                            <Rle>      <IRanges>  <Rle> | <character>
    [1] ChrIII_A_nidulans_FGSC_A4       [ 1, 10]      * |     0.83700
    [2] ChrIII_A_nidulans_FGSC_A4       [11, 43]      * |     1.11600
    [3] ChrIII_A_nidulans_FGSC_A4       [44, 59]      * |     1.39500
    [4] ChrIII_A_nidulans_FGSC_A4       [60, 65]      * |     1.67400
    [5] ChrIII_A_nidulans_FGSC_A4       [66, 74]      * |     1.95300
    ...                       ...            ...    ... .         ...
    [4233712]   mito_A_nidulans_FGSC_A4 [33211, 33214]      * |     8.37000
    [4233713]   mito_A_nidulans_FGSC_A4 [33215, 33216]      * |     8.09100
    [4233714]   mito_A_nidulans_FGSC_A4 [33217, 33218]      * |     7.81200
    [4233715]   mito_A_nidulans_FGSC_A4 [33219, 33220]      * |     7.53300
    [4233716]   mito_A_nidulans_FGSC_A4 [33221, 33227]      * |     7.25400
    -------
    seqinfo: 9 sequences from an unspecified genome; no seqlengths

My overall objective is to create a TSS line plot using this bed file. How can I load a bed file properly in rtracklayer and ignore these columns?

rtracklayer bed r

0 answers

No answers yet.

Log in to answer this question.