genenetwork / genenetwork2

GeneNetwork (2nd generation)
http://gn2.genenetwork.org/
GNU Affero General Public License v3.0
34 stars 24 forks source link

Add updated version of script for adding new expression sample data #681

Closed zsloan closed 2 years ago

zsloan commented 2 years ago

This PR adds a refactored version of a GN1 script to insert expression sample data into the DB.

I mostly just refactored the stuff that was obviously bad about the original. This is my favorite part of the original code (all this part is supposed to do is find items in GeneList that aren't in Names):

x = y = 0
x1 = -1
GeneList2 = []
while x < len(GeneList) and y < len(Names):
    if GeneList[x] == Names[y]:
        x += 1
        y += 1
    elif GeneList[x] < Names[y]:
        if x != x1:
            GeneList2.append(GeneList[x])
            x1 = x
        x += 1
    elif GeneList[x] > Names[y]:
        y += 1
robwwilliams commented 2 years ago

great. Thanks.

On Fri, Mar 11, 2022 at 16:40 zsloan @.***> wrote:

This PR adds a refactored version of a GN1 script to insert expression sample data into the DB.

I mostly just refactored the stuff that was obviously bad about the original. This is my favorite part of the original code (all this part is supposed to do is find items in GeneList that aren't in Names):

x = y = 0 x1 = -1 GeneList2 = [] while x < len(GeneList) and y < len(Names): if GeneList[x] == Names[y]: x += 1 y += 1 elif GeneList[x] < Names[y]: if x != x1: GeneList2.append(GeneList[x]) x1 = x x += 1 elif GeneList[x] > Names[y]: y += 1


You can view, comment on, or merge this pull request online at:

https://github.com/genenetwork/genenetwork2/pull/681 Commit Summary

File Changes

(1 file https://github.com/genenetwork/genenetwork2/pull/681/files)

Patch Links:

— Reply to this email directly, view it on GitHub https://github.com/genenetwork/genenetwork2/pull/681, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC55V7A6Y2XADTOHAXZDI4TU7PDV3ANCNFSM5QQ3SAGQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Rob

Robert W Williams PhD Department of Genetics, Genomics and Informatics 71 S Manassas St, Memphis TN 38163 University of Tennessee Health Science Center, TSRB 405 Cell: 901 604 4752 EMAIL: @.*** Zoom: https://tennesseehipaa.zoom.us/j/9492269658