Genotype API Documentation - v0.1.0
    Preparing search index...

    Function seqops

    • Factory function to create SeqOps pipeline

      Convenient function to start a sequence processing pipeline.

      Type Parameters

      Parameters

      • sequences: AsyncIterable<T>

        Input sequences

      Returns SeqOps<T>

      New SeqOps instance

      const result = await seqops(sequences)
      .seq({ minLength: 100 })
      .subseq({ region: "1:500" })
      .writeFasta('output.fasta');
    Index

    Methods

    Methods

    • Create SeqOps pipeline from array of sequences

      Convenient method to convert arrays to SeqOps pipelines. Most common use case for examples and small datasets.

      Type Parameters

      Parameters

      • sequences: T[]

        Array of sequences

      Returns SeqOps<T>

      New SeqOps instance

      const sequences = [
      { id: 'seq1', sequence: 'ATCG', length: 4 },
      { id: 'seq2', sequence: 'GCTA', length: 4 }
      ];

      const result = await seqops.from(sequences)
      .translate()
      .writeFasta('proteins.fasta');
    • Concatenate multiple sequence files into a single pipeline

      Static factory function that creates a SeqOps pipeline from multiple files. Elegant API for combining sequence sources with simple duplicate handling.

      Parameters

      • filePaths: string[]

        Array of file paths to concatenate

      • handleDuplicateIds: "ignore" | "suffix" = "ignore"

        How to handle duplicate IDs: 'suffix' | 'ignore' (default: 'ignore')

      Returns SeqOps<FastaSequence>

      New SeqOps instance for chaining

      // Simple concatenation
      const combined = seqops.concat(['file1.fasta', 'file2.fasta']);

      // With duplicate ID suffixing
      const merged = seqops.concat(['db1.fa', 'db2.fa'], 'suffix')
      .filter({ minLength: 100 })
      .writeFasta('combined.fa');