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

get_raw_coverage_table attribute #28

Open
elizabethmcd opened this issue Oct 23, 2020 · 1 comment
Open

get_raw_coverage_table attribute #28

elizabethmcd opened this issue Oct 23, 2020 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@elizabethmcd
Copy link

When trying to run the .get_raw_coverage_table attribute from the documentation, I get the following error:

Type "help", "copyright", "credits" or "license" for more information.
>>> import inStrain
>>> import inStrain.SNVprofile
>>> IS=inStrain.SNVprofile.SNVprofile("results/CAPIIB.IS/")
>>> coverage_table = IS.get_raw_coverage_table()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'SNVprofile' object has no attribute 'get_raw_coverage_table'

I looked in the SNVprofile.py script and couldn't find that attribute defined. The .get_nonredundant_scaffold_table method worked when I tried that.

@MrOlm
Copy link
Owner

MrOlm commented Oct 30, 2020

Hello,

I just looked into that and you are indeed correct, this method seems to have been deprecated several inStrain versions ago. I will add back this method in a more sensical way soon.

In the meantime you can access the raw coverage values by running IS.get('covT'). This will return a covT object, which is a goofy object that consists of a series of nested dictionaries. I can go into detail if you'd like, but if you'd just like an array of coverage values, you can run cov = inStrain.profile.profile_utilities.mm_counts_to_counts_shrunk(covT[scaff]) on your covT object, where scaff is the name of the scaffold you'd like the coverage for. This will return a pandas Series object where the index is the position on the scaffold (0-based), and the value is the coverage at that base. Positions with no coverage will not be in this object.

Hope that helps and sorry for the out-of-date docs!

-Matt

@MrOlm MrOlm added the documentation Improvements or additions to documentation label Oct 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants