wiggleplotr icon indicating copy to clipboard operation
wiggleplotr copied to clipboard

Request for Guidance to make plot .

Open BiodeB opened this issue 5 months ago • 0 comments

Hello

I am grateful for your wonderful R program for generating graphic genes and exons. Nevertheless, I also intended to create a coverage plot using an separating intron and exon plot for the TP53 gene using a read bed file. But I'm having trouble plotting that.

This is my exon data, however I'm unbale to get exon_id as mentioned in the tutorial dataset ncoa7_exons (https://bioconductor.org/packages/release/bioc/vignettes/wiggleplotr/inst/doc/wiggleplotr.html)

TP53_exon_Fdf
# A tibble: 242 × 9
   group group_name      seqnames   start     end width starnd exon_name       exon_rank
   <dbl> <chr>              <dbl>   <dbl>   <dbl> <dbl> <chr>  <chr>               <dbl>
 1     1 ENST00000269305       17 7676382 7676403    22 -      ENSE00002419584         3
 2     1 ENST00000269305       17 7675994 7676272   279 -      ENSE00003625790         4
 3     1 ENST00000269305       17 7675053 7675236   184 -      ENSE00003518480         5
 4     1 ENST00000269305       17 7674859 7674971   113 -      ENSE00003723991         6
 5     1 ENST00000269305       17 7674181 7674290   110 -      ENSE00003712342         7
 6     1 ENST00000269305       17 7673701 7673837   137 -      ENSE00003725258         8
 7     1 ENST00000269305       17 7673535 7673608    74 -      ENSE00003786593         9
 8     1 ENST00000269305       17 7670609 7670715   107 -      ENSE00003545950        10
 9     1 ENST00000269305       17 7676521 7676622   102 -      ENSE00004023728         2
10     1 ENST00000269305       17 7668421 7669690  1270 -      ENSE00004023724        11
# ℹ 232 more rows
# ℹ Use `print(n = ...)` to see more rows

This is TP53 metadata,

TP53_metadata
# A tibble: 33 × 4
   transcript_id   gene_id         gene_name strand
   <chr>           <chr>           <chr>      <dbl>
 1 ENST00000413465 ENSG00000141510 TP53          -1
 2 ENST00000635293 ENSG00000141510 TP53          -1
 3 ENST00000714356 ENSG00000141510 TP53          -1
 4 ENST00000359597 ENSG00000141510 TP53          -1
 5 ENST00000504290 ENSG00000141510 TP53          -1
 6 ENST00000504937 ENSG00000141510 TP53          -1
 7 ENST00000510385 ENSG00000141510 TP53          -1
 8 ENST00000610623 ENSG00000141510 TP53          -1
 9 ENST00000618944 ENSG00000141510 TP53          -1
10 ENST00000619186 ENSG00000141510 TP53          -1

TP53_exon_gr<-  makeGRangesFromDataFrame(TP53_exon_Fdf, keep.extra.columns=TRUE,ignore.strand=TRUE,
                                         na.rm=TRUE)

plotTranscripts(TP53_exon_gr, TP53_metadata_filtered, rescale_introns = FALSE)
Error: exons is not a list or is(object = exons, class2 = "GRangesList") is not TRUE

This is sample , defining location of the reads value is number of reads on that particular location,

sample_TP53_s
# A tibble: 228 × 6
   chrom   start     end value gene  strand
   <chr>   <dbl>   <dbl> <dbl> <chr>  <dbl>
 1 chr17 7661825 7662005     1 TP53      -1
 2 chr17 7661871 7662040     1 TP53      -1
 3 chr17 7661989 7662158     1 TP53      -1
 4 chr17 7662069 7662194     1 TP53      -1
 5 chr17 7662182 7662318     1 TP53      -1
 6 chr17 7662265 7662425     1 TP53      -1
 7 chr17 7662379 7662549     1 TP53      -1
 8 chr17 7662581 7662754     1 TP53      -1
 9 chr17 7662701 7662862     1 TP53      -1
10 chr17 7662710 7662884     1 TP53      -1

Help me how to get such plot from this dataset using wiggleplotr tutorial.

BiodeB avatar Sep 26 '24 06:09 BiodeB