Entering edit mode
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"))
Do you have any idea why this could be happening?
Thanks
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:
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. YourAlignmentsTrack
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 toplotTracks
. 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 yourGeneRegionTrack
, but appear to want Ensembl locations. You don't say how you created thatTxDb
, and it doesn't appear to be a Bioconductor package, but normally aTxDb
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).