aliyoussef96 / bcaw-tool Goto Github PK
View Code? Open in Web Editor NEWBCAWT: Automated tool for codon usage bias analysis for molecular evolution
License: MIT License
BCAWT: Automated tool for codon usage bias analysis for molecular evolution
License: MIT License
Currently, the README lists the packages that are required to use BCAW. To make installation easier, would it be possible to make BCAW use a setup.py
file?
This repo has a really good example you can add to your repo. All you'd need to do is fill out the metadata at the top of the file.
Using a setup.py
has another advantage: you can upload it to PyPI so anyone can pip install
it!
The arguments for BCAW
seem like they could be simplified:
BCAW-Tool/Source Code/BCAWT.py
Line 8 in e7c1498
For example, would it be possible to have input_the_main_fasta_file
(which is a long variable name, by the way) be either a single FASTA file or a list of FASTA files? That would allow you to eliminate the need for a text file option. Additionally, would it be possible to make the input file argument accept a file-like object (such as how Biopython does it for FASTA files) as well a string of the file's path?
You may also be interested in using pathlib (part of the standard library) to make handling file paths a bit easier.
In this line, you're trying to get the codons in the sequence.:
BCAW-Tool/Source Code/ATCG3.py
Line 27 in e7c1498
While this is correct, it might not be the best way to do it. First of all, re
adds a lot of overhead. Moreover, it returns a list, meaning that you have to load the whole sequence into memory, even though you're only using one codon at a time.
I suggest using a generator expression like this:
codon = (sequ[i: i+3] for i in range(0, len(sequ), 3))
It's also much more performant, as can be seen in this example notebook.
Per the JOSS review checklist, this project needs automated tests.
Although you can use whichever system for testing you prefer, if you're unsure where to start, I'd recommend pytest. It would also be a good idea to automate testing using something like Travis but, again, there are a variety of choices.
I think it has to do with the fact that you're checking if the user is on Windows or Linux, which results in the unbound variable when on Mac.
~ ❯❯❯ python test.py (bcaw)
Traceback (most recent call last):
File "test.py", line 2, in <module>
BCAWT.BCAW(['Ecoli.fasta'],'result_folder',genetic_code_=11,Auto=True)
File "/usr/local/Caskroom/miniconda/base/envs/bcaw/lib/python3.7/site-packages/BCAWT/BCAWT.py", line 106, in BCAW
if os.path.exists(directory) == False:
UnboundLocalError: local variable 'directory' referenced before assignment
~ ❯❯❯ ipython (bcaw)
Python 3.7.3 (default, Apr 13 2019, 18:43:32)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.6.1 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import platform
In [2]: platform.system()
Out[2]: 'Darwin'
Dear Ali,
I am trying to get working the BCAW tool in my Jupyter notebook and keep on receiving this message:
ImportError Traceback (most recent call last)
in
----> 1 BCAWT.BCAW("Ecoli.fasta", "Users\Radka\Documents\PrFJcU", "result", genetic_code_=1, Auto = True)
~\anaconda3\lib\site-packages\BCAWT\BCAWT.py in BCAW(main_fasta_file, save_path, ref_fasta_file, genetic_code_, Auto)
30 import Bio
31 from Bio import SeqIO
---> 32 from Bio.Alphabet import IUPAC
33 from Bio.Seq import Seq
34 from Bio.SeqUtils import GC
~\anaconda3\lib\site-packages\Bio\Alphabet_init_.py in
18 """
19
---> 20 raise ImportError(
21 "Bio.Alphabet has been removed from Biopython. In many cases, the alphabet can simply be ignored and removed from scripts. In a few cases, you may need to specify the molecule_type
as an annotation on a SeqRecord for your script to work correctly. Please see https://biopython.org/wiki/Alphabet for more information."
22 )
Unfortunately, i cannot get working the GUI neither.
thanks for your help
Radka
[email protected]
The most recent proof does not have references rendered at the bottom. I'm not sure of the cause of the error (maybe @arfon or @mgymrek can help out), but we'll need to fix it before we publish the paper.
Hi, I got an error "KeyError:'X'" when I run auto_test on the homepage.
Here is what the error show:
Traceback (most recent call last):
File "C:\Users\LiYU\PycharmProjects\pythonProject\CDS\BCAWT_test\BCAWT_test.py", line 4, in
BCAWT_auto_test.auto_test(path, test_fasta)
File "C:\Users\LiYU\AppData\Local\Programs\Python\Python38\lib\site-packages\BCAWT\BCAWT_auto_test.py", line 24, in auto_test
BCAWT.BCAW(main_fasta_file = [file] , save_path= path, Auto=True)
File "C:\Users\LiYU\AppData\Local\Programs\Python\Python38\lib\site-packages\BCAWT\BCAWT.py", line 238, in BCAW
df_ATCG["GRAVY"] = GRAVY_AROMO.GRAvy_ARomo(seq_main.seq, genetic_code_, G=True)
File "C:\Users\LiYU\AppData\Local\Programs\Python\Python38\lib\site-packages\BCAWT\GRAVY_AROMO.py", line 36, in GRAvy_ARomo
gravy = protein_seq.gravy()
File "C:\Users\LiYU\AppData\Local\Programs\Python\Python38\lib\site-packages\Bio\SeqUtils\ProtParam.py", line 164, in gravy
total_gravy = sum(ProtParamData.kd[aa] for aa in self.sequence)
File "C:\Users\LiYU\AppData\Local\Programs\Python\Python38\lib\site-packages\Bio\SeqUtils\ProtParam.py", line 164, in
total_gravy = sum(ProtParamData.kd[aa] for aa in self.sequence)
KeyError: 'X'
Could you tell me how to fix it? I'm new to here.
While the import for Biopython is bio
, the PyPI identifier for it is biopython
:
https://github.com/biopython/biopython#for-the-impatient
Line 24 in 9030aca
This project should have API docs. I'd recommend using Sphinx and deploying on Read The Docs, but there are a variety of options. Here's a good site with information about how to write docs.
pip install BCAWT
Defaulting to user installation because normal site-packages is not writeable
Collecting BCAWT
Using cached BCAWT-1.0.6.tar.gz (20 kB)
Preparing metadata (setup.py) ... done
Collecting CAI
Using cached CAI-1.0.3.tar.gz (6.0 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [7 lines of output]
/usr/lib/python3/dist-packages/pkg_resources/init.py:116: PkgResourcesDeprecationWarning: 1.1build1 is an invalid version and will not be supported in a future release
warnings.warn(
/usr/lib/python3/dist-packages/pkg_resources/init.py:116: PkgResourcesDeprecationWarning: 0.1.43ubuntu1 is an invalid version and will not be supported in a future release
warnings.warn(
/usr/lib/python3/dist-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
warnings.warn(
error in CAI setup command: use_2to3 is invalid.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
I suggest creating a directory to store test.py and any associated content needed for testing (such as Ecoli.fasta) to keep the main directory clean.
PDFs are generally less usable than editable text-based files. Additionally, the information contained in Introduction to codon usage bias.pdf
would be useful to have directly in the docs.
Would it be possible to covert the PDF to RST (possibly using pandoc on the source file) and put it on the docs website?
JOSS requires a project to have community guidelines. This should be a file called CONTRIBUTING
with information on how to contribute, report issues or problems with the software, and seek support.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.