Skip to content

Add warning when chromosome in track is not defined in genome #17

@koalive

Description

@koalive

I'm using BioCircos with the short script here attached. I wanted to contact you because the SNP track does not appear on the output graph and I couldn't find any reasons why. First, I set the chromosom number and length. Then I put a Background track in the object "tracklist". It's working so far. But when I add BioCircosSNPTrack, there is no difference in the output, like if I didn't add anything. Could you please help me with this problem ?

Shortened script:

library("BioCircos")
myGenome = list("A1"= 59.94, "A2" = 74.9, "A3" = 84.1,
                "A4" = 45.63, "A5" = 72.67, "A6" = 75.02, 
                "A7" = 53.76, "A8" = 54.79, "A9" = 98.81,
                "A10" = 51.8, "C1" = 54.99, "C2" = 70.61, 
                "C3" = 104.07, "C4" = 88.17, "C5" = 84.18, 
                "C6" = 60.23, "C7" = 63.12, "C8" = 69.55,
                "C9" = 75.3)

tracklist = BioCircosBackgroundTrack("myBackgroundTrack", 
	minRadius = 0.9, 
	maxRadius=0.9, 
	borderColors="#AAAAAA", 
	borderSize=0.6, 
	fillColors="#BBBBBB") + 
	BioCircosBackgroundTrack("myBackgroundTrack", 
		minRadius = 0.8, 
		maxRadius=0.8, 
		borderColors="#AAAAAA", 
		borderSize=0.6, 
		fillColors="#BBBBBB")
points_chromosomesLPR = c('A2', 'A5', 'A6', 'A07', 'C8', 'C9')
points_coordinatesLPR = c(14.8, 48.3, 4, 47.4, 64, 2.7)
points_values = 0:1
tracklist = tracklist + BioCircosSNPTrack('mySNPTrack', 
	points_chromosomesLPR, 
	points_coordinatesLPR, 
	points_values, 
	colors=c("black"), 
	minRadius = 0.8, 
	maxRadius = 0.9, 
	size = 2) 

BioCircos(tracklist, genome = myGenome, geomeFillColor = c("red"), 
	genomeTicksDisplay = TRUE, genomeLabelTextSize = "14pt")

Dear X,

It seems the main issue is a typo when you define the chromosome list for your SNP track (you didn't define the "A07" chromosome in points_chromosomesLPR, so I assume you meant "A7"). If I correct that and call BioCircos again, the SNPs are displayed correctly.
I guess adding a warning to the package when the chromosome is not defined would help avoiding these errors, so I'll add that as a suggestion on Github.
Cheers,

Loan

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions