From 58f59b8f7df82969b58a604070aec095d17e0501 Mon Sep 17 00:00:00 2001 From: Muriithi Frederick Muriuki Date: Mon, 30 Aug 2021 11:44:37 +0300 Subject: 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. --- gn3/computations/qtlreaper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gn3/computations') 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])] + [ -- cgit v1.2.3