snpm2phase {GGtools} | R Documentation

## convert information in a snp.matrix to PHASE input format; invokePhase can run a suitably installed version of PHASE

### Description

convert information in a snp.matrix to PHASE input format; invokePhase can run a suitably installed version of PHASE

### Usage

    snpm2phase(snpm, cnum, outfilename)
    parsePh.out(fn)
    personalHap(x)

### Arguments

`snpm` | snp.matrix instance
`cnum` | chromosome number as chrnum instance
`outfilename` | character name of file to write
`fn` | character name of PHASE .out file to read
`x` | output of parsePh.out

### Details

follows phase 2.1 documentation for input format

a phaseInput container class can store relevant metadata

### Value

writes to a file and gives a message

### Author(s)

Vince Carey <stvjc@channing.harvard.edu>

### Examples

    data(smtest)
    tt = tempfile()
    pin = snpm2phase(smtest, chrnum(20), tt)

    class(pin)
    getClass("phaseInput")
    pin
    readLines(tt)
    unlink(tt)
    pp = parsePh.out(system.file("phaseOut/cpne1_20k.out", package="GGtools"))
    pp[[1]][1:3]
    personalHap(pp)

[Package GGtools version 3.2.0 Index]