I would like analyze 17 probes separately, and each of them can be in a different chromosome. Then I have two levels: probes and chr:
probes <- c("BovineHD0500029561","BovineHD1100020616","BTB-00266062","BovineHD0200040828","BovineHD0100013622","BovineHD0100009413","BovineHD0300027356","BovineHD0600029053","BovineHD1500024004","BovineHD0200005954","BovineHD2900000062","BovineHD0200008162","BovineHD0400026684","BovineHD0200037832","BovineHD0300035509","Hapmap40156-BTA-103844","BovineHD0400022157")
chr <- c("chr5", "chr11", "chr12", "chr2", "chr1", "chr1", "chr3", "chr6", "chr15", "chr2", "chr29", "chr2", "chr4", "chr2", "chr3", "chr21", "chr4")
I would like to apply this loop:
{
chr2 <- read.table("LRRadjustedall",chr,".txt", sep=";", header=TRUE)
probe <- c("probes")
pdf("boxplot""probes"".pdf")
boxplot(mat.num[,2], xlab="probes", ylab="LRR", main="probes")
}
I mean, repeat these above commands 17 times. The first with BovineHD0500029561==probes and chr5==chr
... and the last BovineHD0400022157==probes and chr4==chr
.
Any suggestions? Cheers!
I'm not quite sure if I understand you correctly. Am I right to assume that you want to apply the code to your 17 pairs of probe+chr? Is
chr
a placeholder for "chr5",... in"LRRadjustedall",chr,".txt"
? Why do you declareprobe <- c("probes")
and don't use it afterwards?I added an answer to what I think you want to do, however, the code you provided does not really make full use of the variables you provided.