Biocircos Link Track automation issue in R studio

Hi,

I would like to automate Biocircos plot in R studio and here is my code. However, I am not able to link the tracks when I am using whole file.

Input file

All_C1.txt

query pos1 sub pos2
AUSP_1 15147 AUSA_2 93903
AUSP_1 15147 AUSA_1 93903
AUSP_2 15182 AUSA_4 93938
AUSP_1 15204 AUSA_1 93960
AUSP_3 15228 AUSA_6 93984
AUSP_1 15242 AUSA_1 93998
AUSP_4 15263 AUSA_8 94019
AUSP_1 15264 AUSA_1 94021
AUSP_5 15285 AUSA_9 94042
AUSP_1 15287 AUSA_1 94044
AUSP_6 15301 AUSA_3 94058
AUSP_1 15309 AUSA_1 94066
AUSP_7 15313 AUSA_5 94070
AUSP_9 15319 AUSA_1 94076
AUSP_8 15320 AUSA_7 94077

library(BioCircos)
setwd("/PATH/TO/FILE")
data <- read.table("All_C1.txt")
head(data)

myGenomeAus0 = list("AUSP_1" = 31248581,
"AUSP_2" = 31645086,
"AUSP_3" = 47108296,
"AUSP_4" = 29969644,
"AUSP_5" = 36443716,
"AUSP_6" = 26560673,
"AUSP_7" = 28486927,
"AUSP_8" = 29326496,
"AUSP_9" = 29774650,
"AUSA_1" = 31122193,
"AUSA_2" = 32101233,
"AUSA_3" = 46783639,
"AUSA_4" = 29229108,
"AUSA_5" = 36358360,
"AUSA_6" = 26077416,
"AUSA_7" = 27897604,
"AUSA_8" = 29233132,
"AUSA_9" = 30348868)

links_chromosomes_1 <- read.table("All_C1.txt")
V1 <- links_chromosomes_1[1]
#V1

links_pos_1 <- read.table("All_C1.txt")
V2 <- links_pos_1[2]
#V2

links_chromosomes_2 <- read.table("All_C1.txt")
V3 <- links_chromosomes_2[3]
#V3

links_pos_2 <- read.table("All_C1.txt")
V4 <- links_pos_2[4]

for (i in data$V1[2]){
print (i)
for (j in data$V2[2]){
print (j)
for (k in data$V3[2]){
print (k)
for (l in data$V4[2]){
print (l)
tracklist = BioCircosLinkTrack('myLinkTrack', i, j, j,
k, l, l, genome = myGenomeAus0,
maxRadius = 1, color = "black", width = "1.0em",
displayAxis = TRUE, axisColor = "black", axisWidth = 0.5,
axisPadding = 0, displayLabel = TRUE, labelColor = "black",
labelSize = "1em")
}
}
}
}

BioCircos(tracklist, genome = myGenomeAus0, genomeFillColor = c("Spectral"),
chrPad = 0.05, displayGenomeBorder = FALSE,
genomeTicksDisplay = FALSE, genomeLabelTextSize = "20pt", genomeLabelDy = 0)

Can anyone help to make this automated? I have a large file.

Thank you in advance
Karl

A post was merged into an existing topic: Biocircos links automation

Please do not duplicate open topics