<p><strong>Question 1: Is there a tool for imputing phenotypes while also using genetic data?</strong></p>

<p>Yes, try Andy Dahl's <a href="http://mathgen.stats.ox.ac.uk/genetics_software/phenix/phenix.html" rel="nofollow noreferrer">Phenix</a> from the Marchini lab.  </p>

<p>Disclosure: I did my PhD in the Marchini lab, although I was not directly involved in this research.</p>

<p><strong>Question 2: Is there a way to impute categorical data using methods intended for continuous data?</strong></p>

<p>If the variable of interest has only two categories, then you should be able to simply recode the categories as arbitrary (differing) numbers and get sensible results. But do make sure you understand the tool you are using to see if this will work.</p>

<p>For more than two categories, if your imputation approach allows the simultaneous imputation of multiple variables, you could try recoding your categories as <a href="https://en.wikipedia.org/wiki/Contrast_(statistics)" rel="nofollow noreferrer">contrasts</a> or <a href="http://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.OneHotEncoder.html" rel="nofollow noreferrer">one-hot</a>.  After recoding, you could impute the variables resulting from recoding together.</p>

CC BY-SA 4.0
2018-03-10T17:38:38.430Z
2018-08-15T11:05:24.777Z
2018-08-15T11:05:24.777Z
winni2k
<p>Errors happen frequently in the lab and I got one sample that we mixed one important information (the region of the sample) between two samples. Now we don't know which sample is from which region, but we know all the other variables (Date of the sample, patient, and other variables).</p>

<p>So far, my solution has been to make that values as <code>NA</code> to be able to analyze it, but I would like to know if there is any solution. If I can convey to test or other analysis downstream that sample A and sample B are from Location1 or Location2 and if A is from Location1, B is from Location2 and otherwise round.</p>

<p>There are several packages for imputing quantitative data, but I couldn't find any to store this kind of information or to impute qualitative data. I can recall a recent paper with single-cell sequencing that estimated phenotype and some other variables but I can't find it neither I think it is possible with RNAseq.</p>

<p>Although maybe I could build a classifier to actually do that (but that would be too long and I'm not sure if it is worth it)</p>

<p><strong>Notes</strong></p>

<ol>
<li>My samples are from more than two locations.</li>
<li>My samples consist of 16S microbiome DNA-seq and RNA-seq</li>
</ol>

<data-management><imputation>
Impute phenotype under some constraints
# Impute phenotype under some constraints

(Asked by: username_0 on 2018-03-09)

Errors happen frequently in the lab and I got one sample that we mixed one important information (the region of the sample) between two samples. Now we don't know which sample is from which region, but we know all the other variables (Date of the sample, patient, and other variables).

So far, my solution has been to make that values as `NA` to be able to analyze it, but I would like to know if there is any solution. If I can convey to test or other analysis downstream that sample A and sample B are from Location1 or Location2 and if A is from Location1, B is from Location2 and otherwise round.

There are several packages for imputing quantitative data, but I couldn't find any to store this kind of information or to impute qualitative data. I can recall a recent paper with single-cell sequencing that estimated phenotype and some other variables but I can't find it neither I think it is possible with RNAseq.

Although maybe I could build a classifier to actually do that (but that would be too long and I'm not sure if it is worth it)

**Notes**

1. My samples are from more than two locations.
2. My samples consist of 16S microbiome DNA-seq and RNA-seq

**Tags:** data-management, imputation

---

## 1 answers

### Answer by username_1 on 2018-03-10. Score: 2

**Question 1: Is there a tool for imputing phenotypes while also using genetic data?**

Yes, try Andy Dahl's [Phenix](http://mathgen.stats.ox.ac.uk/genetics_software/phenix/phenix.html) from the Marchini lab.

Disclosure: I did my PhD in the Marchini lab, although I was not directly involved in this research.

**Question 2: Is there a way to impute categorical data using methods intended for continuous data?**

If the variable of interest has only two categories, then you should be able to simply recode the categories as arbitrary (differing) numbers and get sensible results. But do make sure you understand the tool you are using to see if this will work.

For more than two categories, if your imputation approach allows the simultaneous imputation of multiple variables, you could try recoding your categories as [contrasts](https://en.wikipedia.org/wiki/Contrast_(statistics)) or [one-hot](http://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.OneHotEncoder.html). After recoding, you could impute the variables resulting from recoding together.


---

