NBISweden / aMeta

Ancient microbiome snakemake workflow
MIT License
19 stars 14 forks source link

MapDamage is not generating expected output #165

Open rozwalak opened 4 months ago

rozwalak commented 4 months ago

Hi, I was running aMeta on microbial and full databases, and in both cases pipeline was running generally smoothly. However, I noticed that MapDamage is not generating all expected files with visualisations etc.

The log for MapDamage is very long and beginning with:

[main_samview] region "AB790818.1" specifies an invalid region or unknown reference. Continue anyway. [main_samview] region "AB790819.1" specifies an invalid region or unknown reference. ...

Do you know what might be the reason for that? Did you notice this problem before?

LeandroRitter commented 4 months ago

Hi @rozwalak, could you let us know what expected output files of mapDamage are missing? Also, could you please provide the whole log-file?

rozwalak commented 4 months ago

Hi @LeandroRitter. In the test data, in the subfolder MAPDAMAGE/bar/632.tax.bam, I received a lot of different results including Length_plot.pdf and Fragmisincorporation_plot. However, in my real dataset, I didn't get these results. I have 57704.tax.bam.csi, 57704.seq_ids, 57704.bam, and a folder named 57704.tax.bam, but inside this folder, I only have Runtime_log.txt. The mapdamage rule executed properly in snakemake, without error.

When map damage plots are generated? Because I also have an error in the rule plot_authentication_score:

[1] 3 2 4 1 3 2 5 5 5 6 4 3 3 2 1 4 1 2 2 3 4 3 3 3 3 3 2 2 3 2 4 2 3 4 3 6 4 3 [39] 2 3 3 3 2 5 4 2 2 4 4 2 1 2 2 2 4 2 2 4 2 2 4 4 4 4 4 4 5 1 3 Error in if (dim(score_matrix)[1] > 1 & dim(score_matrix)[2] > 1) { : argument is of length zero Execution halted

In consequence, "all" rule is not executed, if the outputs for MapDamage are generated in the "all" rule, it may explain what happened. Additionally, it highlights my second problem with plot_authentication_score.

The log file is too large and lengthy to share here. I will send it to you on Slack.

LeandroRitter commented 2 months ago

Hi @rozwalak, apologies for my very late reply! I have reproduced the mapDamage issue (which seems to pop up only with full NT database used), and I am working on it, it will be fixed soon.

Regarding the plot_authentication_score rule, you seem to be running aMeta on only one sample, and there is a small bug in the plot_score.R script for the case of one sample. For now, you can use the plot_score.R that I enclose here, and replace the old aMeta/workflow/scripts/plot_score.R with this one, and restart aMeta. We will update the plot_score.R centrally on the github soon [Uploading plot_score.zip…]()