read.ms.output {gap}R Documentation

A utility function to read ms output

Description

A utility function to read ms output

Usage

read.ms.output(
  msout,
  is.file = TRUE,
  xpose = TRUE,
  verbose = TRUE,
  outfile = NULL,
  outfileonly = FALSE
)

Arguments

msout

an ms output.

is.file

a flag indicating ms output as a system file or an R object.

xpose

a flag to obtain the tranposed format as it is (when TRUE).

verbose

when TRUE, display on screen every 1000 for large nsam.

outfile

to save the haplotypes in a tab-delimited ASCII file.

outfileonly

to reset gametes to NA when nsam/nreps is very large and is useful with outfile.

Details

This function reads in the output of the program ms, a program to generate samples under a variety of neutral models.

The argument indicates either a file name or a vector of character strings, one string for each line of the output of ms. As with the second case, it is appropriate with system(,intern=TRUE), see example below.

Value

The returned value is a list storing the results:

Author(s)

D Davison, RR Hudson, JH Zhao

References

Hudson RR (2002). “Generating samples under a Wright-Fisher neutral model of genetic variation.” Bioinformatics, 18(2), 337-8. ISSN 1367-4803 (Print) 1367-4803, doi:10.1093/bioinformatics/18.2.337.

Press WH, SA Teukolsky, WT Vetterling, BP Flannery (1992). Numerical Recipes in C. Cambridge University Press, Cambridge.

Examples

## Not run: 
# Assuming ms is on the path

system("ms 5 4 -s 5 > ms.out")
msout1 <- read.ms.output("ms.out")

system("ms 50 4 -s 5 > ms.out")
msout2 <- read.ms.output("ms.out",outfile="out",outfileonly=TRUE)

msout <- system("ms 5 4 -s 5 -L", intern=TRUE)
msout3 <- read.ms.output(msout,FALSE)

## End(Not run)


[Package gap version 1.5-3 Index]