Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Running aviary directly from a git checkout #183

Closed
wwood opened this issue Dec 10, 2023 · 2 comments · Fixed by #184
Closed

Running aviary directly from a git checkout #183

wwood opened this issue Dec 10, 2023 · 2 comments · Fixed by #184

Comments

@wwood
Copy link
Collaborator

wwood commented Dec 10, 2023

Hey,

Maybe I'm reinventing the wheel here, but if I add this to the top of aviary/aviary.py

+import os
+import sys
+
+if __name__ == '__main__':
+    # Should only be here when not pip installed.
+    __version__ = 'dev'
+    # Put aviary first on the path to avoid Python choosing the wrong aviary
+    # import along the lines of
+    # https://stackoverflow.com/questions/54333865/python-no-module-named-error-package-is-not-a-package
+    sys.path = [os.path.dirname(os.path.realpath(__file__))+'/../'] + sys.path
+else:
+    from .__init__ import __version__

Then I can run it directly rather than having to run pip install -e . like so

~/git/aviary$ rm -rf assembly1.aviary_recover3; ~/git/aviary/aviary/aviary.py recover --coassemble -1 data1/SRR9330*_1.fastq.gz -2 data1/SRR9330*_2.fastq.gz -o assembly1.aviary_recover3 -t 64 --skip-binners maxbin2 concoct

Useful for debugging.

Happy to make a PR ofc.

Relatedly, is there a way to specify a target for the snakemake? When debugging or otherwise that would be useful so extraneous rules aren't run.

TIA.

@rhysnewell
Copy link
Owner

So the point of using pip install -e . is that the -e treats the current directory as the install directory. So you can make changes on the fly and they are automatically installed, which is very helpful for debugging. A normal aviary installation would just run pip install . or the pip package name or the conda install. I see the benefit of this, but I'm not in a rush to add it. So if you want to make a PR and can guarantee that it won't negatively impact the rest of the code base then I'm fine with it being added.

If you want to target a specific rule then there is the -w flag. You just add -w to your aviary command then a list of rules that you want to target and it will spin up an aviary run targeting each one specifically in order

@wwood wwood mentioned this issue Dec 11, 2023
@wwood
Copy link
Collaborator Author

wwood commented Dec 11, 2023

Figured I was missing something simple. The README does actually say what to do already, but I didn't pay enough attention.

Re -w I didn't see it because I was ctrl-f for snakemake and target, but neither picked up -w.

@AroneyS AroneyS closed this as completed Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants