aboutsummaryrefslogtreecommitdiff
path: root/gn3/computations
diff options
context:
space:
mode:
authorMuriithi Frederick Muriuki2021-08-30 11:44:37 +0300
committerMuriithi Frederick Muriuki2021-08-30 11:44:37 +0300
commit58f59b8f7df82969b58a604070aec095d17e0501 (patch)
treea428d08e0a5eefe8d608fe74fc04f30f3952c362 /gn3/computations
parentbb1fd69fa24cec4ff605450d241601b3f0ced8cb (diff)
downloadgenenetwork3-58f59b8f7df82969b58a604070aec095d17e0501.tar.gz
Fix issues with traits file format
* README.md: update header: Traits ==> Trait * gn3/computations/qtlreaper.py: update header: Traits ==> Trait * qtlfilesexport.py: Choose only BXD strains Rename the first column header from "Traits" to "Trait" to correspond with what `rust-qtlreaper` expects. Choose only the BXD strains for the proof-of-concept example - this helped bring out the fact that the traits file SHOULD NOT contain a strain column for a strain that does not exist in the genotype file in consideration. If the traits file has a strain column which does not exist in the genotype file, then `rust-qtlreaper` fails with a panic, since, from what I can tell, it tries to get a value from the genotype file for the non-existent strain, which results to a `None` type. Subsequent attempts at running an operation on the `None` type lead to the panic.
Diffstat (limited to 'gn3/computations')
-rw-r--r--gn3/computations/qtlreaper.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/gn3/computations/qtlreaper.py b/gn3/computations/qtlreaper.py
index a88659e..9b13a55 100644
--- a/gn3/computations/qtlreaper.py
+++ b/gn3/computations/qtlreaper.py
@@ -24,7 +24,7 @@ def generate_traits_file(strains, trait_values, traits_filename):
traits_filename: The tab-separated value to put the values in for
computation of QTLs.
"""
- header = "Traits\t{}\n".format("\t".join(strains))
+ header = "Trait\t{}\n".format("\t".join(strains))
data = [header] + [
"T{}\t{}\n".format(i+1, "\t".join([str(i) for i in t]))
for i, t in enumerate(trait_values[:-1])] + [