merenlab / anvio

An analysis and visualization platform for 'omics data
http://merenlab.org/software/anvio
GNU General Public License v3.0
433 stars 144 forks source link

[BUG] Issue with --pre-computed-inversions #2161

Closed FlorianTrigodet closed 10 months ago

FlorianTrigodet commented 11 months ago

Short description of the problem

anvi-report-inversions --pre-computed-inversions does not work if you don't have associated bams and profiles. But they are not needed to recompute activity.

anvi'o version

anvio dev version.

Detailed description of the issue

The command anvi-report-inversions has a flag --pre-computed-inversions which allow user to use a precomputed inversions summary and only run the activity part of the code which uses R1 and R2 short reads.

For instance I ran the code using a first set of sample and I want to use --pre-computed-inversions using another set of samples, but I don't have bams and profiles associated with these samples. And I don't want to make them: they are not needed to compute the activity.

Then I get an error saying that my bam and profile.db are (of course) missing from my bams-and-profiles.txt

I am not sure what is the best thing to do here. Should the code skip checking for bam and profiles, should the user just not fill the bam and profile column of the bams-and-profiles.txt. SHOULD WE CHANGE THE ENTIRE CODE and put the path to R1 an R2 in a samples.txt???

Any input is welcome :D

FlorianTrigodet commented 10 months ago

As per request, here is a small test case:

TEST_PRE_COMPUTED_INV.tar.gz

In this directory, you will find two bams-and-profiles-txt: the "initial" one was used to generated the inversions summary, and can be used with the flag --pre-computed-inversions just fine (btw, it does not generate the index.html):

anvi-report-inversions --pre-computed-inversions 05_INVERSIONS/INVERSIONS-CONSENSUS.txt -P bams-and-profiles-initial.txt -o INV_OUTPUT_1

And there is another bams-and-profiles-txt called bams-and-profiles-pre-computed-inv.txt which contains a new sample that was not mapped and profiled, but it has a R1 and R2 which should be enough to use --pre-computed-inversions.

anvi-report-inversions --pre-computed-inversions 05_INVERSIONS/INVERSIONS-CONSENSUS.txt -P bams-and-profiles-pre-computed-inv.txt -o INV_OUTPUT_2
meren commented 10 months ago

2174 closed this issue, but please triple check and test, @FlorianTrigodet :)