diff options
author | zsloan | 2020-12-02 14:25:08 -0600 |
---|---|---|
committer | zsloan | 2020-12-02 14:25:08 -0600 |
commit | c0fa6e81a0c93bb83e0753732cdcf05fb3290769 (patch) | |
tree | 0cf5d641307457c3d08d76a53922bcdc9b97f3e7 | |
parent | ec045cf2e2843c73c26b1598eb2aa61ed2efb1dc (diff) | |
download | genenetwork2-c0fa6e81a0c93bb83e0753732cdcf05fb3290769.tar.gz |
Added index to search result export
-rw-r--r-- | wqflask/wqflask/export_traits.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/wqflask/wqflask/export_traits.py b/wqflask/wqflask/export_traits.py index 3a886537..47a2000f 100644 --- a/wqflask/wqflask/export_traits.py +++ b/wqflask/wqflask/export_traits.py @@ -54,7 +54,7 @@ def export_search_results_csv(targs): trait_ob = retrieve_trait_info(trait_ob, trait_ob.dataset, get_qtl_info=True) trait_list.append(trait_ob) - table_headers = ['Species', 'Group', 'Dataset', 'Record ID', 'Symbol', 'Description', 'ProbeTarget', 'PubMed_ID', 'Chr', 'Mb', 'Alias', 'Gene_ID', 'Homologene_ID', 'UniGene_ID', 'Strand_Probe', 'Probe_set_specificity', 'Probe_set_BLAT_score', 'Probe_set_BLAT_Mb_start', 'Probe_set_BLAT_Mb_end', 'QTL_Chr', 'QTL_Mb', 'Locus_at_Peak', 'Max_LRS', 'P_value_of_MAX', 'Mean_Expression'] + table_headers = ['Index', 'Species', 'Group', 'Dataset', 'Record ID', 'Symbol', 'Description', 'ProbeTarget', 'PubMed_ID', 'Chr', 'Mb', 'Alias', 'Gene_ID', 'Homologene_ID', 'UniGene_ID', 'Strand_Probe', 'Probe_set_specificity', 'Probe_set_BLAT_score', 'Probe_set_BLAT_Mb_start', 'Probe_set_BLAT_Mb_end', 'QTL_Chr', 'QTL_Mb', 'Locus_at_Peak', 'Max_LRS', 'P_value_of_MAX', 'Mean_Expression'] traits_by_group = sort_traits_by_group(trait_list) @@ -77,7 +77,7 @@ def export_search_results_csv(targs): csv_rows.append(full_headers) - for trait in group_traits: + for i, trait in enumerate(group_traits): if getattr(trait, "symbol", None): trait_symbol = getattr(trait, "symbol") elif getattr(trait, "abbreviation", None): @@ -85,6 +85,7 @@ def export_search_results_csv(targs): else: trait_symbol = "N/A" row_contents = [ + i + 1, trait.dataset.group.species, trait.dataset.group.name, trait.dataset.name, |