gf712 / abpytools Goto Github PK
View Code? Open in Web Editor NEWPython package for analysis of antibody heavy and light chains
Home Page: https://gf712.github.io/AbPyTools/
License: MIT License
Python package for analysis of antibody heavy and light chains
Home Page: https://gf712.github.io/AbPyTools/
License: MIT License
getting this error during install via pip or source:
ImportError: Failed to import test module: features_tests_composition
Traceback (most recent call last):
File "/home/misha/anaconda3/lib/python3.7/unittest/loader.py", line 154, in loadTestsFromName
module = import(module_name)
File "/home/misha/internship_code/AbPyTools/tests/features_tests_composition.py", line 2, in
from abpytools import ChainCollection
File "/home/misha/internship_code/AbPyTools/abpytools/init.py", line 1, in
from .core import *
File "/home/misha/internship_code/AbPyTools/abpytools/core/init.py", line 4, in
from .chain_collection import ChainCollection
File "/home/misha/internship_code/AbPyTools/abpytools/core/chain_collection.py", line 18, in
from .utils import (json_ChainCollection_formatter, pb2_ChainCollection_formatter, pb2_ChainCollection_parser,
File "/home/misha/internship_code/AbPyTools/abpytools/core/utils.py", line 1, in
from abpytools.core.formats.utils import get_protobuf_numbering_scheme, get_numbering_scheme_from_protobuf
File "/home/misha/internship_code/AbPyTools/abpytools/core/formats/init.py", line 1, in
from .chain_pb2 import Chain as ChainProto
ModuleNotFoundError: No module named 'abpytools.core.formats.chain_pb2'
File "/home/misha/anaconda3/lib/python3.6/site-packages/abpytools/core/chain.py", line 71, in load_from_string
new_chain.load()
File "/home/misha/anaconda3/lib/python3.6/site-packages/abpytools/core/chain.py", line 92, in load
self.load()
File "/home/misha/anaconda3/lib/python3.6/site-packages/abpytools/core/chain.py", line 101, in load
self.hydrophobicity_matrix = self.ab_hydrophobicity_matrix()
File "/home/misha/anaconda3/lib/python3.6/site-packages/abpytools/core/chain.py", line 217, in ab_hydrophobicity_matrix
sequence=self._sequence)
File "/home/misha/anaconda3/lib/python3.6/site-packages/abpytools/core/chain.py", line 434, in calculate_hydrophobicity_matrix
else 0 for x in whole_sequence])
File "/home/misha/anaconda3/lib/python3.6/site-packages/abpytools/core/chain.py", line 434, in <listcomp>
else 0 for x in whole_sequence])
KeyError: 'X'
We've got an error while stopping in post-mortem: <class 'KeyboardInterrupt'>
Error is thrown in code below:
def calculate_hydrophobicity_matrix(whole_sequence, numbering, aa_hydrophobicity_scores, sequence):
# instantiate numpy array (whole sequence includes all the amino acid positions of the VH/VL,
# even the ones
# that aren't occupied -> these will be filled with zeros
# hydrophobicity_matrix = np.zeros(len(whole_sequence))
# #
# # # iterate through each position
# for i, position in enumerate(whole_sequence):
#
# if position in numbering:
# position_in_data = numbering.index(position)
# hydrophobicity_matrix[i] = aa_hydrophobicity_scores[sequence[position_in_data]]
# return hydrophobicity_matrix
# same thing as above but in a comprehension list
return np.array([aa_hydrophobicity_scores[sequence[numbering.index(x)]] if x in numbering
else 0 for x in whole_sequence])
seems that your "comprehension list" approach contains a bug
I have next code:
for sequence_alignment in sequences:
chain = Chain.load_from_string(sequence=sequence_alignment)
cdrs = dict()
try:
for cdr_name, cdr_indexes in chain.cdr[0].items():
cdrs[cdr_name] = sequence_alignment[cdr_indexes[0]:(cdr_indexes[-1] + 1)]
except Exception as error:
time.sleep(0.1)
if chain.cdr == None:
print("ERROR::", error)
And sometimes it prints error, which indicates that cdrs not loaded, But I called the load function! Seems some concurrency issues in your lib.
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.