QPix2 setup

In this post I will provide some setup information for a later post that will discuss extracting clone IDs from a Qpix XML log file. This post consists of two sections, input files and custom methods.

Input files

Plate map file

The amplicon plate map provides the clone ID associated with the PCR product in each well of the 96 well pcr plate. This is the ID that ultimately you would like to associate with a colony.

1
2
3
4
5
6
7
8
9
10
11
assoc.file <- "amplicon-plate-map.txt"
assoc <- read.table( paste(getwd(),"input", assoc.file, sep="\\"), skip=0, header=TRUE)
> assoc
id dest.plate dest.well
1 PL101-VH amplicons A01
2 PL102-VH amplicons B01
3 PL103-VH amplicons C01
4 PL18-VH amplicons D01
5 PL28-VH amplicons E01
6 PL38-VH amplicons F01

QPix2 XML files

These are the log files retrieved from the Qpix post run.

[Example 1](QSoft Log 2014-02-11 103410.XML)
[Example 2](QSoft Log 2014-02-11 105201.XML)

Useful Methods

getDeckWell()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
getDeckWell <- function( x, y, region){
#region is 1 or 2
cols <- c("01","02","03","04","05","06","07","08","09","10","11","12")
rows <- c("H","G","F","E","D","C","B","A")
##note that if a colony has equal but opposite sign offsets with two columns, this algorithm will fail!!
x.offset <- x.cent-x
y.offset <- switch( region,
"1" = yr1.cent-y,
"2" = yr2.cent-y)

paste(rows[ which(abs(y.offset)==min(abs(y.offset)))],
cols[ which(abs(x.offset)==min(abs(x.offset)))], sep="")

}

getWell96()

The function returns the opposite of what was supplied as a well ID i.e. provide well number get back the three character well ID. Provide three character well ID get back well number.

First create a table associating the three character well ID with well number.

1
2
3
4
5
6
7
8
9
10
> well.ids
name n
1 A01 1
2 B01 2
3 C01 3
4 D01 4
5 E01 5
6 F01 6
7 G01 7
8 H01 8

Once the table is defined, lookup either integer or three character well ID using the function argument.

1
2
3
4
5
6
7
8
9
10
11
12
getWell96 <- function( id ){
n <- 1:96
row <- rep(LETTERS[1:8],12)
col <- sort(rep(1:12, 8))
zero <- c(rep(0,72), rep("",24))
name <- I(paste(row,zero,col, sep="")) #I() is as.is to prevent factorization
well.ids <- data.frame(name, n)

if( id %in% name) {well.ids[well.ids$name==id,"n"]
}else{
well.ids[well.ids$n==id,"name"]}
}

insert0inWell()

Work only with three character well IDs e.g. A01, not A1. insert0inWell will insert a “0” in a 2 character well ID.

1
2
3
4
insert0inWell <- function( id){
if( nchar(id) == 2 ){ paste( substr(id, 1,1), "0", substr(id, 2,2), sep="")
}else{ id }
}
Share