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 Data from readANI_distribution plot #62

Open
elizabethmcd opened this issue Apr 22, 2021 · 2 comments
Open

Get Raw Data from readANI_distribution plot #62

elizabethmcd opened this issue Apr 22, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@elizabethmcd
Copy link

elizabethmcd commented Apr 22, 2021

I would like to get the raw data for ANI distributions of reads in the provided plot. I don't think this is accessible through the existing raw files that are outputted with the API. Is inStrain filtering the BAM file based on the PID flag with something like bedtools (I think that's how I've done it before)? I just want to parse the same information that is given in the readANI plot to do downstream things with the data for multiple samples to the same genome.

@MrOlm
Copy link
Owner

MrOlm commented Apr 22, 2021

Hello,

Yes, you're right that at the moment this information isn't accessible through the public API. The next big inStrain upgrade will be adding functionality to parse the raw_data to create tables like this on-demand, but unfortunatley that won't be ready for a while.

The information for this plot is generated using the function prepare_read_ani_dist_plot, in the file inStrain/plotting/mapping_plots.py (

def prepare_read_ani_dist_plot(IS):
)

The method takes in an inStrain profile object and loads the covT and scaffold2length objects from raw_data to create this information. You should be able to either import and call this method, or copy the code into a new python notebook and run it yourself. That said, I realize that this isn't a very straightforward process and I'm happy to help when you run into snags.

Best,
<att

@MrOlm MrOlm added the enhancement New feature or request label Apr 22, 2021
@elizabethmcd
Copy link
Author

Thanks! I will definitely try importing the method and see if I can get what I need from there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants