Hello- Before I reinvent the flat tyre I ask here...
Does anybody know of or have some Java code to make an index file for a fasta file? For "index fasta file" I mean the file produced by e.g. samtools faidx
and containing sequence length, byte positions of each sequence etc.
Ideally I'm looking for something working like this:
public static void Main(String[] args){
//Writes to disk index just like `samtools faidx sequences.fasta`:
new MakeFastaIndex("sequences.fasta")
}
I had a look at picard, biojava but couldn't find anything...
I would assume that there is something in htsjdk for this.
@devon I didn't find it.
What about "dict"?
'Dict' is for sequence dictionary. The structure of a dict is different from a faidx (it contains a SAM sequence header dictionary)
Ah, right. I'm a little surprised that this isn't in htsjdk, seems like a normal function for it to provide.