[Biojava-dev] List vs LinkedHashMap

Scooter Willis HWillis at scripps.edu
Fri Feb 19 19:30:13 UTC 2010


I am starting to use the new FastaReader in a project and the default implementation I setup returns a List<ProteinSequence>. The very next thing I needed to do was convert to a LinkedHashMap<String,ProteinSequence> so I could query the sequence of interest. It would seem that this is probably a fairly standard use case. If I returned a LinkedHashMap<String,ProteinSequence> as the default container then we have a slight memory hit on keeping a hash of the accession ID and a linked list for preserving order. 

Does anyone have objections to returning the sequences read from a Fasta file as a LinkedHashMap?

Thanks

Scooter



More information about the biojava-dev mailing list