AlignmentsTrack empty plot
1
0
Entering edit mode
karlaarz • 0
@karlaruizce30-23403
Last seen 20 months ago
Italy

Hello all,

I am trying to add the "AlignmentsTrack" as coverage and sashimi plot using one of my bam files. However, I get an empty plot as an output.

I've tried using "DataTrack" instead, playing with the max.height and min.height parameters and reinstalling the package but nothing worked. My code is:

#set genome and chromosome
gen <- 'hg38'
chr <- 'chr1'

afrom=93438921
ato=93565861

b1<- 'mysample.bam'

#genome axis track
gtrack <- GenomeAxisTrack()

#ideogram track
itrack <- IdeogramTrack(genome = gen, chromosome = chr)

#TxDb object
txdb <- makeTxDbFromGFF(file="assembled.gtf",
                        organism="Homo sapiens", format = "gtf")
#gene track
grtrack <- GeneRegionTrack(txdb,
                           genome = gen,
                           chromosome = chr,
                           fill='black',
                           transcriptAnnotation = "symbol",
                           name = "gene", background.title = "darkblue", exon = ex, stacking = 'squish')


alTrack <- AlignmentsTrack(range = b1, name = 'data', type= "coverage", 
                           isPaired = TRUE, genome = gen, chromosome = chr)

plotTracks(c(itrack, gtrack, alTrack, grtrack), from = afrom , to = afrom, chromosome = chr,
           type = c("coverage", "sashimi"))

enter image description here

Do you have any idea why this could be happening?

Thanks

Coverage RNASeq plot Gviz • 1.2k views
ADD COMMENT
0
Entering edit mode

Hi, I have the same problem. My bamfiles are generated with STAR. Just for troubleshooting, I tried a bamfile generated with bowtie2 and it plotted just fine. I am using STAR v2.7.10a. Any help would be greatly appreciated!

My code:

gene_track  = GeneRegionTrack(txdb, 
                              chr='chr9', 
                              genome='rn6', 
                              stacking = "squish", 
                              name = "Ensemble Genes",
                              fontcolor="black", 
                              background.title = "transparent",
                              fill="black",
                              fontcolor="black", 
                              background.title = "transparent",
                              col.axis="black",
                              fontcolor.title="black",
                              fontfamily="Helvetica",
                              fontfamily.title="Helvetica")

gtrack <- GenomeAxisTrack(fontcolor="black",
                          fontfamily="Helvetica",
                          fontfamily.title="Helvetica",
                          col="black")

atrack <- AlignmentsTrack("file.bam", isPaired = TRUE)

plotTracks(list(gtrack, atrack, gene_track), 
    from=71247731,
    to=71247944)


> sessionInfo()
R version 4.1.0 (2021-05-18)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS/LAPACK: /u/local/compilers/intel/2020.4/compilers_and_libraries_2020.4.304/linux/mkl/lib/intel64_lin/libmkl_gf_lp64.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8   
 [6] LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
 [1] grid      parallel  stats4    stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] VennDiagram_1.7.3           futile.logger_1.4.3         biomaRt_2.48.3              dplyr_1.0.10                MotifDb_1.34.0             
 [6] normr_1.18.1                EnrichedHeatmap_1.25.2      GenomicFeatures_1.44.2      AnnotationDbi_1.54.1        AnnotationHub_3.0.2        
[11] BiocFileCache_2.0.0         dbplyr_2.1.1                Gviz_1.36.2                 rtracklayer_1.52.1          circlize_0.4.15            
[16] ComplexHeatmap_2.13.1       GenomicAlignments_1.28.0    Rsamtools_2.8.0             Biostrings_2.60.2           XVector_0.32.0             
[21] compGenomRData_0.1.0        magrittr_2.0.3              profileplyr_1.11.3          stringr_1.4.0               ggpubr_0.4.0               
[26] ggplot2_3.3.6               data.table_1.14.2           DESeq2_1.32.0               SummarizedExperiment_1.22.0 Biobase_2.52.0             
[31] MatrixGenerics_1.4.3        matrixStats_0.62.0          GenomicRanges_1.44.0        GenomeInfoDb_1.33.3         IRanges_2.26.0             
[36] S4Vectors_0.30.2            BiocGenerics_0.38.0         viridis_0.6.2               viridisLite_0.4.0           RColorBrewer_1.1-3         
[41] pheatmap_1.0.12
ADD REPLY
0
Entering edit mode

Probably a couple of possibilities.

1.) If you are using Ensembl alignments, 'chr9' isn't going to work. That's a UCSC/NCBI chromosome designator. It's '9' for Ensembl.

2.) For plotTracks you are not specifying the chromosome. Your AlignmentsTrack object is a special object that basically points to the BAM file and has an embedded function to parse that file, based on the information provided to plotTracks. If you don't say the chromosome (using the correct chromosome designation) it won't return anything.

3.) You are using what appears to be a TxDb object for your GeneRegionTrack, but appear to want Ensembl locations. You don't say how you created that TxDb, and it doesn't appear to be a Bioconductor package, but normally a TxDb uses UCSC chromosome designations, and it's difficult to mix'n'match things like that.

Also, please don't just post replies to existing posts that are over 1.5 years old. Start a new one instead. In addition, when posting code, highlight all of your code and then click on the CODE button that is above the dialog box. Pasting in raw code without changing the formatting makes it difficult to read (and there is a box directly below the dialog box that shows how your post will render - if it looks bad, then it will look bad when you click the 'Save' button).

ADD REPLY
0
Entering edit mode
@james-w-macdonald-5106
Last seen 10 hours ago
United States

Is your 'ato' object intended to be a negative number?

ADD COMMENT
0
Entering edit mode

No, it was my mistake while copying the script, but the output is still the same. I've already edited the post by removing the negative symbol.

ADD REPLY

Login before adding your answer.

Traffic: 790 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