diff options
author | Muriithi Frederick Muriuki | 2021-09-08 10:51:57 +0300 |
---|---|---|
committer | Muriithi Frederick Muriuki | 2021-09-08 10:51:57 +0300 |
commit | f360cc62cc156af90d3283ae7b6db9e8250fa43c (patch) | |
tree | df75d3345d78bc38cb53396e6ae085cc5613540f /gn3/computations/qtlreaper.py | |
parent | 31ca02d1f095c2cc667e5b7d49131d702982f321 (diff) | |
download | genenetwork3-f360cc62cc156af90d3283ae7b6db9e8250fa43c.tar.gz |
Remove extraneous text to ease sorting
Issue:
https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi
* Change the id from 'T<n>' to simply '<n>' to ease sorting of the trait
results by numerical order rather than string order.
Diffstat (limited to 'gn3/computations/qtlreaper.py')
-rw-r--r-- | gn3/computations/qtlreaper.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gn3/computations/qtlreaper.py b/gn3/computations/qtlreaper.py index 8c0e6de..ec215e5 100644 --- a/gn3/computations/qtlreaper.py +++ b/gn3/computations/qtlreaper.py @@ -20,9 +20,9 @@ def generate_traits_file(strains, trait_values, traits_filename): header = "Trait\t{}\n".format("\t".join(strains)) data = ( [header] + - ["T{}\t{}\n".format(i+1, "\t".join([str(i) for i in t])) + ["{}\t{}\n".format(i+1, "\t".join([str(i) for i in t])) for i, t in enumerate(trait_values[:-1])] + - ["T{}\t{}".format( + ["{}\t{}".format( len(trait_values), "\t".join([str(i) for i in t])) for t in trait_values[-1:]]) with open(traits_filename, "w") as outfile: |