Updated documentation

This commit is contained in:
Waldir Leoncio 2020-07-31 14:05:40 +02:00
parent f89a6e9fa3
commit d57be6a8f3
10 changed files with 73 additions and 37 deletions

View file

@ -10,6 +10,8 @@ export(computeIndLogml)
export(computePersonalAllFreqs)
export(computeRows)
export(etsiParas)
export(fgetl)
export(fopen)
export(greedyMix)
export(handleData)
export(initPopNames)
@ -21,6 +23,7 @@ export(linkage)
export(logml2String)
export(lueGenePopData)
export(lueNimi)
export(min_MATLAB)
export(noIndex)
export(ownNum2Str)
export(poistaLiianPienet)

View file

@ -156,8 +156,7 @@ greedyMix <- function(
# h0 = findobj('Tag','filename1_text');
# set(h0,'String',filename); clear h0;
browser()#TEMP
list_dranap <- handleData(data) # FIXME: debug
list_dranap <- handleData(data)
data <- list_dranap$newData
rowsFromInd <- list_dranap$rowsFromInd
alleleCodes <- list_dranap$alleleCodes
@ -253,7 +252,7 @@ greedyMix <- function(
POP_LOGML <- vector()
clearGlobalVars <- vector()
# ==========================================================================
c <- list()
c$data <- data
c$noalle <- noalle
c$adjprior <- adjprior
@ -267,34 +266,34 @@ greedyMix <- function(
c$rows <- c(ekat, ekat + rowsFromInd - 1)
# partition compare
if (!is.null(partitionCompare)) {
nsamplingunits <- size(c$rows, 1)
partitions <- partitionCompare$partitions
npartitions <- size(partitions, 2)
partitionLogml <- zeros(1, npartitions)
for (i in seq_len(npartitions)) {
# number of unique partition lables
npops <- length(unique(partitions[, i]))
# if (!is.null(partitionCompare)) {
# nsamplingunits <- size(c$rows, 1)
# partitions <- partitionCompare$partitions
# npartitions <- size(partitions, 2)
# partitionLogml <- zeros(1, npartitions)
# for (i in seq_len(npartitions)) {
# # number of unique partition lables
# npops <- length(unique(partitions[, i]))
partitionInd <- zeros(ninds * rowsFromInd, 1)
partitionSample <- partitions[, i]
for (j in seq_len(nsamplingunits)) {
partitionInd[c$rows[j, 1]:c$rows[j, 2]] <- partitionSample[j]
}
# partitionLogml[i] = initialCounts(
# partitionInd,
# data[, seq_len(end - 1)],
# npops,
# c$rows,
# noalle,
# adjprior
# ) #TODO translate
}
# return the logml result
partitionCompare$logmls <- partitionLogml
# set(h1, 'userdata', partitionCompare) # ASK remove?
return()
}
# partitionInd <- zeros(ninds * rowsFromInd, 1)
# partitionSample <- partitions[, i]
# for (j in seq_len(nsamplingunits)) {
# partitionInd[c$rows[j, 1]:c$rows[j, 2]] <- partitionSample[j]
# }
# # partitionLogml[i] = initialCounts(
# # partitionInd,
# # data[, seq_len(end - 1)],
# # npops,
# # c$rows,
# # noalle,
# # adjprior
# # ) #TODO translate
# }
# # return the logml result
# partitionCompare$logmls <- partitionLogml
# # set(h1, 'userdata', partitionCompare) # ASK remove?
# return()
# }
# ASK remove (graphical part)?
# if (fixedK) {
@ -312,10 +311,11 @@ greedyMix <- function(
# h0 = findobj('Tag','filename2_text')
# outp = get(h0,'String');
browser() # TEMP
changesInLogml <- writeMixtureInfo(
logml, rowsFromInd, data, adjprior, priorTerm, outp, inp,
popnames, fixedK
) # FIXMEL depends on get function above
) # FIXME: broken
# viewMixPartition(PARTITION, popnames) # ASK translate? On graph folder

View file

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/fgetl.R
% Please edit documentation in R/fgetl-fopen.R
\name{fgetl}
\alias{fgetl}
\title{Read line from file, removing newline characters}

View file

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/fgetl.R
% Please edit documentation in R/fgetl-fopen.R
\name{fopen}
\alias{fopen}
\title{Open file}

View file

@ -7,7 +7,7 @@
linkage(Y, method = "co")
}
\arguments{
\item{Y}{data}
\item{Y}{matrix}
\item{method}{either 'si', 'av', 'co' 'ce' or 'wa'}
}
@ -19,4 +19,9 @@ Z = LINKAGE(Y) creates a hierarchical cluster tree, using the single
linkage algorithm. The input Y is a distance matrix such as is generated by
PDIST. Y may also be a more general dissimilarity matrix conforming to the
output format of PDIST.
Z = linkage(X) returns a matrix Z that encodes a tree containing hierarchical clusters of the rows of the input data matrix X.
}
\note{
This is also a base Matlab function. The reason why the source code is also present here is unclear.
}

View file

@ -13,5 +13,5 @@ lueNimi(line)
nimi
}
\description{
Reads the line name
Returns the part of the line from the beginning that is before the comma. Useful for returning the name of a GenePop area
}

22
man/min_MATLAB.Rd Normal file
View file

@ -0,0 +1,22 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/min.R
\name{min_MATLAB}
\alias{min_MATLAB}
\title{Minimum (MATLAB version)}
\usage{
min_MATLAB(X, indices = TRUE)
}
\arguments{
\item{X}{matrix}
\item{indices}{return indices?}
}
\value{
Either a list or a vector
}
\description{
Finds the minimum value for each column of a matrix, potentially returning the indices instead
}
\author{
Waldir Leoncio
}

View file

@ -13,5 +13,5 @@ rivinSisaltamienMjonojenLkm(line)
count
}
\description{
Number of M queues
Returns the number of queues contained in the line. There must be a space between the queues.
}

View file

@ -9,6 +9,12 @@ testaaGenePopData(tiedostonNimi)
\arguments{
\item{tiedostonNimi}{Filename}
}
\value{
kunnossa (binary "ok" condition value) == 0 if the data is not valid genePop data. Otherwise, kunnossa == 1.
}
\description{
Tests GenePop data
}
\details{
GenePop data are textfiles that follow the GenePop format. This function checks if such file is properly formatted as GenePop.
}

View file

@ -10,7 +10,7 @@ testaaPop(rivi)
\item{rivi}{Line}
}
\value{
pal
pal = 1 if the line starts with one of the following
}
\description{
Test a line in the population