Skip to content

Small bugfix + Conda environment change for MacOS #2

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dgorhe
Copy link

@dgorhe dgorhe commented Mar 20, 2024

Hey there,

When trying out the example, I noticed that when I didn't specify savename in the arguments it gave me the following error:

Small bugfix

Traceback (most recent call last):
  File "/Users/darveshgorhe/tapioca/run_tapioca.py", line 165, in <module>
    main()
  File "/Users/darveshgorhe/tapioca/run_tapioca.py", line 140, in main
    if args.savename == None:
AttributeError: 'Namespace' object has no attribute 'savename'

The issue was that run_tapioca.py was trying to access an attribute of the Namespace object args. Since savename isn't specified, there is no attribute args.savename hence the AttributeError. To resolve this I converted args to a dictionary and just check for the key "savename". This seems to have resolved the issue and I could run the following without any errors

python run_tapioca.py -i example.csv -o test -r 1 -p 0 -c 0 -f 0 -t data/tissue_functional_networks/foo.txt

Conda environment

I wasn't able to build the conda environment from tapioca_env_mac.yml and I suspect it's because the build versions were specific to Intel-based Macs. I don't have an Intel-based Mac to test this hypothesis so I can't be 100% sure. However, I used conda-tree to find the minimal set of packages needed to make tapioca_env_mac.yml more cross-compatible. I kept the package versions but not the build versions and that seems to have resolved the issue. I tested the same command and it works:

python run_tapioca.py -i example.csv -o test -r 1 -p 0 -c 0 -f 0 -t data/tissue_functional_networks/foo.txt

I noticed some small numerical deviations when making these changes, but they seemed on the order of 1e-4 across the whole output. To test the magnitude of difference I did the following (pre is the example data provided and post represents the results after my changes):

pre = pd.read_csv("normalized_input/example_normalized.csv")
post = pd.read_csv("normalized_input/example_normalized_post.csv")
diff = post[post.columns[3:]].to_numpy() - pre[pre.columns[3:]].to_numpy()
print(np.nan_to_num(diff, 0).sum())

>>> -0.0006989117254324364

I suspect this is run to run variance, but if it seems unusual, I'm happy to investigate. Also, If someone could confirm that these changes are backwards-compatible and don't have side effects, that would be awesome. I figured using the example data was a good way to test, but I'm not sure if there's other more robust tests.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant