if(!sam){
if(!is.null(fastqFiles2)){
paired=TRUE
} else{
paired=FALSE
}
sam1 <- bowtie2(fastqFiles1, index1prefix, if(paired){fastqFiles2}, discordant=TRUE, appendIndexToName=TRUE, reorder=TRUE, threads=threads )
sam2 <- bowtie2(fastqFiles1, index2prefix, if(paired){fastqFiles2}, discordant=TRUE, appendIndexToName=TRUE, reorder=TRUE, threads=threads )
}
I course of resolving #1 I simply copied the code for the function into my script and loaded
conifur,gyro,convergeandtravismanually in addition. However, when using single-end files the function throws an error resulting from the undefined variablepairedwhen calling bowtie2 in line 88. This is due to the fact that iffastqFiles2is not given (henceNULL) the preceeding if statement is not called and paired is not set. Puttingreolves the problem