Mononucleotide + Strand Orientation Factor 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/StrandOriNoSymmetry"
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 Nucleotides+Strand",
                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,
                includeDNAstrand = TRUE,
                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": NONE
# 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)
designMatrixSummary = getDesignMatrix(ModelTest, data)
## No shape parameters included in fit.
print("Round summary: ")
## [1] "Round summary: "
print (designMatrixSummary$Round)
##            2  Total
## Round 792570 792570
print("Mono-nucleotide summary: ")
## [1] "Mono-nucleotide summary: "
print (designMatrixSummary$N)
##       N.A    N.C    N.G    N.T
## 1   68496 184091 306568 233415
## 2   99347 162896 310750 219577
## 3  137689  86101 374681 194099
## 4  146435 108469 377287 160379
## 5  328153  63671 266543 134203
## 6  113651  24825  23612 630482
## 7  175668   2265 537231  77406
## 8  745166  14530  18441  14433
## 9   48927  17534  48212 677897
## 10  45409   9904  13835 723422
## 11  57354  14092  46827 674297
## 12 767049   6227  14740   4554
## 13  14969 102177  19814 655610
## 14 102996  45976 390490 253108
## 15 331311  51621 282674 126964
## 16  96371 362603 157893 175703
## 17 124602 405401 102589 159978
## 18 236337 321696  91955 142582
## 19 190231 291171 196766 114402
## 20 209892 359609 154772  68297
print("View/strand orientation summary: ")
## [1] "View/strand orientation summary: "
print (designMatrixSummary$Intercept)
##          View.1 View.2 View.3 View.4 View.5 View.6 View.7 StrandTotal
## Strand.F  49777  81814  74930  68106  68044  68800  81673      493144
## Strand.R  37088  49990  47561  36366  38042  41022  49357      299426
# # Constructs regression expression with independent features using design matrix
regressionFormula = updatedRegressionFormula(data, ModelTest)
print("Regression Formula: ")
## [1] "Regression Formula: "
print (regressionFormula)
## [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+Strand.R"
fit = glm(regressionFormula, 
          data=data, 
          family = poisson(link="log"))
summary(fit)
## 
## Call:
## glm(formula = regressionFormula, family = poisson(link = "log"), 
##     data = data)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -9.3688  -0.9126  -0.3280   0.1981  11.7321  
## 
## Coefficients:
##               Estimate Std. Error  z value Pr(>|z|)    
## (Intercept) 25.6279884  0.0039454 6495.732  < 2e-16 ***
## N.A1         0.0198505  0.0016946   11.714  < 2e-16 ***
## N.C1        -0.0092284  0.0015698   -5.879 4.14e-09 ***
## N.T1        -0.0932604  0.0012786  -72.942  < 2e-16 ***
## N.A2         0.0317939  0.0014585   21.800  < 2e-16 ***
## N.C2        -0.1036512  0.0015022  -69.000  < 2e-16 ***
## N.T2        -0.0625370  0.0013601  -45.978  < 2e-16 ***
## N.A3         0.0069157  0.0012222    5.659 1.53e-08 ***
## N.C3        -0.1552996  0.0015281 -101.631  < 2e-16 ***
## N.T3        -0.1589848  0.0012295 -129.312  < 2e-16 ***
## N.A4        -0.0134013  0.0011739  -11.416  < 2e-16 ***
## N.C4        -0.1851083  0.0014256 -129.843  < 2e-16 ***
## N.T4        -0.0954859  0.0011680  -81.750  < 2e-16 ***
## N.C5        -0.8490486  0.0020889 -406.457  < 2e-16 ***
## N.G5        -0.3104101  0.0010059 -308.578  < 2e-16 ***
## N.T5        -0.4934346  0.0011442 -431.252  < 2e-16 ***
## N.A6        -0.9377395  0.0017505 -535.691  < 2e-16 ***
## N.C6        -1.7613313  0.0079820 -220.662  < 2e-16 ***
## N.G6        -2.0013804  0.0107420 -186.313  < 2e-16 ***
## N.A7        -0.6581006  0.0011022 -597.054  < 2e-16 ***
## N.C7        -2.7156126  0.0780883  -34.776  < 2e-16 ***
## N.T7        -1.1948119  0.0020133 -593.449  < 2e-16 ***
## N.C8        -2.3440086  0.0216036 -108.501  < 2e-16 ***
## N.G8        -2.1955931  0.0152957 -143.544  < 2e-16 ***
## N.T8        -2.5606253  0.0204031 -125.502  < 2e-16 ***
## N.A9        -1.3785202  0.0038072 -362.085  < 2e-16 ***
## N.C9        -1.9905989  0.0133015 -149.652  < 2e-16 ***
## N.G9        -1.4094551  0.0039896 -353.287  < 2e-16 ***
## N.A10       -1.5542266  0.0044010 -353.153  < 2e-16 ***
## N.C10       -2.4035791  0.0299936  -80.136  < 2e-16 ***
## N.G10       -2.1961328  0.0216248 -101.556  < 2e-16 ***
## N.A11       -1.1624326  0.0026337 -441.376  < 2e-16 ***
## N.C11       -1.4712352  0.0099652 -147.638  < 2e-16 ***
## N.G11       -1.3906509  0.0041001 -339.177  < 2e-16 ***
## N.C12       -2.6240654  0.0472474  -55.539  < 2e-16 ***
## N.G12       -2.3541136  0.0195457 -120.441  < 2e-16 ***
## N.T12       -2.8610392  0.0524174  -54.582  < 2e-16 ***
## N.A13       -1.9874969  0.0118871 -167.198  < 2e-16 ***
## N.C13       -0.6825546  0.0016062 -424.963  < 2e-16 ***
## N.G13       -1.7683167  0.0091415 -193.438  < 2e-16 ***
## N.A14       -0.7061760  0.0015060 -468.895  < 2e-16 ***
## N.C14       -0.8805787  0.0023854 -369.146  < 2e-16 ***
## N.T14       -0.2063794  0.0008578 -240.584  < 2e-16 ***
## N.C15       -0.9896412  0.0026277 -376.625  < 2e-16 ***
## N.G15       -0.1191107  0.0008847 -134.630  < 2e-16 ***
## N.T15       -0.5762756  0.0012594 -457.574  < 2e-16 ***
## N.A16       -0.4926548  0.0014552 -338.546  < 2e-16 ***
## N.G16       -0.2278245  0.0011530 -197.597  < 2e-16 ***
## N.T16       -0.2668763  0.0010825 -246.539  < 2e-16 ***
## N.A17       -0.2207225  0.0013134 -168.054  < 2e-16 ***
## N.G17       -0.2777073  0.0014555 -190.804  < 2e-16 ***
## N.T17       -0.0880596  0.0011504  -76.549  < 2e-16 ***
## N.A18       -0.1315684  0.0013715  -95.931  < 2e-16 ***
## N.G18       -0.1180771  0.0015648  -75.457  < 2e-16 ***
## N.T18        0.0571583  0.0012773   44.750  < 2e-16 ***
## N.A19       -0.0474186  0.0015512  -30.569  < 2e-16 ***
## N.G19       -0.1270854  0.0015578  -81.582  < 2e-16 ***
## N.T19        0.1369059  0.0014838   92.267  < 2e-16 ***
## N.A20       -0.0372087  0.0012790  -29.092  < 2e-16 ***
## N.G20       -0.0743574  0.0016835  -44.169  < 2e-16 ***
## N.T20        0.0659210  0.0017374   37.942  < 2e-16 ***
## Strand.R     0.0120626  0.0009665   12.481  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for poisson family taken to be 1)
## 
##     Null deviance: 4192188  on 792569  degrees of freedom
## Residual deviance: 1140724  on 792508  degrees of freedom
## AIC: 2168207
## 
## Number of Fisher Scoring iterations: 8
ModelTest = addNewBetas(ModelTest, data, fit)
## No shape parameters included in fit.
# # Nucleotide Features after first round of fitting
summary(ModelTest)
## An object of class 'model'
## 
## Slot "name":  HM-Exd-Ubx4a Nucleotides+Strand 
## 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 features  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+Strand.F+Strand.R 
## 
## 
## 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.019850520  0.03179387  0.006915687 -0.01340125  0.0000000
## N.C -0.009228379 -0.10365125 -0.155299607 -0.18510835 -0.8490486
## N.G  0.000000000  0.00000000  0.000000000  0.00000000 -0.3104101
## N.T -0.093260408 -0.06253697 -0.158984808 -0.09548586 -0.4934346
##              6          7         8         9        10        11
## N.A -0.9377395 -0.6581006  0.000000 -1.378520 -1.554227 -1.162433
## N.C -1.7613313 -2.7156126 -2.344009 -1.990599 -2.403579 -1.471235
## N.G -2.0013804  0.0000000 -2.195593 -1.409455 -2.196133 -1.390651
## N.T  0.0000000 -1.1948119 -2.560625  0.000000  0.000000  0.000000
##            12         13         14         15         16          17
## N.A  0.000000 -1.9874969 -0.7061760  0.0000000 -0.4926548 -0.22072247
## N.C -2.624065 -0.6825546 -0.8805787 -0.9896412  0.0000000  0.00000000
## N.G -2.354114 -1.7683167  0.0000000 -0.1191107 -0.2278245 -0.27770728
## N.T -2.861039  0.0000000 -0.2063794 -0.5762756 -0.2668763 -0.08805963
##              18          19          20
## N.A -0.13156838 -0.04741856 -0.03720872
## N.C  0.00000000  0.00000000  0.00000000
## N.G -0.11807709 -0.12708539 -0.07435740
## N.T  0.05715835  0.13690588  0.06592104
## 
## Nucleotide beta errors:
##               1           2           3           4           5
## N.A 0.001694603 0.001458457 0.001222172 0.001173851 0.000000000
## N.C 0.001569801 0.001502200 0.001528069 0.001425631 0.002088902
## N.G 0.000000000 0.000000000 0.000000000 0.000000000 0.001005937
## N.T 0.001278559 0.001360145 0.001229465 0.001168028 0.001144192
##               6           7          8           9          10          11
## N.A 0.001750524 0.001102246 0.00000000 0.003807173 0.004401004 0.002633657
## N.C 0.007982047 0.078088252 0.02160364 0.013301492 0.029993591 0.009965166
## N.G 0.010742011 0.000000000 0.01529566 0.003989551 0.021624753 0.004100070
## N.T 0.000000000 0.002013335 0.02040314 0.000000000 0.000000000 0.000000000
##             12          13           14           15          16
## N.A 0.00000000 0.011887117 0.0015060431 0.0000000000 0.001455208
## N.C 0.04724739 0.001606152 0.0023854497 0.0026276589 0.000000000
## N.G 0.01954572 0.009141528 0.0000000000 0.0008847257 0.001152978
## N.T 0.05241742 0.000000000 0.0008578261 0.0012594162 0.001082491
##              17          18          19          20
## N.A 0.001313405 0.001371483 0.001551206 0.001278999
## N.C 0.000000000 0.000000000 0.000000000 0.000000000
## N.G 0.001455457 0.001564818 0.001557759 0.001683481
## N.T 0.001150367 0.001277278 0.001483796 0.001737432
## 
## 
## An object of class 'Intercept'
## Fits 2 strand orientations and 1 round(s) (round = 2).
## Intercept beta values:
## Round.2:
##            Strand
## Strand.F 25.62799
## Strand.R 25.64005
## 
## Intercept beta errors:
## Round.2:
##               Strand
## Strand.F 0.003945358
## Strand.R 0.004062008
## 
## 
## 
## An object of class 'Shape'
## Fits 0 shape coefficients for 0 kinds of shape parameter(s) (shape = ) for a feature model of length 20.
vPheight = verticalPlot_height(ModelTest)
pM <- plot(ModelTest, plotTitle = "HM-Ubx4a-Exd R2 Nucleotide+Strand 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)

some text

data = data.probeCounts[sample1, ]
#data = data.probeCounts
data.nrow = nrow(data)
data = topModelMatch(data, ModelTest)
data = addDesignMatrix(data, ModelTest)
designMatrixSummary.v2 = getDesignMatrix(ModelTest, data)
## No shape parameters included in fit.
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 (data.nrow == nrow(data)) {
    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)
  # Features after first round of fitting
  summary(ModelTest)
  pM <- plot(ModelTest, plotTitle = "HM-Ubx4a-Exd R2 Nucleotide+Strand Fit", Nplot.ddG = TRUE, verticalPlots = TRUE)
  ggplot2::ggsave(pM, file = paste(selexDir, saveDir, "/modelPlot.",i, ".pdf", sep = ""), height = vPheight, width = 6)
  ggplot2::ggsave(pM, file = paste(selexDir, saveDir, "/modelPlot.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 = ""))
  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 if (nrow(data) == 0) {
    print ("Algorithm failed to converge: No probes meet the confidence level requirement (Confidence Level:", ModelTest@confidenceLevel, ")", sep = "")
  }
}
## [1] "i = 2"
## No shape parameters included in fit.
## [1] "Round summary: "
##            2  Total
## Round 776946 776946
## [1] "Mono-nucleotide summary: "
##       N.A    N.C    N.G    N.T
## 1   65503 182546 299603 229294
## 2   97079 156397 308108 215362
## 3  134124  84088 371870 186864
## 4  146157 103325 370658 156806
## 5  326890  62639 256166 131251
## 6  106376  24539  20842 625189
## 7  173220   2488 523885  77353
## 8  732776  13707  16987  13476
## 9   41575  14373  42467 678531
## 10  39271   7934  12051 717690
## 11  50450  15989  42698 667809
## 12 750837   7593  13297   5219
## 13  12123 108688  16410 639725
## 14 103700  46908 390338 236000
## 15 318222  53529 273012 132183
## 16  96305 350604 159960 170077
## 17 122406 395773 100176 158591
## 18 228079 315357  90479 143031
## 19 186079 286868 189395 114604
## 20 204338 354306 151091  67211
## [1] "View/strand orientation summary: "
##          View.1 View.2 View.3 View.4 View.5 View.6 View.7 StrandTotal
## Strand.F  47909  81710  75017  67919  66760  67203  77670      484188
## Strand.R  35884  49417  47893  35884  36960  39785  46935      292758
## [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+Strand.R"
## No shape parameters included in fit.
## An object of class 'model'
## 
## Slot "name":  HM-Exd-Ubx4a Nucleotides+Strand 
## 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 features  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+Strand.F+Strand.R 
## 
## 
## 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.02031141  0.03209064  0.006194248 -0.01557362  0.0000000 -0.936658
## N.C -0.01000509 -0.10349595 -0.156690693 -0.18356801 -0.8470523 -1.755215
## N.G  0.00000000  0.00000000  0.000000000  0.00000000 -0.3087140 -2.010913
## N.T -0.09233750 -0.06164871 -0.159957334 -0.09460363 -0.4917945  0.000000
##             7         8         9        10        11        12         13
## N.A -0.658828  0.000000 -1.352819 -1.557620 -1.154499  0.000000 -1.9935956
## N.C -2.759300 -2.364408 -1.998139 -2.455205 -1.376539 -2.531131 -0.6795597
## N.G  0.000000 -2.213856 -1.408948 -2.228813 -1.393728 -2.357064 -1.7690115
## N.T -1.196642 -2.587143  0.000000  0.000000  0.000000 -2.866771  0.0000000
##             14         15         16          17          18          19
## N.A -0.7044907  0.0000000 -0.4907788 -0.22066347 -0.13135823 -0.04649756
## N.C -0.8816842 -0.9862189  0.0000000  0.00000000  0.00000000  0.00000000
## N.G  0.0000000 -0.1193237 -0.2273182 -0.27664867 -0.11876241 -0.12578848
## N.T -0.2052911 -0.5741436 -0.2662425 -0.08713916  0.05675272  0.13717872
##              20
## N.A -0.03680803
## N.C  0.00000000
## N.G -0.07449299
## N.T  0.06538862
## 
## Nucleotide beta errors:
##               1           2           3           4           5
## N.A 0.001698569 0.001457935 0.001222850 0.001172445 0.000000000
## N.C 0.001570928 0.001504771 0.001524327 0.001432290 0.002087110
## N.G 0.000000000 0.000000000 0.000000000 0.000000000 0.001007561
## N.T 0.001280485 0.001361189 0.001228632 0.001167543 0.001143988
##               6           7          8           9          10          11
## N.A 0.001753440 0.001095893 0.00000000 0.003964654 0.004572683 0.002701862
## N.C 0.007842662 0.076251095 0.02197551 0.013582310 0.031884383 0.008974047
## N.G 0.010913940 0.000000000 0.01558188 0.004009380 0.022688101 0.004119436
## N.T 0.000000000 0.002003861 0.02089530 0.000000000 0.000000000 0.000000000
##             12          13           14           15          16
## N.A 0.00000000 0.012047578 0.0015032186 0.0000000000 0.001451813
## N.C 0.04166795 0.001588862 0.0023595267 0.0026094426 0.000000000
## N.G 0.01962069 0.009201336 0.0000000000 0.0008858754 0.001150158
## N.T 0.05130201 0.000000000 0.0008602558 0.0012529102 0.001083918
##              17          18          19          20
## N.A 0.001312952 0.001370920 0.001551906 0.001279345
## N.C 0.000000000 0.000000000 0.000000000 0.000000000
## N.G 0.001455526 0.001565130 0.001558199 0.001684191
## N.T 0.001148843 0.001275531 0.001484349 0.001738025
## 
## 
## An object of class 'Intercept'
## Fits 2 strand orientations and 1 round(s) (round = 2).
## Intercept beta values:
## Round.2:
##            Strand
## Strand.F 25.62131
## Strand.R 25.63357
## 
## Intercept beta errors:
## Round.2:
##               Strand
## Strand.F 0.003946877
## Strand.R 0.004063368
## 
## 
## 
## An object of class 'Shape'
## Fits 0 shape coefficients for 0 kinds of shape parameter(s) (shape = ) for a feature model of length 20.
## [1] "Number of Observations in Design Matrix: 773652"
## No shape parameters included in fit.
## [1] "i = 3"
## No shape parameters included in fit.
## [1] "Round summary: "
##            2  Total
## Round 773652 773652
## [1] "Mono-nucleotide summary: "
##       N.A    N.C    N.G    N.T
## 1   65087 182036 297947 228582
## 2   96537 155761 306712 214642
## 3  133421  83519 370922 185790
## 4  145144 102638 369679 156191
## 5  324999  62413 255309 130931
## 6  106055  24426  20550 622621
## 7  172243   2391 522070  76948
## 8  730182  13491  16775  13204
## 9   40979  14086  42113 676474
## 10  39117   7725  11662 715148
## 11  50112  15948  42381 665211
## 12 747852   7582  13126   5092
## 13  11947 108174  16232 637299
## 14 103112  46550 389080 234910
## 15 316991  53144 271991 131526
## 16  95813 349085 159441 169313
## 17 122012 393900  99830 157910
## 18 227009 313799  90210 142634
## 19 185241 285530 188532 114349
## 20 203372 352879 150388  67013
## [1] "View/strand orientation summary: "
##          View.1 View.2 View.3 View.4 View.5 View.6 View.7 StrandTotal
## Strand.F  47781  81557  74861  67492  66395  66841  77196      482123
## Strand.R  35802  49310  47800  35696  36735  39516  46670      291529
## [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+Strand.R"
## No shape parameters included in fit.
## An object of class 'model'
## 
## Slot "name":  HM-Exd-Ubx4a Nucleotides+Strand 
## 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 features  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+Strand.F+Strand.R 
## 
## 
## 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.02034188  0.03223089  0.006229381 -0.01528119  0.0000000 -0.9367151
## N.C -0.01001772 -0.10335065 -0.156403618 -0.18351123 -0.8471549 -1.7552454
## N.G  0.00000000  0.00000000  0.000000000  0.00000000 -0.3087729 -2.0109812
## N.T -0.09236654 -0.06150582 -0.159888618 -0.09460922 -0.4918460  0.0000000
##              7         8         9        10        11        12
## N.A -0.6585601  0.000000 -1.351469 -1.557667 -1.154465  0.000000
## N.C -2.7712644 -2.364739 -1.997120 -2.458244 -1.375427 -2.531114
## N.G  0.0000000 -2.213332 -1.408998 -2.241810 -1.393804 -2.358995
## N.T -1.1964425 -2.588603  0.000000  0.000000  0.000000 -2.869448
##             13         14         15         16          17          18
## N.A -1.9935806 -0.7043613  0.0000000 -0.4907015 -0.22064371 -0.13120502
## N.C -0.6795559 -0.8813868 -0.9862437  0.0000000  0.00000000  0.00000000
## N.G -1.7686628  0.0000000 -0.1193702 -0.2272734 -0.27663835 -0.11868071
## N.T  0.0000000 -0.2052466 -0.5741743 -0.2661466 -0.08711893  0.05682415
##              19          20
## N.A -0.04647602 -0.03688921
## N.C  0.00000000  0.00000000
## N.G -0.12583864 -0.07448543
## N.T  0.13716315  0.06532163
## 
## Nucleotide beta errors:
##               1           2           3           4           5
## N.A 0.001699688 0.001458800 0.001223267 0.001173115 0.000000000
## N.C 0.001571560 0.001505748 0.001525454 0.001433358 0.002087354
## N.G 0.000000000 0.000000000 0.000000000 0.000000000 0.001007974
## N.T 0.001280992 0.001362032 0.001229743 0.001167937 0.001144172
##               6           7          8           9          10          11
## N.A 0.001753589 0.001097597 0.00000000 0.003999884 0.004573268 0.002703044
## N.C 0.007843629 0.078088671 0.02199675 0.013622471 0.032014762 0.008975514
## N.G 0.010921737 0.000000000 0.01559701 0.004009895 0.023120048 0.004120260
## N.T 0.000000000 0.002005085 0.02098702 0.000000000 0.000000000 0.000000000
##             12          13           14           15          16
## N.A 0.00000000 0.012068558 0.0015041146 0.0000000000 0.001452524
## N.C 0.04166788 0.001589509 0.0023611912 0.0026117648 0.000000000
## N.G 0.01966609 0.009202914 0.0000000000 0.0008862001 0.001150480
## N.T 0.05185066 0.000000000 0.0008606033 0.0012535635 0.001084332
##              17          18          19          20
## N.A 0.001313301 0.001371265 0.001552136 0.001279935
## N.C 0.000000000 0.000000000 0.000000000 0.000000000
## N.G 0.001455958 0.001565528 0.001558637 0.001684485
## N.T 0.001149187 0.001275879 0.001484528 0.001738282
## 
## 
## An object of class 'Intercept'
## Fits 2 strand orientations and 1 round(s) (round = 2).
## Intercept beta values:
## Round.2:
##            Strand
## Strand.F 25.62079
## Strand.R 25.63308
## 
## Intercept beta errors:
## Round.2:
##               Strand
## Strand.F 0.003948296
## Strand.R 0.004064843
## 
## 
## 
## An object of class 'Shape'
## Fits 0 shape coefficients for 0 kinds of shape parameter(s) (shape = ) for a feature model of length 20.
## [1] "Number of Observations in Design Matrix: 773483"
## No shape parameters included in fit.
## [1] "i = 4"
## No shape parameters included in fit.
## [1] "Round summary: "
##            2  Total
## Round 773483 773483
## [1] "Mono-nucleotide summary: "
##       N.A    N.C    N.G    N.T
## 1   65067 182015 297868 228533
## 2   96506 155734 306636 214607
## 3  133389  83496 370874 185724
## 4  145103 102597 369632 156151
## 5  324911  62403 255258 130911
## 6  106035  24422  20541 622485
## 7  172188   2366 521996  76933
## 8  730031  13487  16770  13195
## 9   40975  14082  42095 676331
## 10  39115   7717  11600 715051
## 11  50092  15940  42359 665092
## 12 747707   7581  13115   5080
## 13  11940 108142  16224 637177
## 14 103083  46537 389021 234842
## 15 316939  53122 271930 131492
## 16  95788 349007 159414 169274
## 17 121989 393804  99809 157881
## 18 226955 313728  90196 142604
## 19 185202 285461 188484 114336
## 20 203320 352795 150360  67008
## [1] "View/strand orientation summary: "
##          View.1 View.2 View.3 View.4 View.5 View.6 View.7 StrandTotal
## Strand.F  47775  81551  74850  67468  66373  66828  77172      482017
## Strand.R  35798  49303  47792  35690  36728  39504  46651      291466
## [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+Strand.R"
## No shape parameters included in fit.
## An object of class 'model'
## 
## Slot "name":  HM-Exd-Ubx4a Nucleotides+Strand 
## 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 features  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+Strand.F+Strand.R 
## 
## 
## 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.02034008  0.03224256  0.006221008 -0.01526673  0.0000000 -0.9367145
## N.C -0.01002021 -0.10334066 -0.156401691 -0.18355263 -0.8471500 -1.7552433
## N.G  0.00000000  0.00000000  0.000000000  0.00000000 -0.3087729 -2.0109437
## N.T -0.09239436 -0.06151044 -0.159903209 -0.09461453 -0.4918451  0.0000000
##              7         8         9        10        11        12        13
## N.A -0.6585834  0.000000 -1.351471 -1.557663 -1.154472  0.000000 -1.993563
## N.C -2.7781256 -2.364743 -1.997081 -2.458237 -1.374946 -2.531075 -0.679556
## N.G  0.0000000 -2.213334 -1.409000 -2.244338 -1.393838 -2.358901 -1.768650
## N.T -1.1964546 -2.588551  0.000000  0.000000  0.000000 -2.869235  0.000000
##             14         15         16          17          18          19
## N.A -0.7043731  0.0000000 -0.4907015 -0.22065576 -0.13120149 -0.04647865
## N.C -0.8813718 -0.9862412  0.0000000  0.00000000  0.00000000  0.00000000
## N.G  0.0000000 -0.1193696 -0.2272811 -0.27664723 -0.11865801 -0.12585110
## N.T -0.2052408 -0.5741708 -0.2661393 -0.08712742  0.05684507  0.13716325
##              20
## N.A -0.03691411
## N.C  0.00000000
## N.G -0.07450737
## N.T  0.06530943
## 
## Nucleotide beta errors:
##               1           2           3           4           5
## N.A 0.001699741 0.001458848 0.001223289 0.001173151 0.000000000
## N.C 0.001571585 0.001505798 0.001525568 0.001433498 0.002087362
## N.G 0.000000000 0.000000000 0.000000000 0.000000000 0.001008010
## N.T 0.001281033 0.001362098 0.001229843 0.001167966 0.001144190
##               6           7          8           9          10          11
## N.A 0.001753601 0.001097784 0.00000000 0.003999885 0.004573269 0.002703120
## N.C 0.007843630 0.079058643 0.02199675 0.013622474 0.032014762 0.008975510
## N.G 0.010921739 0.000000000 0.01559701 0.004009897 0.023194468 0.004120396
## N.T 0.000000000 0.002005129 0.02098702 0.000000000 0.000000000 0.000000000
##             12          13           14           15          16
## N.A 0.00000000 0.012068560 0.0015041840 0.0000000000 0.001452555
## N.C 0.04166787 0.001589533 0.0023611955 0.0026119268 0.000000000
## N.G 0.01966610 0.009202916 0.0000000000 0.0008862298 0.001150518
## N.T 0.05185067 0.000000000 0.0008606345 0.0012536083 0.001084365
##              17          18          19          20
## N.A 0.001313329 0.001371281 0.001552153 0.001279969
## N.C 0.000000000 0.000000000 0.000000000 0.000000000
## N.G 0.001455989 0.001565558 0.001558661 0.001684513
## N.T 0.001149216 0.001275921 0.001484541 0.001738294
## 
## 
## An object of class 'Intercept'
## Fits 2 strand orientations and 1 round(s) (round = 2).
## Intercept beta values:
## Round.2:
##            Strand
## Strand.F 25.62084
## Strand.R 25.63312
## 
## Intercept beta errors:
## Round.2:
##               Strand
## Strand.F 0.003948383
## Strand.R 0.004064934
## 
## 
## 
## An object of class 'Shape'
## Fits 0 shape coefficients for 0 kinds of shape parameter(s) (shape = ) for a feature model of length 20.
## [1] "Number of Observations in Design Matrix: 773449"
## No shape parameters included in fit.
## [1] "i = 5"
## No shape parameters included in fit.
## [1] "Round summary: "
##            2  Total
## Round 773449 773449
## [1] "Mono-nucleotide summary: "
##       N.A    N.C    N.G    N.T
## 1   65065 182009 297850 228525
## 2   96500 155730 306621 214598
## 3  133385  83492 370858 185714
## 4  145096 102591 369617 156145
## 5  324896  62400 255247 130906
## 6  106028  24421  20541 622459
## 7  172185   2356 521977  76931
## 8  729999  13486  16770  13194
## 9   40968  14079  42089 676313
## 10  39115   7716  11584 715034
## 11  50086  15939  42351 665073
## 12 747677   7579  13114   5079
## 13  11939 108136  16220 637154
## 14 103078  46532 389008 234831
## 15 316929  53119 271913 131488
## 16  95783 348993 159406 169267
## 17 121981 393789  99807 157872
## 18 226948 313711  90191 142599
## 19 185195 285445 188477 114332
## 20 203312 352777 150355  67005
## [1] "View/strand orientation summary: "
##          View.1 View.2 View.3 View.4 View.5 View.6 View.7 StrandTotal
## Strand.F  47775  81548  74848  67464  66367  66826  77167      481995
## Strand.R  35794  49301  47789  35689  36728  39503  46650      291454
## [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+Strand.R"
## No shape parameters included in fit.
## An object of class 'model'
## 
## Slot "name":  HM-Exd-Ubx4a Nucleotides+Strand 
## 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 features  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+Strand.F+Strand.R 
## 
## 
## 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.02034073  0.03223747  0.006223869 -0.01526806  0.0000000 -0.9367151
## N.C -0.01001519 -0.10334848 -0.156401946 -0.18354456 -0.8471514 -1.7552442
## N.G  0.00000000  0.00000000  0.000000000  0.00000000 -0.3087749 -2.0109447
## N.T -0.09239140 -0.06151582 -0.159893614 -0.09461651 -0.4918483  0.0000000
##              7         8         9        10        11        12
## N.A -0.6585836  0.000000 -1.351431 -1.557664 -1.154471  0.000000
## N.C -2.8006901 -2.364743 -1.996942 -2.458237 -1.374946 -2.531075
## N.G  0.0000000 -2.213336 -1.409029 -2.244315 -1.393872 -2.358901
## N.T -1.1964359 -2.588552  0.000000  0.000000  0.000000 -2.869235
##             13         14         15         16          17          18
## N.A -1.9935634 -0.7043727  0.0000000 -0.4907047 -0.22065637 -0.13120187
## N.C -0.6795564 -0.8813708 -0.9862406  0.0000000  0.00000000  0.00000000
## N.G -1.7686508  0.0000000 -0.1193672 -0.2272791 -0.27664786 -0.11866174
## N.T  0.0000000 -0.2052389 -0.5741728 -0.2661403 -0.08712911  0.05684218
##             19          20
## N.A -0.0464789 -0.03691098
## N.C  0.0000000  0.00000000
## N.G -0.1258478 -0.07450807
## N.T  0.1371646  0.06531133
## 
## Nucleotide beta errors:
##               1           2           3           4           5
## N.A 0.001699741 0.001458849 0.001223290 0.001173152 0.000000000
## N.C 0.001571585 0.001505802 0.001525573 0.001433497 0.002087362
## N.G 0.000000000 0.000000000 0.000000000 0.000000000 0.001008012
## N.T 0.001281035 0.001362097 0.001229847 0.001167967 0.001144191
##               6           7          8           9          10          11
## N.A 0.001753601 0.001097784 0.00000000 0.003999891 0.004573269 0.002703121
## N.C 0.007843630 0.081112024 0.02199675 0.013622474 0.032014762 0.008975510
## N.G 0.010921739 0.000000000 0.01559701 0.004010021 0.023194469 0.004120531
## N.T 0.000000000 0.002005129 0.02098702 0.000000000 0.000000000 0.000000000
##             12          13           14           15          16
## N.A 0.00000000 0.012068560 0.0015041841 0.0000000000 0.001452558
## N.C 0.04166788 0.001589533 0.0023611958 0.0026119270 0.000000000
## N.G 0.01966610 0.009202916 0.0000000000 0.0008862308 0.001150518
## N.T 0.05185067 0.000000000 0.0008606356 0.0012536108 0.001084366
##              17          18          19          20
## N.A 0.001313329 0.001371280 0.001552155 0.001279968
## N.C 0.000000000 0.000000000 0.000000000 0.000000000
## N.G 0.001455989 0.001565561 0.001558660 0.001684514
## N.T 0.001149218 0.001275922 0.001484541 0.001738294
## 
## 
## An object of class 'Intercept'
## Fits 2 strand orientations and 1 round(s) (round = 2).
## Intercept beta values:
## Round.2:
##            Strand
## Strand.F 25.62084
## Strand.R 25.63312
## 
## Intercept beta errors:
## Round.2:
##               Strand
## Strand.F 0.003948383
## Strand.R 0.004064934
## 
## 
## 
## An object of class 'Shape'
## Fits 0 shape coefficients for 0 kinds of shape parameter(s) (shape = ) for a feature model of length 20.
## [1] "Number of Observations in Design Matrix: 773417"
## No shape parameters included in fit.
## [1] "i = 6"
## No shape parameters included in fit.
## [1] "Round summary: "
##            2  Total
## Round 773417 773417
## [1] "Mono-nucleotide summary: "
##       N.A    N.C    N.G    N.T
## 1   65062 182003 297835 228517
## 2   96492 155724 306611 214590
## 3  133380  83488 370843 185706
## 4  145089 102586 369601 156141
## 5  324882  62399 255233 130903
## 6  106023  24416  20541 622437
## 7  172185   2324 521977  76931
## 8  729976  13484  16766  13191
## 9   40966  14074  42083 676294
## 10  39113   7715  11583 715006
## 11  50086  15938  42350 665043
## 12 747646   7579  13113   5079
## 13  11939 108129  16220 637129
## 14 103077  46530 388984 234826
## 15 316920  53118 271898 131481
## 16  95779 348978 159398 169262
## 17 121975 393775  99801 157866
## 18 226941 313696  90186 142594
## 19 185191 285429 188473 114324
## 20 203299 352764 150350  67004
## [1] "View/strand orientation summary: "
##          View.1 View.2 View.3 View.4 View.5 View.6 View.7 StrandTotal
## Strand.F  47773  81543  74844  67462  66362  66825  77163      481972
## Strand.R  35792  49300  47789  35687  36725  39502  46650      291445
## [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+Strand.R"
## No shape parameters included in fit.
## An object of class 'model'
## 
## Slot "name":  HM-Exd-Ubx4a Nucleotides+Strand 
## 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 features  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+Strand.F+Strand.R 
## 
## 
## 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.02034138  0.03223543  0.006222472 -0.01526898  0.0000000 -0.9367149
## N.C -0.01001520 -0.10334863 -0.156402148 -0.18354437 -0.8471511 -1.7552437
## N.G  0.00000000  0.00000000  0.000000000  0.00000000 -0.3087745 -2.0109447
## N.T -0.09239320 -0.06151658 -0.159893650 -0.09461630 -0.4918481  0.0000000
##              7         8         9        10        11        12
## N.A -0.6585835  0.000000 -1.351430 -1.557664 -1.154470  0.000000
## N.C -2.8072621 -2.364743 -1.996941 -2.458236 -1.374946 -2.531075
## N.G  0.0000000 -2.213336 -1.409028 -2.244314 -1.393872 -2.358901
## N.T -1.1964361 -2.588552  0.000000  0.000000  0.000000 -2.869235
##             13         14         15         16         17          18
## N.A -1.9935629 -0.7043727  0.0000000 -0.4907040 -0.2206561 -0.13120152
## N.C -0.6795562 -0.8813708 -0.9862409  0.0000000  0.0000000  0.00000000
## N.G -1.7686504  0.0000000 -0.1193682 -0.2272787 -0.2766474 -0.11866195
## N.T  0.0000000 -0.2052399 -0.5741732 -0.2661396 -0.0871290  0.05684214
##             19          20
## N.A -0.0464791 -0.03691026
## N.C  0.0000000  0.00000000
## N.G -0.1258473 -0.07450884
## N.T  0.1371650  0.06531106
## 
## Nucleotide beta errors:
##               1           2           3           4           5
## N.A 0.001699741 0.001458851 0.001223291 0.001173153 0.000000000
## N.C 0.001571585 0.001505802 0.001525573 0.001433497 0.002087362
## N.G 0.000000000 0.000000000 0.000000000 0.000000000 0.001008012
## N.T 0.001281036 0.001362097 0.001229847 0.001167968 0.001144192
##               6           7          8           9          10          11
## N.A 0.001753601 0.001097784 0.00000000 0.003999891 0.004573269 0.002703121
## N.C 0.007843630 0.082200698 0.02199675 0.013622474 0.032014762 0.008975511
## N.G 0.010921739 0.000000000 0.01559701 0.004010021 0.023194469 0.004120531
## N.T 0.000000000 0.002005129 0.02098702 0.000000000 0.000000000 0.000000000
##             12          13          14           15          16
## N.A 0.00000000 0.012068560 0.001504184 0.0000000000 0.001452559
## N.C 0.04166788 0.001589533 0.002361196 0.0026119270 0.000000000
## N.G 0.01966610 0.009202916 0.000000000 0.0008862313 0.001150519
## N.T 0.05185067 0.000000000 0.000860636 0.0012536108 0.001084367
##              17          18          19          20
## N.A 0.001313329 0.001371280 0.001552155 0.001279968
## N.C 0.000000000 0.000000000 0.000000000 0.000000000
## N.G 0.001455989 0.001565561 0.001558660 0.001684515
## N.T 0.001149218 0.001275922 0.001484542 0.001738293
## 
## 
## An object of class 'Intercept'
## Fits 2 strand orientations and 1 round(s) (round = 2).
## Intercept beta values:
## Round.2:
##            Strand
## Strand.F 25.62084
## Strand.R 25.63312
## 
## Intercept beta errors:
## Round.2:
##               Strand
## Strand.F 0.003948383
## Strand.R 0.004064935
## 
## 
## 
## An object of class 'Shape'
## Fits 0 shape coefficients for 0 kinds of shape parameter(s) (shape = ) for a feature model of length 20.
## [1] "Number of Observations in Design Matrix: 773407"
## No shape parameters included in fit.
## [1] "i = 7"
## No shape parameters included in fit.
## [1] "Round summary: "
##            2  Total
## Round 773407 773407
## [1] "Mono-nucleotide summary: "
##       N.A    N.C    N.G    N.T
## 1   65060 181999 297832 228516
## 2   96490 155720 306610 214587
## 3  133377  83488 370839 185703
## 4  145087 102586 369594 156140
## 5  324876  62398 255231 130902
## 6  106019  24416  20541 622431
## 7  172185   2314 521977  76931
## 8  729968  13482  16766  13191
## 9   40965  14074  42083 676285
## 10  39112   7715  11583 714997
## 11  50085  15938  42348 665036
## 12 747637   7579  13112   5079
## 13  11939 108126  16220 637122
## 14 103075  46530 388979 234823
## 15 316917  53118 271892 131480
## 16  95776 348972 159397 169262
## 17 121973 393771  99799 157864
## 18 226938 313691  90186 142592
## 19 185190 285426 188469 114322
## 20 203295 352760 150349  67003
## [1] "View/strand orientation summary: "
##          View.1 View.2 View.3 View.4 View.5 View.6 View.7 StrandTotal
## Strand.F  47773  81541  74844  67462  66361  66825  77160      481966
## Strand.R  35791  49299  47789  35687  36724  39501  46650      291441
## [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+Strand.R"
## No shape parameters included in fit.
## An object of class 'model'
## 
## Slot "name":  HM-Exd-Ubx4a Nucleotides+Strand 
## 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 features  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+Strand.F+Strand.R 
## 
## 
## 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.02034153  0.03223548  0.00622246 -0.01526898  0.0000000 -0.9367149
## N.C -0.01001517 -0.10334873 -0.15640215 -0.18354442 -0.8471511 -1.7552437
## N.G  0.00000000  0.00000000  0.00000000  0.00000000 -0.3087745 -2.0109447
## N.T -0.09239320 -0.06151664 -0.15989346 -0.09461637 -0.4918480  0.0000000
##              7         8         9        10        11        12
## N.A -0.6585835  0.000000 -1.351430 -1.557664 -1.154470  0.000000
## N.C -2.8059636 -2.364742 -1.996941 -2.458236 -1.374946 -2.531075
## N.G  0.0000000 -2.213336 -1.409028 -2.244314 -1.393872 -2.358901
## N.T -1.1964360 -2.588552  0.000000  0.000000  0.000000 -2.869235
##             13         14         15         16          17          18
## N.A -1.9935629 -0.7043727  0.0000000 -0.4907038 -0.22065606 -0.13120155
## N.C -0.6795562 -0.8813708 -0.9862410  0.0000000  0.00000000  0.00000000
## N.G -1.7686504  0.0000000 -0.1193682 -0.2272787 -0.27664740 -0.11866199
## N.T  0.0000000 -0.2052398 -0.5741732 -0.2661396 -0.08712893  0.05684207
##              19          20
## N.A -0.04647913 -0.03691026
## N.C  0.00000000  0.00000000
## N.G -0.12584731 -0.07450888
## N.T  0.13716492  0.06531103
## 
## Nucleotide beta errors:
##               1           2           3           4           5
## N.A 0.001699742 0.001458851 0.001223291 0.001173153 0.000000000
## N.C 0.001571585 0.001505802 0.001525573 0.001433497 0.002087362
## N.G 0.000000000 0.000000000 0.000000000 0.000000000 0.001008012
## N.T 0.001281036 0.001362097 0.001229847 0.001167968 0.001144192
##               6           7          8           9          10          11
## N.A 0.001753601 0.001097784 0.00000000 0.003999891 0.004573269 0.002703121
## N.C 0.007843630 0.082200731 0.02199675 0.013622474 0.032014762 0.008975511
## N.G 0.010921739 0.000000000 0.01559701 0.004010021 0.023194469 0.004120531
## N.T 0.000000000 0.002005129 0.02098702 0.000000000 0.000000000 0.000000000
##             12          13          14           15          16
## N.A 0.00000000 0.012068560 0.001504184 0.0000000000 0.001452559
## N.C 0.04166788 0.001589533 0.002361196 0.0026119270 0.000000000
## N.G 0.01966610 0.009202916 0.000000000 0.0008862313 0.001150519
## N.T 0.05185067 0.000000000 0.000860636 0.0012536108 0.001084367
##              17          18          19          20
## N.A 0.001313329 0.001371280 0.001552155 0.001279968
## N.C 0.000000000 0.000000000 0.000000000 0.000000000
## N.G 0.001455989 0.001565561 0.001558660 0.001684515
## N.T 0.001149218 0.001275922 0.001484542 0.001738293
## 
## 
## An object of class 'Intercept'
## Fits 2 strand orientations and 1 round(s) (round = 2).
## Intercept beta values:
## Round.2:
##            Strand
## Strand.F 25.62084
## Strand.R 25.63312
## 
## Intercept beta errors:
## Round.2:
##               Strand
## Strand.F 0.003948383
## Strand.R 0.004064935
## 
## 
## 
## An object of class 'Shape'
## Fits 0 shape coefficients for 0 kinds of shape parameter(s) (shape = ) for a feature model of length 20.
## [1] "Number of Observations in Design Matrix: 773407"
## No shape parameters included in fit.
## [1] "Stability Reached after 7 iterations."
ModelTest <- finalizeFeatureBetas(ModelTest)

pM <- plot(ModelTest, plotTitle = "HM-Ubx4a-Exd R2 Nucleotide+Strand 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