kbroman/qtl — pull request #20 by aaronwolen (2014-08-22 15:02:43+00:00)
Title: Initial commit of read.cross.tidy()

Hi Karl,

This PR adds support for a new `read.cross()` format I'm calling "tidy" because genotype, phenotype and map data are stored in separate files using a standard `data.frame`-like format:

**Phenotypes: **

| | 1 | 2 | 3 | 4 | 5 |
|-----------:|:------|:-----|:------|:-----|:------|
| **T264** | 118.3 | 264 | 194.9 | 264 | 145.4 |

**Genotypes:**

| | 1 | 2 | 3 | 4 | 5 |
|-------------:|:-----|:-----|:-----|:-----|:-----|
| **D10M44** | B | - | - | B | H |
| **D1M3** | B | B | H | B | H |
| **D1M75** | B | B | H | H | H |
| **D1M215** | H | B | H | H | H |
| **D1M309** | H | H | H | H | B |

**Map:**

| | chr | cm |
|-------------:|:------|:-------|
| **D10M44** | 1 | 0 |
| **D1M3** | 1 | 0.996 |
| **D1M75** | 1 | 24.85 |
| **D1M215** | 1 | 40.41 |
| **D1M309** | 1 | 49.99 |

The advantage of this format is each file can be easily loaded into R with `read.table()` for analysis/visualization outside of R/qtl. For projects using R/qtl I usually maintain two sets of genotype/phenotype files: 1 for general analysis and 1 set formatted for R/qtl. Adding something like `read.cross.tidy()` would allow me to avoid that redundancy, so that's my selfish motivation behind this PR.

I'd call it draft code at this point; it works but lacks the extensive data checks found in the other `read.cross.*()` functions. I can bring it up to parity but wanted to gauge your level interest before proceeding.