← Files Biological Sequence & Alignment ViewerARCHIVED FILE

src/msa/formats/aligned-fasta.ts

526 Bytes · Sep 30, 2026 · 23:01 UTC

↓ Download file

import type { MsaFormatDraft } from "../types";
import { parseFastaRecords } from "./fasta-records";

export function parseAlignedFasta(contents: string): MsaFormatDraft {
  const { records, warnings } = parseFastaRecords(contents);
  return {
    format: "aligned-fasta",
    rows: records.map((record) => ({
      alignedSequence: record.sequence,
      ...(record.description == null
        ? {}
        : { description: record.description }),
      id: record.id,
      label: record.label,
    })),
    warnings,
  };
}

SHA-256: c738399d84e87f51415e805d023189baccc49557b009e96fafab4ed8af9fe080