eblerjana / pangenie

Pangenome-based genome inference
MIT License
114 stars 10 forks source link

How is Jellyfish database in jf format created for PanGenie? #11

Open jjfarrell opened 2 years ago

jjfarrell commented 2 years ago

The PanGenie command line help indicates that a jellyfish database in jf format is an option for input.

-i VAL sequencing reads in FASTA/FASTQ format or Jellyfish database in jf format. NOTE: INPUT FASTA/Q FILE MUST NOT BE COMPRESSED. (required).

What is the recommended JellyFish command for creating the jf file? How does the jf formated file compare in size to the uncompressed fasta or fastq file?

eblerjana commented 2 years ago

For k-mer counting with jellyfish, PanGenie per default uses a kmer size of 31, a hash size of 3,000,000,000, a counter length of 7, the maximum number of reprobes is 126 and kmers are represented in canonical representation. Also, PanGenie counts only kmers present in the graph it internally generates from the VCF. So I think running jellyfish like shown below should give the same results for kmer counting:

jellyfish count -m 31 -s 3G -p 126 -c 7 -C -L 1 --if <path-segments.fasta> <input.fasta>

Here, "path-segments.fasta" is a file PanGenie produces for its k-mer counting (output as <prefix>_path-segments.fasta when running PanGenie). It contains all sequences present in the graph. At some point I have implemented the command

PanGenie-graph -r <reference.fa> -v <variants.vcf> -o <output-prefix>

which can be used to generate this file only (instead of running the whole kmer counting and genotyping). So you can try running this first to generate the file containing all graph sequences, and then run jellyfish using the result for parameter --if.

So far, I always directly used the reads as input to PanGenie instead of generating the jf file first, so unfortunately, I never compared sizes of jf/fastq files. What I have done in the past in order to reduce reads in fastq format, is to convert it to fasta (without qualities), as PanGenie does not use any base quality information.