public void calcSequences(BigLong2ShortHashMap hm, String fastaFP) throws FileNotFoundException {
        int freqThreshold = supergraphFreq.get();
        int lenThreshold = sequenceLen.get();
        int kValue = k.get();

        banKmers(hm, freqThreshold, kValue);

        int sequenceId = 0;

        ArrayList<Integer> sequenceLen = new ArrayList<Integer>();
        ArrayList<Long> sequenceWeight = new ArrayList<Long>();

        long kmersInSeq = 0;
        long totalKmersInSequences = 0;

        PrintWriter fastaPW = new PrintWriter(fastaFP);

        Iterator<MutableLongShortEntry> it = hm.entryIterator();
        while (it.hasNext()) {
            MutableLongShortEntry entry = it.next();
            long key = entry.getKey();
            int value = entry.getValue();
            if (value <= freqThreshold) {
                continue;
            }
            ShortKmer kmer = new ShortKmer(key, kValue);

            if (getLeftNucleotide(kmer, hm, freqThreshold) >= 0) {
                continue;
            }

            StringBuilder sequenceSB = new StringBuilder(kmer.toString());
            long seqWeight = 0, minWeight = value, maxWeight = value;

            while (true) {
                long kmerRepr = kmer.toLong();
                value = hm.getWithZero(kmerRepr);
                seqWeight += value;
                minWeight = Math.min(minWeight, value);
                maxWeight = Math.max(maxWeight, value);

                hm.put(kmerRepr, BAN_VALUE);

                byte rightNuc = getRightNucleotide(kmer, hm, freqThreshold);
                if (rightNuc < 0) {
                    break;
                }
                sequenceSB.append(DnaTools.toChar(rightNuc));
                kmer.shiftRight(rightNuc);
            }

            if (sequenceSB.length() >= lenThreshold) {
                sequenceId++;
                String sequenceStr = sequenceSB.toString();

                sequenceLen.add(sequenceStr.length());
                sequenceWeight.add(seqWeight);

                totalKmersInSequences += seqWeight;
                kmersInSeq += sequenceStr.length() - kValue + 1;

                String seqInfo = String.format(">%d length=%d sum_weight=%d min_weight=%d max_weight=%d",
                        sequenceId, sequenceStr.length(), seqWeight, minWeight, maxWeight);
                fastaPW.println(seqInfo);
                fastaPW.println(sequenceStr);

                if (sequenceId % 10000 == 0) {
                    debug("sequenceId = " + sequenceId + ", last len = " + sequenceStr.length());
                }
            }

        }
        info(sequenceId + " sequences found");
        info(kmersInSeq + " unique k-mers out of " + hm.size() + " in sequences");
        info("Total k-mers in sequences = " + totalKmersInSequences);
        info("N50 value of sequences = " + getN50(sequenceLen));

        dumpSeqInfo(sequenceLen, sequenceWeight, workDir + File.separator + "seq-info");

        fastaPW.close();
    }