bcgsc / biobloom

Create Bloom filters for a given reference and then use it to categorize sequences
http://www.bcgsc.ca/platform/bioinfo/software/biobloomtools
GNU General Public License v3.0
75 stars 15 forks source link

paired end mode not working? #36

Closed aldertzomer closed 5 years ago

aldertzomer commented 5 years ago

Hi, I'm trying to use your software as described in the example with paired end fq reads:

biobloomcategorizer --fq -e -p test123 -f "mg1655.bf" 18072D-01-03_S71_L006_R1_001_val_1.fq.gz 18072D-01-03_S71_L006_R2_001_val_2.fq.gz -t 16

However then the program just tells me I'm doing something wrong. Without -e option it works, however then I get the matching/non-matching reads in one file, non-interleaved, which is not what I want. I assume paired end information is not used. Is there a bug somewhere that keeps biobloomcategorizer from recognizing 2 files as paired end reads when using the -e option?

JustinChu commented 5 years ago

Sounds like it could be a bug. What is the error message you get from the -e option? What happens when you try inputting 1 file with the -e option? If it is working correctly it should output an error message in that case, but not when 2 files are listed.

-e should produce 2 files (with a _1.fq and _2.fq suffix) (non-interleaved). You are right about how paired end information is not used when -e is not used.

It could be helpful for me it you show me the --version output as well.

aldertzomer commented 5 years ago

Error message with option -e:

Input: biobloomcategorizer --fq -e -p test -f /mnt/data/klif/svermeulen/Scripts_test/BioBloomTools/database/test_db.bf S70_R1.fastq.gz S70_R2.fastq.gz

Output: Usage of paired end mode: BioBloomCategorizer [OPTION]... -f "[FILTER1]..." [FILEPAIR1] [FILEPAIR2] or BioBloomCategorizer [OPTION]... -f "[FILTER1]..." [SMARTPAIR]

No error message with option -e and 1 file

biobloomcategorizer --fq -e -p test -f /mnt/data/klif/svermeulen/Scripts_test/BioBloomTools/database/test_db.bf S70_R1.fastq.gz

Output: Starting to Load Filters. Loaded Filter: test_db Filter Loading Complete. Filtering Start File written to: test_test_db_1. File written to: test_test_db_2. File written to: test_noMatch_1. File written to: test_noMatch_2. File written to: test_multiMatch_1. File written to: test_multiMatch_2. Total Reads:121994 Writing file: test_summary.tsv

--version output: biobloomcategorizer (BIOBLOOMTOOLS) 2.1.2-2-g0703

aldertzomer commented 5 years ago

To add, it works with interleaved files (although the reverse read of the pair gets placed in the forward (_1) file and the forward read gets placed in the reverse (_2) file

JustinChu commented 5 years ago

Thanks for the report. I've found the bug and it will be fixed soon. The smart pairing option is assigning the (_1) and (_2) arititrarally based on which it sees first. I agree that the order should be changed though and I will change that as well.

JustinChu commented 5 years ago

The bug should be fixed in the lastest version of the master branch 8a47ccb1e55d4adf7086abeed245a08feefebe17.

Sorry for the problem, turns out the new smart pairing code was the cause of the issue. When only one file is listed there should indeed be no error.

Thanks again.

aldertzomer commented 5 years ago

It works pefectly! Thank you very much. We can now screen our metagenomics for contaminating ( in our case non-human) host DNA in minutes.

JustinChu commented 5 years ago

Great I'll make sure the fix is present in the release version of 2.1.2.

JustinChu commented 5 years ago

Sorry I didn't realize this until now but the files should have extensions on them for .fq or .fa.

I've pushed a fix for this on the main branch. Minor issue, the output should still have been .fq by default if you used the output options.