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(computePersonalAllFreqs)
export(computeRows) export(computeRows)
export(etsiParas) export(etsiParas)
export(fgetl)
export(fopen)
export(greedyMix) export(greedyMix)
export(handleData) export(handleData)
export(initPopNames) export(initPopNames)
@ -21,6 +23,7 @@ export(linkage)
export(logml2String) export(logml2String)
export(lueGenePopData) export(lueGenePopData)
export(lueNimi) export(lueNimi)
export(min_MATLAB)
export(noIndex) export(noIndex)
export(ownNum2Str) export(ownNum2Str)
export(poistaLiianPienet) export(poistaLiianPienet)

View file

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

View file

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand % 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} \name{fgetl}
\alias{fgetl} \alias{fgetl}
\title{Read line from file, removing newline characters} \title{Read line from file, removing newline characters}

View file

@ -1,5 +1,5 @@
% Generated by roxygen2: do not edit by hand % 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} \name{fopen}
\alias{fopen} \alias{fopen}
\title{Open file} \title{Open file}

View file

@ -7,7 +7,7 @@
linkage(Y, method = "co") linkage(Y, method = "co")
} }
\arguments{ \arguments{
\item{Y}{data} \item{Y}{matrix}
\item{method}{either 'si', 'av', 'co' 'ce' or 'wa'} \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 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 PDIST. Y may also be a more general dissimilarity matrix conforming to the
output format of PDIST. 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 nimi
} }
\description{ \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 count
} }
\description{ \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{ \arguments{
\item{tiedostonNimi}{Filename} \item{tiedostonNimi}{Filename}
} }
\value{
kunnossa (binary "ok" condition value) == 0 if the data is not valid genePop data. Otherwise, kunnossa == 1.
}
\description{ \description{
Tests GenePop data 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} \item{rivi}{Line}
} }
\value{ \value{
pal pal = 1 if the line starts with one of the following
} }
\description{ \description{
Test a line in the population Test a line in the population