Mononucleotide+Shape (MGW) Example (without reverse complement symmetry)

Gabriella Martini

2016-07-10

options(java.parameters = "-Xmx4000M")
library(SELEX)
library(SelexGLM)
library(grid)
workDir = "./cache/"
selex.config(workingDir=workDir, maxThreadNumber=4)

### LOCAL PATHS NEED TO BE RE-DEFINED TO RUN OFF OF MY COMPUTER
##################################################################
selexDir = "/Users/gabriella/Columbia/SELEX/"
rawdataDir = "/Users/gabriella/Columbia/rawdata/Mann/HM/"

# CLUSTER VERSIONS ARE COMMENTED OUT
#selexDir = "/vega/hblab/users/gdm2120/SELEX/SELEX/"
#rawdataDir = "/vega/hblab/projects/selex/rawdata/Mann/hm/"
##################################################################
saveDir = "gabriella/SelexGLMtest/ShapeNoSymmetry"
dir.create(file.path(selexDir, saveDir), showWarnings = FALSE, recursive = TRUE)


shapeTable = read.table(paste(selexDir, "gabriella/ShapeParamData/ShapeTableOrthogonal.txt", sep = ""), sep = "\t",
                        stringsAsFactors = FALSE)
ST = shapeTable[,c(1, 14:19)]
colnames(ST) = c("Sequence", "MGW", "ProT", "HelTA",
                 "HelTB", "RollA", "RollB")

selex.defineSample('r0',
                   paste(rawdataDir, "exp6/mplex1.0b.mplex2.0b.fastq.gz", sep = ""),
                   'm1r0',
                   0, 16, 'TGG', 'CCAGCTG')

selex.defineSample('r0',
                   paste(rawdataDir, "exp6/mplex1.0b.mplex2.0b.fastq.gz", sep = ""),
                   'm2r0',
                   0, 16, 'TGG', 'CCACGTC')



selex.defineSample('Ubx4a.R2',
                   paste(rawdataDir, "exp4/exdUbxiva.exdAntp.L.2.fastq.gz", sep = ""),
                   'HM.Ubx4a.Exd',
                   2, 16, 'TGG', 'CCAGCTG')

selex.defineSample('Ubx4a.R3',
                   paste(rawdataDir,"exp4/exdUbxiva.exdAntp.L.3.fastq.gz", sep = ""),
                   'HM.Ubx4a.Exd',
                   3, 16, 'TGG', 'CCAGCTG')




r0.train = selex.sample(seqName = 'r0', sampleName='m1r0', round = 0)
r0.test = selex.sample(seqName = 'r0', sampleName='m2r0', round = 0)
dataSample = selex.sample(seqName = 'Ubx4a.R2', sampleName = 'HM.Ubx4a.Exd', round = 2)

# MARKOV MODEL BUILT
kmax = selex.kmax(sample = r0.test)
# Train Markov model on Hm 16bp library Round 0 data
mm = selex.mm(sample = r0.train, order = NA, crossValidationSample =r0.test, Kmax = kmax, mmMethod = "TRANSITION")
mmscores = selex.mmSummary(sample = r0.train)
ido = which(mmscores$R==max(mmscores$R))
mm.order = mmscores$Order[ido]

libLen = as.numeric(as.character(selex.getAttributes(dataSample)$VariableRegionLength))


# For the sake of previous analysis on the Hox data used in this example, I will use kLen = 12 as my k-mer length, even though kLen identified through the information gain analysis has kLen = 13.
kLen = 12

#data.probeCounts = getProbeCounts(dataSample, markovModel = mm)
#save(data.probeCounts, file = paste(selexDir, saveDir, "/data.probeCounts.RData", sep = ""))
load(file = paste(selexDir, saveDir, "/data.probeCounts.RData", sep = ""))
#data.kmerTable = getKmerCountAffinities(dataSample, k = kLen, minCount = 100, markovModel = mm)
#save(data.kmerTable, file = paste(selexDir, saveDir, "/data.kmerTable.RData", sep = ""))
load(file = paste(selexDir, saveDir, "/data.kmerTable.RData", sep = ""))
# Inputs about library are data specific 
ModelTest = model(name = "HM-Exd-Ubx4a R2 Nucleotide+Shape Model",
                varRegLen = libLen,
                leftFixedSeq =  "GTTCAGAGTTCTACAGTCCGACGATCTGG", 
                rightFixedSeq ="CCAGCTGTCGTATGCCGTCTTCTGCTTG", 
                consensusSeq = "NTGAYNNAYNNN",
                affinityType = "AffinitySym",
                leftFixedSeqOverlap = 5,
                minAffinity = 0.00,
                missingValueSuppression = 1,
                minSeedValue = .001, 
                upFootprintExtend = 4,
                confidenceLevel = .95, 
                verbose = FALSE,
                includeShape = TRUE,
                shapeTable = ST,
                shapeParamsUsed = list(c("MGW")),
                rounds = list(c(2)),
                rcSymmetric = FALSE)

getFeatureDesign(ModelTest)
## Feature design for object of class 'model'
## 
## seedLen:  12 
## upFootprintExtend:  4 
## downFootprintExtend:  4 
## rcSymmetric:  FALSE 
## 
## Slot "N": 
## N.upFootprintExtend:  4 
## N.downFootprintExtend:  4 
## N.set:  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 
## Number of previous iterations:  0 
## 
## Slot "Intercept": 
## Number of Views per Strand of DNA: 7
## Number of Rounds: 1 (2)
## Number of previous iterations: 0
## 
## Slot "Shape": 
## ShapeParamsUsed:  MGW 
## Shape.upFootprintExtend:  4 
## Shape.downFootprintExtend:  4 
## Shape.set:  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 
## Number of previous iterations:  0
# Add seed model
addSeedPsam(ModelTest) = seedTable2psam(ModelTest, data.kmerTable)

# Model nucleotide Betas after seed PSAM is added
print(getValues(getN(ModelTest)))
##     1 2 3 4          5          6          7         8         9        10
## N.A 0 0 0 0  0.0000000 -0.8340377 -0.6171102  0.000000 -1.360965 -1.476628
## N.C 0 0 0 0 -0.8162560 -1.8500362 -3.1650820 -2.675131 -1.992603 -2.448111
## N.G 0 0 0 0 -0.2525938 -2.1521858  0.0000000 -2.618543 -1.264517 -2.484039
## N.T 0 0 0 0 -0.4154319  0.0000000 -1.3143951 -2.908717  0.000000  0.000000
##            11        12        13          14         15         16 17 18
## N.A -1.118790  0.000000 -2.022527 -0.86831649  0.0000000 -0.7152829  0  0
## N.C -2.174582 -3.392451 -1.355055 -1.05294403 -1.6266289  0.0000000  0  0
## N.G -1.362605 -2.603949 -1.716115 -0.02638645 -0.0963874 -0.3890593  0  0
## N.T  0.000000 -3.561304  0.000000  0.00000000 -1.0818102 -0.2918482  0  0
##     19 20
## N.A  0  0
## N.C  0  0
## N.G  0  0
## N.T  0  0
plot(ModelTest@features@N, Ntitle = "HM-Ubx4a-Exd R2 Nucleotide Features\nSeeding Model", ddG = TRUE)

Next we score the probes using topModelMatch

sample1 = sample(nrow(data.probeCounts), 1000000)
data = data.probeCounts[sample1, ]
#data = data.probeCounts
data = topModelMatch(data, ModelTest)
# Uses aligned probes to build design matrix
data = addDesignMatrix(data, ModelTest)
if (nrow(data) > 0) {
  designMatrixSummary = getDesignMatrix(ModelTest, data)
  print("Round summary: ")
  print (designMatrixSummary$Round)
  print("Mono-nucleotide summary: ")
  print (designMatrixSummary$N)
  print("View/strand orientation summary: ")
  print (designMatrixSummary$Intercept)
  # # Constructs regression expression with independent features using design matrix
  regressionFormula = updatedRegressionFormula(data, ModelTest)
  print("Regression Formula: ")
  print (regressionFormula)
  fit = glm(regressionFormula, 
            data=data, 
            family = poisson(link="log"))
  summary(fit)
  ModelTest = addNewBetas(ModelTest, data, fit)
  # # Nucleotide Features after first round of fitting
  summary(ModelTest)
  vPheight = verticalPlot_height(ModelTest)
  pM <- plot(ModelTest, plotTitle = "HM-Ubx4a-Exd R2 Nucleotide+Shape Fit", Nplot.ddG = TRUE, verticalPlots = TRUE)
  ggplot2::ggsave(pM, file = paste(selexDir, saveDir, "/modelPlot.pdf", sep = ""), height = vPheight, width = 6)
  ggplot2::ggsave(pM, file = paste(selexDir, saveDir, "/modelPlot.",1, ".pdf", sep = ""), height = vPheight, width = 6)
}
## [1] "Round summary: "
##            2  Total
## Round 793174 793174
## [1] "Mono-nucleotide summary: "
##       N.A    N.C    N.G    N.T
## 1   68476 184012 306705 233981
## 2   99593 162624 310887 220070
## 3  138085  86021 374727 194341
## 4  146328 108588 377555 160703
## 5  328974  64094 265609 134497
## 6  114523  24727  23828 630096
## 7  176145   2325 537294  77410
## 8  745682  14621  18514  14357
## 9   48847  17653  48493 678181
## 10  45570   9870  13946 723788
## 11  57770  14287  46875 674242
## 12 767868   6137  14683   4486
## 13  15074 102782  19829 655489
## 14 102435  45997 391016 253726
## 15 331920  51480 282888 126886
## 16  96756 363132 157189 176097
## 17 124692 405736 102523 160223
## 18 235939 321857  92180 143198
## 19 190242 291613 197148 114171
## 20 210546 359267 154557  68804
## [1] "View/strand orientation summary: "
##          View.1 View.2 View.3 View.4 View.5 View.6 View.7 StrandTotal
## Strand.F  49803  82297  75239  67602  68220  68774  81852      493787
## Strand.R  37176  49801  47214  36470  38110  41172  49444      299387
## [1] "Regression Formula: "
## [1] "ObservedCount ~ offset(logProb)+N.A1+N.C1+N.T1+N.A2+N.C2+N.T2+N.A3+N.C3+N.T3+N.A4+N.C4+N.T4+N.C5+N.G5+N.T5+N.A6+N.C6+N.G6+N.A7+N.C7+N.T7+N.C8+N.G8+N.T8+N.A9+N.C9+N.G9+N.A10+N.C10+N.G10+N.A11+N.C11+N.G11+N.C12+N.G12+N.T12+N.A13+N.C13+N.G13+N.A14+N.C14+N.T14+N.C15+N.G15+N.T15+N.A16+N.G16+N.T16+N.A17+N.G17+N.T17+N.A18+N.G18+N.T18+N.A19+N.G19+N.T19+N.A20+N.G20+N.T20+Shape.MGW1+Shape.MGW2+Shape.MGW3+Shape.MGW4+Shape.MGW5+Shape.MGW6+Shape.MGW7+Shape.MGW8+Shape.MGW9+Shape.MGW10+Shape.MGW11+Shape.MGW12+Shape.MGW13+Shape.MGW14+Shape.MGW15+Shape.MGW16+Shape.MGW17+Shape.MGW18+Shape.MGW19+Shape.MGW20"
## An object of class 'model'
## 
## Slot "name":  HM-Exd-Ubx4a R2 Nucleotide+Shape Model 
## Slot "varRegLen":  16 
## Slot "leftFixedSeq":  GTTCAGAGTTCTACAGTCCGACGATCTGG 
## Slot "rightFixedSeq":  CCAGCTGTCGTATGCCGTCTTCTGCTTG 
## Slot "leftFixedSeqOverlap":  5 
## Slot "rightFixedSeqOverlap":  5 
## Slot "confidenceLevel":  0.95 
## Slot "minAffinity":  0 
## Slot "missingValueSuppression":  1 
## Slot "minSeedValue":  0.001 
## Slot "seedLen":  12 
## Slot "consensusSeq":  [ACGT]TGA[CT][ACGT][ACGT]A[CT][ACGT][ACGT][ACGT] 
## Slot "upFootprintExtend":  4 
## Slot "downFootprintExtend":  4 
## Slot "fpLen":  20 
## 
## Fits a model of footprint length 20 for mono-nucleotide and shape features (shape = MGW)  with 7 view(s) per strand of DNA and 1 round(s) of data (round = 2) without reverse complement symmetry.
## 
## Slot "regressionFormula":  ObservedCount ~ offset(logProb)+Round.2+N.A1+N.C1+N.G1+N.T1+N.A2+N.C2+N.G2+N.T2+N.A3+N.C3+N.G3+N.T3+N.A4+N.C4+N.G4+N.T4+N.A5+N.C5+N.G5+N.T5+N.A6+N.C6+N.G6+N.T6+N.A7+N.C7+N.G7+N.T7+N.A8+N.C8+N.G8+N.T8+N.A9+N.C9+N.G9+N.T9+N.A10+N.C10+N.G10+N.T10+N.A11+N.C11+N.G11+N.T11+N.A12+N.C12+N.G12+N.T12+N.A13+N.C13+N.G13+N.T13+N.A14+N.C14+N.G14+N.T14+N.A15+N.C15+N.G15+N.T15+N.A16+N.C16+N.G16+N.T16+N.A17+N.C17+N.G17+N.T17+N.A18+N.C18+N.G18+N.T18+N.A19+N.C19+N.G19+N.T19+N.A20+N.C20+N.G20+N.T20+Shape.MGW1+Shape.MGW2+Shape.MGW3+Shape.MGW4+Shape.MGW5+Shape.MGW6+Shape.MGW7+Shape.MGW8+Shape.MGW9+Shape.MGW10+Shape.MGW11+Shape.MGW12+Shape.MGW13+Shape.MGW14+Shape.MGW15+Shape.MGW16+Shape.MGW17+Shape.MGW18+Shape.MGW19+Shape.MGW20 
## 
## Slot "shapeParamsUsed[[1]]":  MGW 
## 
## Includes the following feature sub-classes: 
## An object of class 'N'
## Fits 20 nucleotides for a feature model of length 20.
## Nucleotide beta values:
##               1           2            3           4          5          6
## N.A  0.01253234  0.02422729 -0.004104566 -0.02256017  0.0000000 -0.9634024
## N.C -0.00684892 -0.08913195 -0.145321408 -0.14335588 -0.8828338 -1.7860495
## N.G  0.00000000  0.00000000  0.000000000  0.00000000 -0.3307293 -2.0625280
## N.T -0.09519787 -0.04892703 -0.149203769 -0.02932519 -0.5747389  0.0000000
##              7         8         9        10         11        12
## N.A -0.3537259  0.000000 -1.125992 -0.417799 -0.3082163  0.000000
## N.C -2.7547602 -2.406471 -2.114720 -1.382037 -0.3758490 -2.213119
## N.G  0.0000000 -2.189851 -1.202262 -1.513932 -0.5736097 -1.958444
## N.T -1.1756356 -2.420402  0.000000  0.000000  0.0000000 -2.713184
##             13          14          15         16         17          18
## N.A -1.5053420 -0.65732779  0.00000000 -0.4872643 -0.3003743 -0.13422046
## N.C -0.4392728 -0.69212185 -0.96435519  0.0000000  0.0000000  0.00000000
## N.G -1.6782230  0.00000000 -0.09941264 -0.2371231 -0.3375361 -0.13494208
## N.T  0.0000000  0.01153419 -0.50152085 -0.3131210 -0.1186828  0.05193197
##              19          20
## N.A -0.03798651 -0.04430404
## N.C  0.00000000  0.00000000
## N.G -0.11477706 -0.07067889
## N.T  0.12674745  0.04689794
## 
## Nucleotide beta errors:
##               1           2           3           4           5
## N.A 0.001730025 0.001515151 0.001309331 0.001203275 0.000000000
## N.C 0.001692673 0.001603213 0.001586115 0.001489542 0.002247789
## N.G 0.000000000 0.000000000 0.000000000 0.000000000 0.001273625
## N.T 0.001318391 0.001431322 0.001270967 0.001315664 0.001818186
##               6           7          8           9         10          11
## N.A 0.002933775 0.007293060 0.00000000 0.005232921 0.01115106 0.009678476
## N.C 0.008006628 0.083141739 0.02380024 0.013457318 0.02933847 0.013680335
## N.G 0.010977468 0.000000000 0.01515640 0.005161231 0.02213771 0.010250919
## N.T 0.000000000 0.006585288 0.02088548 0.000000000 0.00000000 0.000000000
##             12          13          14           15          16
## N.A 0.00000000 0.018438536 0.001691740 0.0000000000 0.001509708
## N.C 0.05058025 0.004310961 0.002950786 0.0028247421 0.000000000
## N.G 0.02054346 0.012004657 0.000000000 0.0009323067 0.001186250
## N.T 0.06610678 0.000000000 0.002220033 0.0017555444 0.001198207
##              17          18          19          20
## N.A 0.001444674 0.001459143 0.001622719 0.001289260
## N.C 0.000000000 0.000000000 0.000000000 0.000000000
## N.G 0.001511270 0.001629345 0.001681206 0.001758219
## N.T 0.001173194 0.001337781 0.001525839 0.001806511
## 
## 
## An object of class 'Intercept'
## Fits intercept(s) for 1 round(s) (round = 2).
## Intercept beta values:
## Round.2:
## [1] 23.49162
## 
## Intercept beta errors:
## Round.2:
## [1] 0.02267907
## 
## 
## 
## An object of class 'Shape'
## Fits 20 shape coefficients for 1 kinds of shape parameter(s) (shape = MGW) for a feature model of length 20.
## Shape beta values:
##                     1           2           3          4            5
## Shape.MGW -0.05714087 -0.01888749 0.008281527 -0.1176119 -0.005593158
##                     6         7         8         9         10        11
## Shape.MGW -0.09592255 0.1174069 0.1317001 0.3645446 -0.3005793 -1.370984
##                 12        13          14        15        16          17
## Shape.MGW 1.701667 0.1966173 -0.01839352 0.1569843 0.2136021 -0.03073746
##                    18        19          20
## Shape.MGW -0.03548669 0.0588744 -0.06665534
## 
## Shape beta errors:
##                     1           2           3           4          5
## Shape.MGW 0.002757371 0.003161373 0.002772485 0.002706141 0.00270645
##                     6           7           8           9         10
## Shape.MGW 0.002777458 0.005645016 0.008375105 0.008153703 0.02007272
##                  11         12          13          14          15
## Shape.MGW 0.0316683 0.01152384 0.003762656 0.003578138 0.002640943
##                    16          17          18          19          20
## Shape.MGW 0.002766115 0.002930304 0.002985942 0.003388282 0.002880248

some text

data = data.probeCounts[sample1, ]
#data = data.probeCounts
data.nrow = nrow(data)
data = topModelMatch(data, ModelTest)
data = addDesignMatrix(data, ModelTest)
if (nrow(data) > 0) {
  designMatrixSummary.v2 = getDesignMatrix(ModelTest, data)
  if ((all(designMatrixSummary.v2$N == designMatrixSummary$N)) & (all(designMatrixSummary.v2$Round == designMatrixSummary$Round)) & (all(designMatrixSummary.v2$Intercept == designMatrixSummary$Intercept)))  {
    print ("Stability Reached")
  }
} 

for (i in 2:20) {
  if (nrow(data) == 0) {
    break
  } else if ((all(designMatrixSummary.v2$N == designMatrixSummary$N)) & (all(designMatrixSummary.v2$Round == designMatrixSummary$Round)) & (all(designMatrixSummary.v2$Intercept == designMatrixSummary$Intercept)))  {
    break
  }
  data.nrow = nrow(data)
  print (paste("i =",i))
  
  designMatrixSummary = getDesignMatrix(ModelTest, data)
  print("Round summary: ")
  print (designMatrixSummary$Round)
  print("Mono-nucleotide summary: ")
  print (designMatrixSummary$N)
  print("View/strand orientation summary: ")
  print (designMatrixSummary$Intercept)
  # # Constructs regression expression with independent features using design matrix
  regressionFormula = updatedRegressionFormula(data, ModelTest)
  print("Regression Formula: ")
  print (regressionFormula)
  fit = glm(regressionFormula, 
            data=data, 
            family = poisson(link="log"))
  summary(fit)
  ModelTest = addNewBetas(ModelTest, data, fit)
  # # Nucleotide Features after first round of fitting
  summary(ModelTest)
  pM <- plot(ModelTest,  plotTitle = "HM-Ubx4a-Exd R2 Nucleotide+Shape Fit", Nplot.ddG = TRUE, verticalPlots = TRUE)
  ggplot2::ggsave(pM, file = paste(selexDir, saveDir, "/modelPlot.pdf", sep = ""), height = vPheight, width = 6)
  ggplot2::ggsave(pM, file = paste(selexDir, saveDir, "/modelPlot.",i, ".pdf", sep = ""), height = vPheight, width = 6)
  data = topModelMatch(data, ModelTest)
  data = addDesignMatrix(data, ModelTest)
  print(paste("Number of Observations in Design Matrix: ",nrow(data), sep = ""))
  if (nrow(data) > 0) {
    designMatrixSummary.v2 = getDesignMatrix(ModelTest, data)
    if ((all(designMatrixSummary.v2$N == designMatrixSummary$N)) & (all(designMatrixSummary.v2$Round == designMatrixSummary$Round)) & (all(designMatrixSummary.v2$Intercept == designMatrixSummary$Intercept)))  {
      print (paste("Stability Reached after ", i, " iterations.", sep = ""))
      break
    }
  } else  {
    print (paste("Algorithm failed to converge: No probes meet the confidence level requirement (Confidence Level:", ModelTest@confidenceLevel, ")", sep = ""))
  }
}
## [1] "i = 2"
## [1] "Round summary: "
##            2  Total
## Round 718845 718845
## [1] "Mono-nucleotide summary: "
##       N.A    N.C    N.G    N.T
## 1   59111 171292 274350 214092
## 2   88916 144275 285342 200312
## 3  123530  76181 350696 168438
## 4  136115  94901 347453 140376
## 5  302276  58577 233749 124243
## 6   99669  18577  16649 583950
## 7  173194   1374 476141  68136
## 8  691042  10265  10082   7456
## 9   40561  11430  39323 627531
## 10  42927   8082   9408 658428
## 11  49790  19473  39471 610111
## 12 697942   5807  12278   2818
## 13   9137 107237  13062 589409
## 14  96949  35904 377582 208410
## 15 289732  48119 259884 121110
## 16  89022 324914 151404 153505
## 17 114469 364783  93858 145735
## 18 210253 289583  85325 133684
## 19 170002 266112 174918 107813
## 20 189667 328203 138202  62773
## [1] "View/strand orientation summary: "
##          View.1 View.2 View.3 View.4 View.5 View.6 View.7 StrandTotal
## Strand.F  43989  76653  70489  61005  59918  59833  69536      441423
## Strand.R  34004  47305  46238  33898  34985  37069  43923      277422
## [1] "Regression Formula: "
## [1] "ObservedCount ~ offset(logProb)+N.A1+N.C1+N.T1+N.A2+N.C2+N.T2+N.A3+N.C3+N.T3+N.A4+N.C4+N.T4+N.C5+N.G5+N.T5+N.A6+N.C6+N.G6+N.A7+N.C7+N.T7+N.C8+N.G8+N.T8+N.A9+N.C9+N.G9+N.A10+N.C10+N.G10+N.A11+N.C11+N.G11+N.C12+N.G12+N.T12+N.A13+N.C13+N.G13+N.A14+N.C14+N.T14+N.C15+N.G15+N.T15+N.A16+N.G16+N.T16+N.A17+N.G17+N.T17+N.A18+N.G18+N.T18+N.A19+N.G19+N.T19+N.A20+N.G20+N.T20+Shape.MGW1+Shape.MGW2+Shape.MGW3+Shape.MGW4+Shape.MGW5+Shape.MGW6+Shape.MGW7+Shape.MGW8+Shape.MGW9+Shape.MGW10+Shape.MGW11+Shape.MGW12+Shape.MGW13+Shape.MGW14+Shape.MGW15+Shape.MGW16+Shape.MGW17+Shape.MGW18+Shape.MGW19+Shape.MGW20"
## An object of class 'model'
## 
## Slot "name":  HM-Exd-Ubx4a R2 Nucleotide+Shape Model 
## Slot "varRegLen":  16 
## Slot "leftFixedSeq":  GTTCAGAGTTCTACAGTCCGACGATCTGG 
## Slot "rightFixedSeq":  CCAGCTGTCGTATGCCGTCTTCTGCTTG 
## Slot "leftFixedSeqOverlap":  5 
## Slot "rightFixedSeqOverlap":  5 
## Slot "confidenceLevel":  0.95 
## Slot "minAffinity":  0 
## Slot "missingValueSuppression":  1 
## Slot "minSeedValue":  0.001 
## Slot "seedLen":  12 
## Slot "consensusSeq":  [ACGT]TGA[CT][ACGT][ACGT]A[CT][ACGT][ACGT][ACGT] 
## Slot "upFootprintExtend":  4 
## Slot "downFootprintExtend":  4 
## Slot "fpLen":  20 
## 
## Fits a model of footprint length 20 for mono-nucleotide and shape features (shape = MGW)  with 7 view(s) per strand of DNA and 1 round(s) of data (round = 2) without reverse complement symmetry.
## 
## Slot "regressionFormula":  ObservedCount ~ offset(logProb)+Round.2+N.A1+N.C1+N.G1+N.T1+N.A2+N.C2+N.G2+N.T2+N.A3+N.C3+N.G3+N.T3+N.A4+N.C4+N.G4+N.T4+N.A5+N.C5+N.G5+N.T5+N.A6+N.C6+N.G6+N.T6+N.A7+N.C7+N.G7+N.T7+N.A8+N.C8+N.G8+N.T8+N.A9+N.C9+N.G9+N.T9+N.A10+N.C10+N.G10+N.T10+N.A11+N.C11+N.G11+N.T11+N.A12+N.C12+N.G12+N.T12+N.A13+N.C13+N.G13+N.T13+N.A14+N.C14+N.G14+N.T14+N.A15+N.C15+N.G15+N.T15+N.A16+N.C16+N.G16+N.T16+N.A17+N.C17+N.G17+N.T17+N.A18+N.C18+N.G18+N.T18+N.A19+N.C19+N.G19+N.T19+N.A20+N.C20+N.G20+N.T20+Shape.MGW1+Shape.MGW2+Shape.MGW3+Shape.MGW4+Shape.MGW5+Shape.MGW6+Shape.MGW7+Shape.MGW8+Shape.MGW9+Shape.MGW10+Shape.MGW11+Shape.MGW12+Shape.MGW13+Shape.MGW14+Shape.MGW15+Shape.MGW16+Shape.MGW17+Shape.MGW18+Shape.MGW19+Shape.MGW20 
## 
## Slot "shapeParamsUsed[[1]]":  MGW 
## 
## Includes the following feature sub-classes: 
## An object of class 'N'
## Fits 20 nucleotides for a feature model of length 20.
## Nucleotide beta values:
##               1           2            3           4          5          6
## N.A  0.01303624  0.02333854 -0.004448227 -0.02465040  0.0000000 -0.9580722
## N.C -0.00803897 -0.08801543 -0.145762514 -0.14098853 -0.8766590 -1.7741143
## N.G  0.00000000  0.00000000  0.000000000  0.00000000 -0.3257703 -2.0850529
## N.T -0.09478026 -0.04763455 -0.150319230 -0.02889116 -0.5705516  0.0000000
##              7         8         9         10         11       12
## N.A -0.2573452  0.000000 -1.037550 -0.4749251 -0.3030826  0.00000
## N.C -2.9180643 -2.412408 -2.105038 -1.5758723 -0.2296450 -2.14154
## N.G  0.0000000 -2.257469 -1.176598 -1.5766645 -0.5848880 -1.99332
## N.T -1.1355217 -2.449646  0.000000  0.0000000  0.0000000 -3.05351
##             13          14         15         16         17          18
## N.A -1.5120908 -0.65367426  0.0000000 -0.4840579 -0.2978173 -0.13225297
## N.C -0.4320931 -0.65117187 -0.9592219  0.0000000  0.0000000  0.00000000
## N.G -1.6775303  0.00000000 -0.1048427 -0.2360431 -0.3335634 -0.13479915
## N.T  0.0000000  0.02054396 -0.5005907 -0.3075896 -0.1159250  0.05339655
##              19          20
## N.A -0.03556321 -0.04494359
## N.C  0.00000000  0.00000000
## N.G -0.11278880 -0.07155572
## N.T  0.12777052  0.04566769
## 
## Nucleotide beta errors:
##               1           2           3           4           5
## N.A 0.001753968 0.001533149 0.001320215 0.001209217 0.000000000
## N.C 0.001707870 0.001623550 0.001599954 0.001511712 0.002271029
## N.G 0.000000000 0.000000000 0.000000000 0.000000000 0.001286486
## N.T 0.001330850 0.001446912 0.001289105 0.001322918 0.001833499
##               6           7          8           9         10          11
## N.A 0.002967534 0.006746663 0.00000000 0.005084237 0.01074577 0.009644028
## N.C 0.008897488 0.124721841 0.02499635 0.014297701 0.03682919 0.012075984
## N.G 0.011756618 0.000000000 0.01909055 0.005165673 0.02655919 0.010153420
## N.T 0.000000000 0.006560644 0.02555518 0.000000000 0.00000000 0.000000000
##             12          13          14           15          16
## N.A 0.00000000 0.018834406 0.001700033 0.0000000000 0.001519906
## N.C 0.05320096 0.004241282 0.003070782 0.0028696272 0.000000000
## N.G 0.02113605 0.012131875 0.000000000 0.0009430028 0.001189164
## N.T 0.07917382 0.000000000 0.002199117 0.0017724552 0.001214297
##              17          18          19          20
## N.A 0.001451942 0.001465615 0.001633269 0.001300938
## N.C 0.000000000 0.000000000 0.000000000 0.000000000
## N.G 0.001519798 0.001638723 0.001690583 0.001771719
## N.T 0.001181133 0.001343961 0.001532647 0.001817516
## 
## 
## An object of class 'Intercept'
## Fits intercept(s) for 1 round(s) (round = 2).
## Intercept beta values:
## Round.2:
## [1] 23.43328
## 
## Intercept beta errors:
## Round.2:
## [1] 0.02241826
## 
## 
## 
## An object of class 'Shape'
## Fits 20 shape coefficients for 1 kinds of shape parameter(s) (shape = MGW) for a feature model of length 20.
## Shape beta values:
##                     1           2           3          4            5
## Shape.MGW -0.05406993 -0.02191307 0.009408218 -0.1164705 -0.001892145
##                     6         7        8         9         10        11
## Shape.MGW -0.09635434 0.1128344 0.145007 0.4778974 -0.3592074 -1.406691
##                 12        13         14        15       16          17
## Shape.MGW 1.740155 0.2007012 -0.0234718 0.1500717 0.208626 -0.02488117
##                    18         19          20
## Shape.MGW -0.04036182 0.05921694 -0.06481593
## 
## Shape beta errors:
##                    1           2           3           4           5
## Shape.MGW 0.00278487 0.003191742 0.002801293 0.002738043 0.002721193
##                    6          7           8           9         10
## Shape.MGW 0.00280957 0.00572684 0.008536869 0.007543474 0.02002219
##                   11         12          13         14          15
## Shape.MGW 0.03113991 0.01139374 0.003800725 0.00360467 0.002680351
##                    16          17          18          19          20
## Shape.MGW 0.002789965 0.002945868 0.003002845 0.003408552 0.002900904
## 
## [1] "Number of Observations in Design Matrix: 699130"
## [1] "i = 3"
## [1] "Round summary: "
##            2  Total
## Round 699130 699130
## [1] "Mono-nucleotide summary: "
##       N.A    N.C    N.G    N.T
## 1   56665 168214 264054 210197
## 2   85613 140651 276791 196075
## 3  119456  72238 345460 161976
## 4  131410  90636 342050 135034
## 5  290602  57507 228320 122701
## 6   98200  18111  15791 567028
## 7  170621   1167 460403  66939
## 8  673262   9849   9303   6716
## 9   39428  10834  38187 610681
## 10  41596   7195   8763 641576
## 11  47214  19167  38913 593836
## 12 679810   5664  11498   2158
## 13   8342 104866  12294 573628
## 14  92884  34560 371500 200186
## 15 281973  45874 254391 116892
## 16  85962 315752 148330 149086
## 17 111930 353447  91829 141924
## 18 204156 279990  83847 131137
## 19 165117 257587 169901 106525
## 20 183410 319872 133913  61935
## [1] "View/strand orientation summary: "
##          View.1 View.2 View.3 View.4 View.5 View.6 View.7 StrandTotal
## Strand.F  43408  75667  69603  58566  57406  57455  66904      429009
## Strand.R  33654  46795  45783  32501  33568  35637  42183      270121
## [1] "Regression Formula: "
## [1] "ObservedCount ~ offset(logProb)+N.A1+N.C1+N.T1+N.A2+N.C2+N.T2+N.A3+N.C3+N.T3+N.A4+N.C4+N.T4+N.C5+N.G5+N.T5+N.A6+N.C6+N.G6+N.A7+N.C7+N.T7+N.C8+N.G8+N.T8+N.A9+N.C9+N.G9+N.A10+N.C10+N.G10+N.A11+N.C11+N.G11+N.C12+N.G12+N.T12+N.A13+N.C13+N.G13+N.A14+N.C14+N.T14+N.C15+N.G15+N.T15+N.A16+N.G16+N.T16+N.A17+N.G17+N.T17+N.A18+N.G18+N.T18+N.A19+N.G19+N.T19+N.A20+N.G20+N.T20+Shape.MGW1+Shape.MGW2+Shape.MGW3+Shape.MGW4+Shape.MGW5+Shape.MGW6+Shape.MGW7+Shape.MGW8+Shape.MGW9+Shape.MGW10+Shape.MGW11+Shape.MGW12+Shape.MGW13+Shape.MGW14+Shape.MGW15+Shape.MGW16+Shape.MGW17+Shape.MGW18+Shape.MGW19+Shape.MGW20"
## An object of class 'model'
## 
## Slot "name":  HM-Exd-Ubx4a R2 Nucleotide+Shape Model 
## Slot "varRegLen":  16 
## Slot "leftFixedSeq":  GTTCAGAGTTCTACAGTCCGACGATCTGG 
## Slot "rightFixedSeq":  CCAGCTGTCGTATGCCGTCTTCTGCTTG 
## Slot "leftFixedSeqOverlap":  5 
## Slot "rightFixedSeqOverlap":  5 
## Slot "confidenceLevel":  0.95 
## Slot "minAffinity":  0 
## Slot "missingValueSuppression":  1 
## Slot "minSeedValue":  0.001 
## Slot "seedLen":  12 
## Slot "consensusSeq":  [ACGT]TGA[CT][ACGT][ACGT]A[CT][ACGT][ACGT][ACGT] 
## Slot "upFootprintExtend":  4 
## Slot "downFootprintExtend":  4 
## Slot "fpLen":  20 
## 
## Fits a model of footprint length 20 for mono-nucleotide and shape features (shape = MGW)  with 7 view(s) per strand of DNA and 1 round(s) of data (round = 2) without reverse complement symmetry.
## 
## Slot "regressionFormula":  ObservedCount ~ offset(logProb)+Round.2+N.A1+N.C1+N.G1+N.T1+N.A2+N.C2+N.G2+N.T2+N.A3+N.C3+N.G3+N.T3+N.A4+N.C4+N.G4+N.T4+N.A5+N.C5+N.G5+N.T5+N.A6+N.C6+N.G6+N.T6+N.A7+N.C7+N.G7+N.T7+N.A8+N.C8+N.G8+N.T8+N.A9+N.C9+N.G9+N.T9+N.A10+N.C10+N.G10+N.T10+N.A11+N.C11+N.G11+N.T11+N.A12+N.C12+N.G12+N.T12+N.A13+N.C13+N.G13+N.T13+N.A14+N.C14+N.G14+N.T14+N.A15+N.C15+N.G15+N.T15+N.A16+N.C16+N.G16+N.T16+N.A17+N.C17+N.G17+N.T17+N.A18+N.C18+N.G18+N.T18+N.A19+N.C19+N.G19+N.T19+N.A20+N.C20+N.G20+N.T20+Shape.MGW1+Shape.MGW2+Shape.MGW3+Shape.MGW4+Shape.MGW5+Shape.MGW6+Shape.MGW7+Shape.MGW8+Shape.MGW9+Shape.MGW10+Shape.MGW11+Shape.MGW12+Shape.MGW13+Shape.MGW14+Shape.MGW15+Shape.MGW16+Shape.MGW17+Shape.MGW18+Shape.MGW19+Shape.MGW20 
## 
## Slot "shapeParamsUsed[[1]]":  MGW 
## 
## Includes the following feature sub-classes: 
## An object of class 'N'
## Fits 20 nucleotides for a feature model of length 20.
## Nucleotide beta values:
##                1           2            3           4          5
## N.A  0.012687703  0.02260129 -0.004656464 -0.02392586  0.0000000
## N.C -0.008055089 -0.08806905 -0.144630919 -0.13988636 -0.8748547
## N.G  0.000000000  0.00000000  0.000000000  0.00000000 -0.3256181
## N.T -0.095076571 -0.04705239 -0.150461346 -0.02920608 -0.5705499
##              6          7         8         9         10         11
## N.A -0.9551653 -0.2555156  0.000000 -1.030846 -0.4778655 -0.3015363
## N.C -1.7711088 -2.8792341 -2.420839 -2.101860 -1.5732519 -0.2184761
## N.G -2.0824627  0.0000000 -2.264459 -1.174437 -1.5770758 -0.5815238
## N.T  0.0000000 -1.1363703 -2.455421  0.000000  0.0000000  0.0000000
##            12        13          14         15         16         17
## N.A  0.000000 -1.506122 -0.65274276  0.0000000 -0.4838935 -0.2967293
## N.C -2.142158 -0.429365 -0.64772353 -0.9571588  0.0000000  0.0000000
## N.G -1.995837 -1.674018  0.00000000 -0.1070622 -0.2357167 -0.3322427
## N.T -3.062612  0.000000  0.02393941 -0.4996213 -0.3060875 -0.1146964
##              18          19          20
## N.A -0.13148401 -0.03507989 -0.04555541
## N.C  0.00000000  0.00000000  0.00000000
## N.G -0.13407305 -0.11276265 -0.07174431
## N.T  0.05421768  0.12749467  0.04482250
## 
## Nucleotide beta errors:
##               1           2           3           4           5
## N.A 0.001771546 0.001549350 0.001327064 0.001216803 0.000000000
## N.C 0.001719655 0.001642013 0.001618895 0.001529093 0.002285507
## N.G 0.000000000 0.000000000 0.000000000 0.000000000 0.001295281
## N.T 0.001338833 0.001461037 0.001308017 0.001329070 0.001844515
##               6           7          8           9         10          11
## N.A 0.002979793 0.006781411 0.00000000 0.005125349 0.01082920 0.009784637
## N.C 0.008971405 0.133426486 0.02541509 0.014540500 0.03796657 0.012159251
## N.G 0.011985925 0.000000000 0.02015799 0.005203450 0.02728049 0.010253218
## N.T 0.000000000 0.006584864 0.02701274 0.000000000 0.00000000 0.000000000
##             12          13          14           15          16
## N.A 0.00000000 0.019219536 0.001729111 0.0000000000 0.001534469
## N.C 0.05431124 0.004278847 0.003130293 0.0029312876 0.000000000
## N.G 0.02179885 0.012321899 0.000000000 0.0009502936 0.001194557
## N.T 0.08401565 0.000000000 0.002228664 0.0017988642 0.001223215
##              17          18          19          20
## N.A 0.001459690 0.001471214 0.001638759 0.001310574
## N.C 0.000000000 0.000000000 0.000000000 0.000000000
## N.G 0.001528324 0.001645518 0.001696934 0.001779261
## N.T 0.001187605 0.001349333 0.001536424 0.001822586
## 
## 
## An object of class 'Intercept'
## Fits intercept(s) for 1 round(s) (round = 2).
## Intercept beta values:
## Round.2:
## [1] 23.42008
## 
## Intercept beta errors:
## Round.2:
## [1] 0.02269594
## 
## 
## 
## An object of class 'Shape'
## Fits 20 shape coefficients for 1 kinds of shape parameter(s) (shape = MGW) for a feature model of length 20.
## Shape beta values:
##                     1           2           3          4            5
## Shape.MGW -0.05511533 -0.01993296 0.008875318 -0.1162269 -0.002697394
##                     6         7         8         9         10       11
## Shape.MGW -0.09556691 0.1172337 0.1463935 0.4806218 -0.3558159 -1.42573
##                 12        13         14        15        16         17
## Shape.MGW 1.752843 0.2006908 -0.0232093 0.1456909 0.2055637 -0.0211876
##                    18         19          20
## Shape.MGW -0.04238618 0.05896871 -0.06430968
## 
## Shape beta errors:
##                     1           2           3           4           5
## Shape.MGW 0.002806957 0.003223197 0.002829792 0.002763356 0.002743727
##                     6           7           8           9         10
## Shape.MGW 0.002845153 0.005787962 0.008568842 0.007582752 0.02020919
##                   11         12          13          14          15
## Shape.MGW 0.03140508 0.01155582 0.003862309 0.003633595 0.002707491
##                    16          17          18          19          20
## Shape.MGW 0.002814435 0.002965056 0.003016957 0.003421953 0.002914562
## 
## [1] "Number of Observations in Design Matrix: 697770"
## [1] "i = 4"
## [1] "Round summary: "
##            2  Total
## Round 697770 697770
## [1] "Mono-nucleotide summary: "
##       N.A    N.C    N.G    N.T
## 1   56489 168024 263322 209935
## 2   85372 140382 276231 195785
## 3  119140  71998 345142 161490
## 4  131089  90371 341743 134567
## 5  289763  57468 227959 122580
## 6   98118  18086  15757 565809
## 7  170385   1167 459354  66864
## 8  672113   9789   9235   6633
## 9   39369  10804  38101 609496
## 10  41488   7163   8711 640408
## 11  47008  19149  38849 592764
## 12 678559   5651  11422   2138
## 13   8316 104718  12247 572489
## 14  92642  34466 370974 199688
## 15 281534  45731 253910 116595
## 16  85716 315139 148105 148810
## 17 111776 352660  91685 141649
## 18 203751 279283  83759 130977
## 19 164767 256999 169552 106452
## 20 182955 319325 133610  61880
## [1] "View/strand orientation summary: "
##          View.1 View.2 View.3 View.4 View.5 View.6 View.7 StrandTotal
## Strand.F  43370  75612  69551  58409  57202  57289  66710      428143
## Strand.R  33632  46769  45760  32413  33467  35527  42059      269627
## [1] "Regression Formula: "
## [1] "ObservedCount ~ offset(logProb)+N.A1+N.C1+N.T1+N.A2+N.C2+N.T2+N.A3+N.C3+N.T3+N.A4+N.C4+N.T4+N.C5+N.G5+N.T5+N.A6+N.C6+N.G6+N.A7+N.C7+N.T7+N.C8+N.G8+N.T8+N.A9+N.C9+N.G9+N.A10+N.C10+N.G10+N.A11+N.C11+N.G11+N.C12+N.G12+N.T12+N.A13+N.C13+N.G13+N.A14+N.C14+N.T14+N.C15+N.G15+N.T15+N.A16+N.G16+N.T16+N.A17+N.G17+N.T17+N.A18+N.G18+N.T18+N.A19+N.G19+N.T19+N.A20+N.G20+N.T20+Shape.MGW1+Shape.MGW2+Shape.MGW3+Shape.MGW4+Shape.MGW5+Shape.MGW6+Shape.MGW7+Shape.MGW8+Shape.MGW9+Shape.MGW10+Shape.MGW11+Shape.MGW12+Shape.MGW13+Shape.MGW14+Shape.MGW15+Shape.MGW16+Shape.MGW17+Shape.MGW18+Shape.MGW19+Shape.MGW20"
## An object of class 'model'
## 
## Slot "name":  HM-Exd-Ubx4a R2 Nucleotide+Shape Model 
## Slot "varRegLen":  16 
## Slot "leftFixedSeq":  GTTCAGAGTTCTACAGTCCGACGATCTGG 
## Slot "rightFixedSeq":  CCAGCTGTCGTATGCCGTCTTCTGCTTG 
## Slot "leftFixedSeqOverlap":  5 
## Slot "rightFixedSeqOverlap":  5 
## Slot "confidenceLevel":  0.95 
## Slot "minAffinity":  0 
## Slot "missingValueSuppression":  1 
## Slot "minSeedValue":  0.001 
## Slot "seedLen":  12 
## Slot "consensusSeq":  [ACGT]TGA[CT][ACGT][ACGT]A[CT][ACGT][ACGT][ACGT] 
## Slot "upFootprintExtend":  4 
## Slot "downFootprintExtend":  4 
## Slot "fpLen":  20 
## 
## Fits a model of footprint length 20 for mono-nucleotide and shape features (shape = MGW)  with 7 view(s) per strand of DNA and 1 round(s) of data (round = 2) without reverse complement symmetry.
## 
## Slot "regressionFormula":  ObservedCount ~ offset(logProb)+Round.2+N.A1+N.C1+N.G1+N.T1+N.A2+N.C2+N.G2+N.T2+N.A3+N.C3+N.G3+N.T3+N.A4+N.C4+N.G4+N.T4+N.A5+N.C5+N.G5+N.T5+N.A6+N.C6+N.G6+N.T6+N.A7+N.C7+N.G7+N.T7+N.A8+N.C8+N.G8+N.T8+N.A9+N.C9+N.G9+N.T9+N.A10+N.C10+N.G10+N.T10+N.A11+N.C11+N.G11+N.T11+N.A12+N.C12+N.G12+N.T12+N.A13+N.C13+N.G13+N.T13+N.A14+N.C14+N.G14+N.T14+N.A15+N.C15+N.G15+N.T15+N.A16+N.C16+N.G16+N.T16+N.A17+N.C17+N.G17+N.T17+N.A18+N.C18+N.G18+N.T18+N.A19+N.C19+N.G19+N.T19+N.A20+N.C20+N.G20+N.T20+Shape.MGW1+Shape.MGW2+Shape.MGW3+Shape.MGW4+Shape.MGW5+Shape.MGW6+Shape.MGW7+Shape.MGW8+Shape.MGW9+Shape.MGW10+Shape.MGW11+Shape.MGW12+Shape.MGW13+Shape.MGW14+Shape.MGW15+Shape.MGW16+Shape.MGW17+Shape.MGW18+Shape.MGW19+Shape.MGW20 
## 
## Slot "shapeParamsUsed[[1]]":  MGW 
## 
## Includes the following feature sub-classes: 
## An object of class 'N'
## Fits 20 nucleotides for a feature model of length 20.
## Nucleotide beta values:
##                1           2            3           4          5
## N.A  0.012776502  0.02264659 -0.004647323 -0.02385512  0.0000000
## N.C -0.008030879 -0.08806749 -0.144561974 -0.13989597 -0.8747420
## N.G  0.000000000  0.00000000  0.000000000  0.00000000 -0.3255616
## N.T -0.095061345 -0.04707393 -0.150384721 -0.02928513 -0.5704149
##              6         7         8         9        10         11
## N.A -0.9549841 -0.255143  0.000000 -1.030202 -0.478055 -0.3012370
## N.C -1.7711888 -2.879014 -2.419229 -2.101402 -1.572153 -0.2170151
## N.G -2.0812580  0.000000 -2.264085 -1.174293 -1.583068 -0.5813464
## N.T  0.0000000 -1.136136 -2.451443  0.000000  0.000000  0.0000000
##            12         13          14         15         16         17
## N.A  0.000000 -1.5051969 -0.65271632  0.0000000 -0.4839734 -0.2966605
## N.C -2.140323 -0.4290305 -0.64725282 -0.9572071  0.0000000  0.0000000
## N.G -1.994335 -1.6741505  0.00000000 -0.1072729 -0.2357775 -0.3320890
## N.T -3.061542  0.0000000  0.02438108 -0.4994464 -0.3060860 -0.1146854
##              18          19          20
## N.A -0.13152955 -0.03504545 -0.04560906
## N.C  0.00000000  0.00000000  0.00000000
## N.G -0.13414399 -0.11279821 -0.07174297
## N.T  0.05413316  0.12749785  0.04471630
## 
## Nucleotide beta errors:
##               1           2           3           4           5
## N.A 0.001772879 0.001550539 0.001327644 0.001217217 0.000000000
## N.C 0.001720533 0.001643416 0.001620204 0.001530397 0.002285944
## N.G 0.000000000 0.000000000 0.000000000 0.000000000 0.001295953
## N.T 0.001339601 0.001462087 0.001309844 0.001329570 0.001845319
##               6           7          8           9         10          11
## N.A 0.002980530 0.006785264 0.00000000 0.005126340 0.01083996 0.009792744
## N.C 0.008972891 0.133426583 0.02541682 0.014552561 0.03796720 0.012162726
## N.G 0.011986089 0.000000000 0.02020690 0.005206358 0.02746254 0.010259124
## N.T 0.000000000 0.006587119 0.02708114 0.000000000 0.00000000 0.000000000
##             12          13          14           15          16
## N.A 0.00000000 0.019235062 0.001731078 0.0000000000 0.001535690
## N.C 0.05431678 0.004282054 0.003133956 0.0029366980 0.000000000
## N.G 0.02186391 0.012340437 0.000000000 0.0009508814 0.001195069
## N.T 0.08404050 0.000000000 0.002230417 0.0018006997 0.001223803
##              17          18          19          20
## N.A 0.001460306 0.001471552 0.001639206 0.001311320
## N.C 0.000000000 0.000000000 0.000000000 0.000000000
## N.G 0.001528968 0.001646111 0.001697561 0.001779824
## N.T 0.001188196 0.001349736 0.001536756 0.001823026
## 
## 
## An object of class 'Intercept'
## Fits intercept(s) for 1 round(s) (round = 2).
## Intercept beta values:
## Round.2:
## [1] 23.41884
## 
## Intercept beta errors:
## Round.2:
## [1] 0.02271335
## 
## 
## 
## An object of class 'Shape'
## Fits 20 shape coefficients for 1 kinds of shape parameter(s) (shape = MGW) for a feature model of length 20.
## Shape beta values:
##                     1           2           3          4            5
## Shape.MGW -0.05506762 -0.01968537 0.008683173 -0.1161283 -0.002834394
##                     6        7         8         9         10        11
## Shape.MGW -0.09522785 0.117143 0.1464175 0.4811505 -0.3558083 -1.426013
##                 12       13          14       15       16         17
## Shape.MGW 1.753254 0.201283 -0.02304012 0.145302 0.205417 -0.0210041
##                    18         19          20
## Shape.MGW -0.04252736 0.05893101 -0.06433716
## 
## Shape beta errors:
##                     1           2           3           4           5
## Shape.MGW 0.002808571 0.003225623 0.002832017 0.002765359 0.002745584
##                     6           7           8           9         10
## Shape.MGW 0.002848689 0.005793769 0.008572253 0.007587244 0.02021872
##                   11         12         13         14          15
## Shape.MGW 0.03143309 0.01156429 0.00386651 0.00363618 0.002709255
##                    16         17          18          19          20
## Shape.MGW 0.002816233 0.00296657 0.003018063 0.003423154 0.002915597
## 
## [1] "Number of Observations in Design Matrix: 697592"
## [1] "i = 5"
## [1] "Round summary: "
##            2  Total
## Round 697592 697592
## [1] "Mono-nucleotide summary: "
##       N.A    N.C    N.G    N.T
## 1   56470 168002 263225 209895
## 2   85343 140343 276153 195753
## 3  119097  71972 345101 161422
## 4  131046  90337 341690 134519
## 5  289655  57461 227910 122566
## 6   98105  18083  15754 565650
## 7  170360   1167 459208  66857
## 8  671946   9787   9226   6633
## 9   39356  10801  38081 609354
## 10  41473   7162   8682 640275
## 11  46983  19146  38837 592626
## 12 678388   5651  11419   2134
## 13   8311 104698  12243 572340
## 14  92600  34448 370909 199635
## 15 281480  45713 253840 116559
## 16  85678 315069 148083 148762
## 17 111749 352571  91661 141611
## 18 203704 279191  83746 130951
## 19 164715 256918 169515 106444
## 20 182901 319254 133569  61868
## [1] "View/strand orientation summary: "
##          View.1 View.2 View.3 View.4 View.5 View.6 View.7 StrandTotal
## Strand.F  43358  75606  69543  58379  57180  57269  66692      428027
## Strand.R  33628  46762  45756  32407  33452  35511  42049      269565
## [1] "Regression Formula: "
## [1] "ObservedCount ~ offset(logProb)+N.A1+N.C1+N.T1+N.A2+N.C2+N.T2+N.A3+N.C3+N.T3+N.A4+N.C4+N.T4+N.C5+N.G5+N.T5+N.A6+N.C6+N.G6+N.A7+N.C7+N.T7+N.C8+N.G8+N.T8+N.A9+N.C9+N.G9+N.A10+N.C10+N.G10+N.A11+N.C11+N.G11+N.C12+N.G12+N.T12+N.A13+N.C13+N.G13+N.A14+N.C14+N.T14+N.C15+N.G15+N.T15+N.A16+N.G16+N.T16+N.A17+N.G17+N.T17+N.A18+N.G18+N.T18+N.A19+N.G19+N.T19+N.A20+N.G20+N.T20+Shape.MGW1+Shape.MGW2+Shape.MGW3+Shape.MGW4+Shape.MGW5+Shape.MGW6+Shape.MGW7+Shape.MGW8+Shape.MGW9+Shape.MGW10+Shape.MGW11+Shape.MGW12+Shape.MGW13+Shape.MGW14+Shape.MGW15+Shape.MGW16+Shape.MGW17+Shape.MGW18+Shape.MGW19+Shape.MGW20"
## An object of class 'model'
## 
## Slot "name":  HM-Exd-Ubx4a R2 Nucleotide+Shape Model 
## Slot "varRegLen":  16 
## Slot "leftFixedSeq":  GTTCAGAGTTCTACAGTCCGACGATCTGG 
## Slot "rightFixedSeq":  CCAGCTGTCGTATGCCGTCTTCTGCTTG 
## Slot "leftFixedSeqOverlap":  5 
## Slot "rightFixedSeqOverlap":  5 
## Slot "confidenceLevel":  0.95 
## Slot "minAffinity":  0 
## Slot "missingValueSuppression":  1 
## Slot "minSeedValue":  0.001 
## Slot "seedLen":  12 
## Slot "consensusSeq":  [ACGT]TGA[CT][ACGT][ACGT]A[CT][ACGT][ACGT][ACGT] 
## Slot "upFootprintExtend":  4 
## Slot "downFootprintExtend":  4 
## Slot "fpLen":  20 
## 
## Fits a model of footprint length 20 for mono-nucleotide and shape features (shape = MGW)  with 7 view(s) per strand of DNA and 1 round(s) of data (round = 2) without reverse complement symmetry.
## 
## Slot "regressionFormula":  ObservedCount ~ offset(logProb)+Round.2+N.A1+N.C1+N.G1+N.T1+N.A2+N.C2+N.G2+N.T2+N.A3+N.C3+N.G3+N.T3+N.A4+N.C4+N.G4+N.T4+N.A5+N.C5+N.G5+N.T5+N.A6+N.C6+N.G6+N.T6+N.A7+N.C7+N.G7+N.T7+N.A8+N.C8+N.G8+N.T8+N.A9+N.C9+N.G9+N.T9+N.A10+N.C10+N.G10+N.T10+N.A11+N.C11+N.G11+N.T11+N.A12+N.C12+N.G12+N.T12+N.A13+N.C13+N.G13+N.T13+N.A14+N.C14+N.G14+N.T14+N.A15+N.C15+N.G15+N.T15+N.A16+N.C16+N.G16+N.T16+N.A17+N.C17+N.G17+N.T17+N.A18+N.C18+N.G18+N.T18+N.A19+N.C19+N.G19+N.T19+N.A20+N.C20+N.G20+N.T20+Shape.MGW1+Shape.MGW2+Shape.MGW3+Shape.MGW4+Shape.MGW5+Shape.MGW6+Shape.MGW7+Shape.MGW8+Shape.MGW9+Shape.MGW10+Shape.MGW11+Shape.MGW12+Shape.MGW13+Shape.MGW14+Shape.MGW15+Shape.MGW16+Shape.MGW17+Shape.MGW18+Shape.MGW19+Shape.MGW20 
## 
## Slot "shapeParamsUsed[[1]]":  MGW 
## 
## Includes the following feature sub-classes: 
## An object of class 'N'
## Fits 20 nucleotides for a feature model of length 20.
## Nucleotide beta values:
##                1           2            3           4          5
## N.A  0.012744252  0.02264977 -0.004687214 -0.02386194  0.0000000
## N.C -0.008049514 -0.08811801 -0.144558287 -0.13998282 -0.8747553
## N.G  0.000000000  0.00000000  0.000000000  0.00000000 -0.3255398
## N.T -0.095100729 -0.04712163 -0.150359848 -0.02927223 -0.5704330
##              6          7         8         9         10         11
## N.A -0.9549791 -0.2552831  0.000000 -1.030283 -0.4779833 -0.3010150
## N.C -1.7711825 -2.8790840 -2.419320 -2.101381 -1.5721796 -0.2166494
## N.G -2.0812650  0.0000000 -2.263474 -1.174332 -1.5818781 -0.5812482
## N.T  0.0000000 -1.1361968 -2.451529  0.000000  0.0000000  0.0000000
##            12         13          14         15         16         17
## N.A  0.000000 -1.5055604 -0.65278057  0.0000000 -0.4840297 -0.2966354
## N.C -2.140170 -0.4289966 -0.64711529 -0.9571888  0.0000000  0.0000000
## N.G -1.994141 -1.6741526  0.00000000 -0.1073306 -0.2358088 -0.3320629
## N.T -3.060795  0.0000000  0.02443892 -0.4993938 -0.3060675 -0.1146569
##              18          19          20
## N.A -0.13153263 -0.03503336 -0.04565277
## N.C  0.00000000  0.00000000  0.00000000
## N.G -0.13414479 -0.11277085 -0.07176264
## N.T  0.05416546  0.12748960  0.04472283
## 
## Nucleotide beta errors:
##               1           2           3           4           5
## N.A 0.001773103 0.001550715 0.001327758 0.001217286 0.000000000
## N.C 0.001720638 0.001643609 0.001620323 0.001530617 0.002286043
## N.G 0.000000000 0.000000000 0.000000000 0.000000000 0.001296043
## N.T 0.001339694 0.001462189 0.001309998 0.001329608 0.001845423
##               6           7          8           9         10          11
## N.A 0.002980572 0.006785444 0.00000000 0.005126806 0.01083991 0.009793094
## N.C 0.008972890 0.133426480 0.02541694 0.014552585 0.03796722 0.012162462
## N.G 0.011986095 0.000000000 0.02020700 0.005206871 0.02746282 0.010259370
## N.T 0.000000000 0.006587184 0.02708122 0.000000000 0.00000000 0.000000000
##             12          13          14           15          16
## N.A 0.00000000 0.019241316 0.001731480 0.0000000000 0.001535832
## N.C 0.05431659 0.004282021 0.003134800 0.0029370363 0.000000000
## N.G 0.02186398 0.012340406 0.000000000 0.0009509743 0.001195134
## N.T 0.08404012 0.000000000 0.002230575 0.0018009052 0.001223867
##              17          18          19          20
## N.A 0.001460375 0.001471590 0.001639244 0.001311411
## N.C 0.000000000 0.000000000 0.000000000 0.000000000
## N.G 0.001528997 0.001646145 0.001697670 0.001779887
## N.T 0.001188290 0.001349777 0.001536782 0.001823055
## 
## 
## An object of class 'Intercept'
## Fits intercept(s) for 1 round(s) (round = 2).
## Intercept beta values:
## Round.2:
## [1] 23.41875
## 
## Intercept beta errors:
## Round.2:
## [1] 0.022714
## 
## 
## 
## An object of class 'Shape'
## Fits 20 shape coefficients for 1 kinds of shape parameter(s) (shape = MGW) for a feature model of length 20.
## Shape beta values:
##                     1           2           3          4            5
## Shape.MGW -0.05501172 -0.01972374 0.008743479 -0.1161907 -0.002832508
##                     6         7         8         9         10       11
## Shape.MGW -0.09519958 0.1172086 0.1463444 0.4810134 -0.3557753 -1.42591
##                 12        13         14       15        16          17
## Shape.MGW 1.753295 0.2013939 -0.0230635 0.145377 0.2052127 -0.02095977
##                    18         19          20
## Shape.MGW -0.04252325 0.05899002 -0.06434919
## 
## Shape beta errors:
##                     1           2           3           4           5
## Shape.MGW 0.002808812 0.003226165 0.002832343 0.002765659 0.002745839
##                     6           7          8           9         10
## Shape.MGW 0.002849048 0.005794301 0.00857221 0.007587422 0.02021945
##                   11         12          13          14          15
## Shape.MGW 0.03143324 0.01156496 0.003867042 0.003636432 0.002709631
##                    16          17          18          19          20
## Shape.MGW 0.002816774 0.002966755 0.003018221 0.003423318 0.002915755
## 
## [1] "Number of Observations in Design Matrix: 697588"
## [1] "i = 6"
## [1] "Round summary: "
##            2  Total
## Round 697588 697588
## [1] "Mono-nucleotide summary: "
##       N.A    N.C    N.G    N.T
## 1   56470 168002 263221 209895
## 2   85343 140342 276152 195751
## 3  119095  71971 345101 161421
## 4  131044  90337 341689 134518
## 5  289653  57460 227910 122565
## 6   98105  18083  15753 565647
## 7  170360   1167 459204  66857
## 8  671942   9787   9226   6633
## 9   39355  10801  38080 609352
## 10  41472   7162   8682 640272
## 11  46983  19146  38836 592623
## 12 678384   5651  11419   2134
## 13   8311 104697  12243 572337
## 14  92599  34447 370909 199633
## 15 281478  45713 253839 116558
## 16  85677 315068 148082 148761
## 17 111748 352569  91661 141610
## 18 203704 279187  83746 130951
## 19 164713 256916 169515 106444
## 20 182899 319254 133567  61868
## [1] "View/strand orientation summary: "
##          View.1 View.2 View.3 View.4 View.5 View.6 View.7 StrandTotal
## Strand.F  43358  75606  69543  58379  57178  57268  66692      428024
## Strand.R  33628  46762  45756  32407  33452  35510  42049      269564
## [1] "Regression Formula: "
## [1] "ObservedCount ~ offset(logProb)+N.A1+N.C1+N.T1+N.A2+N.C2+N.T2+N.A3+N.C3+N.T3+N.A4+N.C4+N.T4+N.C5+N.G5+N.T5+N.A6+N.C6+N.G6+N.A7+N.C7+N.T7+N.C8+N.G8+N.T8+N.A9+N.C9+N.G9+N.A10+N.C10+N.G10+N.A11+N.C11+N.G11+N.C12+N.G12+N.T12+N.A13+N.C13+N.G13+N.A14+N.C14+N.T14+N.C15+N.G15+N.T15+N.A16+N.G16+N.T16+N.A17+N.G17+N.T17+N.A18+N.G18+N.T18+N.A19+N.G19+N.T19+N.A20+N.G20+N.T20+Shape.MGW1+Shape.MGW2+Shape.MGW3+Shape.MGW4+Shape.MGW5+Shape.MGW6+Shape.MGW7+Shape.MGW8+Shape.MGW9+Shape.MGW10+Shape.MGW11+Shape.MGW12+Shape.MGW13+Shape.MGW14+Shape.MGW15+Shape.MGW16+Shape.MGW17+Shape.MGW18+Shape.MGW19+Shape.MGW20"
## An object of class 'model'
## 
## Slot "name":  HM-Exd-Ubx4a R2 Nucleotide+Shape Model 
## Slot "varRegLen":  16 
## Slot "leftFixedSeq":  GTTCAGAGTTCTACAGTCCGACGATCTGG 
## Slot "rightFixedSeq":  CCAGCTGTCGTATGCCGTCTTCTGCTTG 
## Slot "leftFixedSeqOverlap":  5 
## Slot "rightFixedSeqOverlap":  5 
## Slot "confidenceLevel":  0.95 
## Slot "minAffinity":  0 
## Slot "missingValueSuppression":  1 
## Slot "minSeedValue":  0.001 
## Slot "seedLen":  12 
## Slot "consensusSeq":  [ACGT]TGA[CT][ACGT][ACGT]A[CT][ACGT][ACGT][ACGT] 
## Slot "upFootprintExtend":  4 
## Slot "downFootprintExtend":  4 
## Slot "fpLen":  20 
## 
## Fits a model of footprint length 20 for mono-nucleotide and shape features (shape = MGW)  with 7 view(s) per strand of DNA and 1 round(s) of data (round = 2) without reverse complement symmetry.
## 
## Slot "regressionFormula":  ObservedCount ~ offset(logProb)+Round.2+N.A1+N.C1+N.G1+N.T1+N.A2+N.C2+N.G2+N.T2+N.A3+N.C3+N.G3+N.T3+N.A4+N.C4+N.G4+N.T4+N.A5+N.C5+N.G5+N.T5+N.A6+N.C6+N.G6+N.T6+N.A7+N.C7+N.G7+N.T7+N.A8+N.C8+N.G8+N.T8+N.A9+N.C9+N.G9+N.T9+N.A10+N.C10+N.G10+N.T10+N.A11+N.C11+N.G11+N.T11+N.A12+N.C12+N.G12+N.T12+N.A13+N.C13+N.G13+N.T13+N.A14+N.C14+N.G14+N.T14+N.A15+N.C15+N.G15+N.T15+N.A16+N.C16+N.G16+N.T16+N.A17+N.C17+N.G17+N.T17+N.A18+N.C18+N.G18+N.T18+N.A19+N.C19+N.G19+N.T19+N.A20+N.C20+N.G20+N.T20+Shape.MGW1+Shape.MGW2+Shape.MGW3+Shape.MGW4+Shape.MGW5+Shape.MGW6+Shape.MGW7+Shape.MGW8+Shape.MGW9+Shape.MGW10+Shape.MGW11+Shape.MGW12+Shape.MGW13+Shape.MGW14+Shape.MGW15+Shape.MGW16+Shape.MGW17+Shape.MGW18+Shape.MGW19+Shape.MGW20 
## 
## Slot "shapeParamsUsed[[1]]":  MGW 
## 
## Includes the following feature sub-classes: 
## An object of class 'N'
## Fits 20 nucleotides for a feature model of length 20.
## Nucleotide beta values:
##                1           2            3           4          5         6
## N.A  0.012749371  0.02265232 -0.004690446 -0.02386412  0.0000000 -0.954981
## N.C -0.008045092 -0.08811580 -0.144557317 -0.13998251 -0.8747618 -1.771183
## N.G  0.000000000  0.00000000  0.000000000  0.00000000 -0.3255396 -2.081266
## N.T -0.095097533 -0.04712206 -0.150360767 -0.02927159 -0.5704319  0.000000
##              7         8         9         10         11        12
## N.A -0.2552734  0.000000 -1.030320 -0.4779673 -0.3010071  0.000000
## N.C -2.8790823 -2.419330 -2.101380 -1.5721828 -0.2166363 -2.140170
## N.G  0.0000000 -2.263476 -1.174324 -1.5818709 -0.5812401 -1.994155
## N.T -1.1361888 -2.451536  0.000000  0.0000000  0.0000000 -3.060783
##             13          14         15         16         17          18
## N.A -1.5055499 -0.65277823  0.0000000 -0.4840297 -0.2966344 -0.13153316
## N.C -0.4289946 -0.64712599 -0.9571887  0.0000000  0.0000000  0.00000000
## N.G -1.6741458  0.00000000 -0.1073322 -0.2358106 -0.3320626 -0.13414525
## N.T  0.0000000  0.02443775 -0.4993964 -0.3060694 -0.1146565  0.05416547
##              19          20
## N.A -0.03503763 -0.04565314
## N.C  0.00000000  0.00000000
## N.G -0.11277470 -0.07176628
## N.T  0.12748637  0.04472113
## 
## Nucleotide beta errors:
##               1           2           3           4           5
## N.A 0.001773108 0.001550718 0.001327762 0.001217289 0.000000000
## N.C 0.001720641 0.001643620 0.001620334 0.001530617 0.002286060
## N.G 0.000000000 0.000000000 0.000000000 0.000000000 0.001296044
## N.T 0.001339697 0.001462193 0.001309999 0.001329610 0.001845431
##               6           7          8           9         10          11
## N.A 0.002980572 0.006785453 0.00000000 0.005127084 0.01083988 0.009793102
## N.C 0.008972890 0.133426466 0.02541695 0.014552584 0.03796723 0.012162462
## N.G 0.011986095 0.000000000 0.02020700 0.005206883 0.02746280 0.010259377
## N.T 0.000000000 0.006587194 0.02708123 0.000000000 0.00000000 0.000000000
##             12          13          14           15          16
## N.A 0.00000000 0.019241294 0.001731498 0.0000000000 0.001535832
## N.C 0.05431656 0.004282012 0.003134826 0.0029370362 0.000000000
## N.G 0.02186398 0.012340396 0.000000000 0.0009509777 0.001195135
## N.T 0.08404003 0.000000000 0.002230575 0.0018009071 0.001223869
##              17          18          19          20
## N.A 0.001460380 0.001471591 0.001639246 0.001311411
## N.C 0.000000000 0.000000000 0.000000000 0.000000000
## N.G 0.001528998 0.001646146 0.001697672 0.001779890
## N.T 0.001188291 0.001349777 0.001536783 0.001823055
## 
## 
## An object of class 'Intercept'
## Fits intercept(s) for 1 round(s) (round = 2).
## Intercept beta values:
## Round.2:
## [1] 23.41874
## 
## Intercept beta errors:
## Round.2:
## [1] 0.02271399
## 
## 
## 
## An object of class 'Shape'
## Fits 20 shape coefficients for 1 kinds of shape parameter(s) (shape = MGW) for a feature model of length 20.
## Shape beta values:
##                     1           2           3          4            5
## Shape.MGW -0.05501243 -0.01972045 0.008743257 -0.1161918 -0.002832891
##                     6         7         8         9         10        11
## Shape.MGW -0.09519731 0.1172034 0.1463412 0.4810231 -0.3558136 -1.425888
##                 12        13          14        15        16        17
## Shape.MGW 1.753294 0.2013958 -0.02306705 0.1453743 0.2052172 -0.020963
##                    18         19          20
## Shape.MGW -0.04252105 0.05898847 -0.06434858
## 
## Shape beta errors:
##                     1           2           3           4           5
## Shape.MGW 0.002808814 0.003226174 0.002832358 0.002765664 0.002745845
##                     6          7           8           9         10
## Shape.MGW 0.002849073 0.00579433 0.008572195 0.007587426 0.02021954
##                   11         12          13          14          15
## Shape.MGW 0.03143318 0.01156496 0.003867044 0.003636436 0.002709638
##                    16          17          18          19          20
## Shape.MGW 0.002816778 0.002966763 0.003018227 0.003423319 0.002915755
## 
## [1] "Number of Observations in Design Matrix: 697588"
## [1] "Stability Reached after 6 iterations."
ModelTest <- finalizeFeatureBetas(ModelTest)

pM <- plot(ModelTest, plotTitle = "HM-Ubx4a-Exd R2 Nucleotide+Shape Fit", Nplot.ddG = TRUE, verticalPlots = TRUE)
ggplot2::ggsave(pM, file = paste(selexDir, saveDir, "/modelPlot.pdf", sep = ""), height = vPheight, width = 6)

save(ModelTest, file = paste(selexDir, saveDir, "/model.RData",sep = ""))
saveRDS(ModelTest, file = paste(selexDir, saveDir, "/model.rds",sep = ""))

some text