When a sample has a control sample is not NA, then Fonda runs paired mode analysis for this sample. Some of the tools (e.g Vardict) use the control bam for variant detection when they perform sample analysis. If the control sample script is executed before sample bam is required in the script of the "original" sample, the tool (e.g Vardict) will crash with the error that the control bam does not exist, because it has been deleted at the end of the control sample script.
Approach
I assume that it would be better to move the removal of all bams in the "original" sample script.
Background
When a sample has a control sample is not NA, then Fonda runs paired mode analysis for this sample. Some of the tools (e.g Vardict) use the control bam for variant detection when they perform sample analysis. If the control sample script is executed before sample bam is required in the script of the "original" sample, the tool (e.g Vardict) will crash with the error that the control bam does not exist, because it has been deleted at the end of the control sample script.
Approach
I assume that it would be better to move the removal of all bams in the "original" sample script.