Skip to content

small number of reads / no aberrant reads triggers exception in chrom_diff.r #92

@GWarsow

Description

@GWarsow

chrom_diff.r is called in bwaMemSortSlim.sh via

${RSCRIPT_BINARY} ${TOOL_PLOT_DIFFCHROM} -i "$FILENAME_DIFFCHROM_MATRIX" -s "$FILENAME_DIFFCHROM_STATISTICS" -o "${FILENAME_DIFFCHROM_PLOT}_temp" && mv ${FILENAME_DIFFCHROM_PLOT}_temp ${FILENAME_DIFFCHROM_PLOT} || ( echo "Error from chrom_diff.r" && exit 23)

The paramter -i "$FILENAME_DIFFCHROM_MATRIX" tells the R script to use the content of the file FILENAME_DIFFCHROM_MATRIX (*_DiffChroms.txt), which is generated by TOOL_COMBINED_BAM_ANALYSIS (flags_isizes_PEaberrations.pl):

(${PERL_BINARY} ${TOOL_COMBINED_BAM_ANALYSIS} -i ${NP_COMBINEDANALYSIS_IN} -a ${FILENAME_DIFFCHROM_MATRIX}.tmp -c ${CHROM_SIZES_FILE} -b ${FILENAME_ISIZES_MATRIX}.tmp -f ${FILENAME_EXTENDED_FLAGSTATS}.tmp -m ${FILENAME_ISIZES_STATISTICS}.tmp -o ${FILENAME_DIFFCHROM_STATISTICS}.tmp -p ${INSERT_SIZE_LIMIT} ) & procIDCBA=$!

FILENAME_DIFFCHROM_MATRIX shall contain a matrix. However, in flags_isizes_PEaberrations.pl, if no aberrant read could be identified (which can happen easily if the number of reads is small), only "NA" is written instead of the matrix.

This causes an exception, when chrom_diff.r tries to use the content of FILENAME_DIFFCHROM_MATRIX to do

for(i in 1:nrow(data)){
v[i] <- sum(data[i,])
}
(data contains the content of FILENAME_DIFFCHROM_MATRIX)

The exception which is thrown is:

Error in FUN(X[[i]], ...) : 
  only defined on a data frame with all numeric variables

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions