Téo Lemane

Paul Medvedev

Rayan Chikhi

Pierre Peterlongo
email: pierre.peterlongo@inria.fr

kmtricks: Efficient construction of Bloom filters for large sequencing data collections

When indexing large collection of sequencing data, a common operation that has now been implemented in several tools (Sequence Bloom Trees and variants, BIGSI, ..) is to construct a collection of Bloom filters, one per sample. Each Bloom filter is used to represent a set of k-mers which approximates the desired set of all the non-erroneous k-mers present in the sample. However, this approximation is imperfect, especially in the case of metagenomics data. Erroneous but abundant k-mers are wrongly included, and non-erroneous but low-abundant ones are wrongly discarded. We propose kmtricks, a novel approach for generating Bloom filters from terabase-sized collections of sequencing data. Our main contributions are 1/ an efficient method for jointly counting k-mers across multiple samples, including a streamlined Bloom filter construction by directly counting hashes instead of k-mers; 2/ a novel technique that takes advantage of joint counting to preserve low-abundant k-mers present in several samples, improving the recovery of non-erroneous k-mers. In addition, our experimental results highlight that the usual yet crude filtering of low-abundant k-mers is inappropriate for complex data such as metagenomes.

Introduction

Consortia such as the 100,000 Genomes Project [START_REF] Turnbull | The 100 000 genomes project: bringing whole genome sequencing to the nhs[END_REF], GEUVADIS [START_REF] Lappalainen | Transcriptome and genome sequencing uncovers functional variation in humans[END_REF], MetaSub [START_REF] Mason | The Metagenomics and Metadesign of the Subways and Urban Biomes (MetaSUB) International Consortium inaugural meeting report[END_REF] and Tara Ocean [START_REF] Karsenti | A holistic approach to marine eco-systems biology[END_REF] have generated large collections of genomic, transcriptomic, and metagenomic sequencing data, respectively. Rather than deep coverage of a single sample, such datasets contain a collection of sequencing experiments across many samples. For example, the Tara Ocean project generated metagenomic sequencing data across ecological niches all over the oceans, totalling at least 171 thousand billions of nucleotides. Such valuables resources are unfortunately difficult to comprehensively analyze, since their size makes bioinformatics analyses difficult.

Traditional sequence analyses such as alignment to a reference database or de novo assembly are both difficult and limited in the results they yield. For instance, metagenome assembly of individual samples (e.g. using MetaSPAdes [START_REF] Nurk | MetaSPAdes: A new versatile metagenomic assembler[END_REF]) is often not able to reconstruct low abundance genomes and tends to collapse variants between close strains. Co-assembly of multiple samples pools together coverage from multiple sites to alleviate this but results in further loss in strain specificity. Alternatively, aligning raw sequencing data to genome databases is hindered by the incompleteness of those databases.

A recently proposed alternative is to build an index of the raw sequencing data and then later query sequences of interest, e.g. genes or shorter sequence fragments around variants such as SNPs or indels. Traditional indexing approaches, such as those used by BLAST [START_REF] Altschul | Basic local alignment search tool[END_REF] or DIAMOND [START_REF] Buchfink | Fast and sensitive protein alignment using diamond[END_REF], do not scale to those large collections [START_REF] Marchet | Data structures based on k-mers for querying large collections of sequencing data sets[END_REF]. Instead, customized indexing methods have been under development. A recent review surveyed 20 tools that were all published in the last couple years, aiming to index large collections of sequencing data [START_REF] Marchet | Data structures based on k-mers for querying large collections of sequencing data sets[END_REF], for example BIGSI [START_REF] Bradley | Ultrafast search of all deposited bacterial and viral genomic data[END_REF], HowDe-SBT [START_REF] Harris | Improved representation of sequence Bloom trees[END_REF], and Mantis [START_REF] Pandey | Mantis: A Fast, Small, and Exact Large-Scale Sequence-Search Index[END_REF]. These indexes are typically able to answer whether an arbitrary fixed-length sequence (k-mer) belongs to any of the samples, and, if so, which ones. Though much progress has been made, indexing a collection such as Tara Ocean has remained out of practical reach.

The vast majority of these large-scale k-mer indexing tools are based on common building blocks, three of them being: 1) k-mer counting, which summarizes sequencing data into a set of k-mers along with their abundances, 2), k-mer matrix construction, which aggregates lists of k-mer counts over a collection of samples (e.g. as in [START_REF] Marchet | Reindeer: efficient indexing of k-mer presence and abundance in sequencing datasets[END_REF]; [START_REF] Muggli | Building large updatable colored de bruijn graphs via merging[END_REF]) in the form of a k-mer/sample matrix with abundances as values, and 3) Bloom filters construction, where the k-mer presence/absence information for each sample is converted into a Bloom 1 filter to save space and allow fast queries. Note that these building blocks are not specific to k-mer indexing tools, e.g. 1) and 3) are commonly used in short-read de novo assembly, and 2) also appears in transcriptomics analysis [START_REF] Audoux | De-kupl: exhaustive capture of biological variation in rna-seq data through k-mer decomposition[END_REF].

Importantly, these three steps are often categorized as "pre-processing" in k-mer indexing papers (e.g. [START_REF] Pandey | Mantis: A Fast, Small, and Exact Large-Scale Sequence-Search Index[END_REF][START_REF] Harris | Improved representation of sequence Bloom trees[END_REF]) and discounted from the running time of these indexing tools. Yet, for a dataset like Tara Oceans, these steps dwarf the running time of the subsequent index construction by up to several orders of magnitude. Although construction only needs to be done once per collection, its prohibitive running time for large collections represents an important roadblock to the usability of the tools.

In addition to the inefficiency of construction methods, sequencing errors are also dealt with sub-optimally. Even though contemporary sequencing error rates are low (0.1-1%), a vast amount of k-mers present in raw data contain sequencing errors and should be discarded during indexing. There are many read error-correction tools [START_REF] Song | Rcorrector: efficient and accurate error correction for illumina rna-seq reads[END_REF], however, they are not a viable option for metagenomics (and RNA-seq) due to the presence of low-abundance genomes and the limited availability of reference genomes. Current approaches therefore filter out k-mers solely by checking if their abundance is below a pre-set threshold. This has the unsatisfactory drawbacks of being either too conservative (discarding all low-abundant genome data if the threshold is set too high), or too permissive (too many erroneous k-mers are kept if the threshold is set too low). In this paper, we will propose an improved method for filtering out erroneous k-mers.

Here we propose an improved algorithm for this construction step that improves both its efficiency and the ability to correct errors. Current tools take a modular approach. They first use an off-the-shelf k-mer counting tool separately for each sample, and then construct a Bloom filter from the k-mers in that sample. We observe in this paper that this modular approach has several drawbacks. First, it prevents fine-grain optimizations that can be obtained by integrating these steps. Second, it prevents efficient data lookups such as being able to identify all the samples to which a given k-mer belongs. As we will show, such lookups can help improve errorcorrection for these samples. In summary, by limiting themselves to a modular approach, current tools leave both significant speed-up and joint filtering opportunities on the table. Given the maturity and abundance of Bloom filter-based indexing tools, as well as a plateau in performance improvement of k-mer counting tools [START_REF] Kokot | KMC 3: counting and manipulating k-mer statistics[END_REF], we believe that designing better construction algorithms through integration is an important research task.

Our method for constructing k-mer matrices and Bloom filters is based on a partitioned k-mer counting procedure carefully optimized for joint multi-sample counting. The main novelty is the combination of three relatively straightforward contributions that together address the issues of long running times and sub-optimal k-mers filtering. 1) We introduce a procedure for rescuing low-abundance k-mers at the heart of the joint multi-sample k-mer counting procedure. This enables more sensitive results yet discarding truly erroneous k-mers, saving the prohibitive indexing of all (vastly erroneous) k-mers. We show that joint k-mer counting is more powerful than performing one-sample k-mer counting over a metagenomics collection. 2) We introduce the concept of hash counting that enables direct construction of Bloom filters indices without resorting to k-mers, saving significant time and space. 3) We incorporate for the first time existing efficient matrix transposition techniques in such a workflow, to efficiently output Bloom filter rows directly from partitioned intermediate data, saving intermediate disk space during joint multi-sample counting.

Using our workflow, we perform for the first time a massive-scale joint k-mer counting and Bloom filter construction of a 6.5 terabase metagenomics collection, in under 50 hours and 50 GB of memory, which is 3.5 times faster than the next best alternative.

Related works

KMC [START_REF] Kokot | KMC 3: counting and manipulating k-mer statistics[END_REF] and DSK [START_REF] Rizk | DSK: k-mer counting with very low memory usage[END_REF] are two disk-based k-mer counting tools. Counting k-mers is an operation that identifies the set of k-mers present within one (or multiple) datasets and records the abundance of each k-mer. Intuitively, k-mers having a low abundance (i.e. seen few times) are more likely to be the result of one or multiple sequencing errors within reads, while k-mers above a certain abundance threshold are more likely to be correct.

In its original publication, DSK directly stored k-mers in a hash table by carefully controlling for memory and disk usage using partitioning. Recent versions of KMC and DSK are based on variants of an algorithm introduced by MSPKmerCounter [START_REF] Li | Mspkmercounter: a fast and memory efficient approach for k-mer counting[END_REF] subsequently made popular by KMC. In a nutshell, sequencing reads are split into partitions stored on disk, then each partition is loaded in memory and k-mers are counted within them. Partitions are constructed in such a way that all occurrences of a k-mer appear within a single partition, and also, overlapping k-mers are attempted to be stored as longer sequences to avoid redundancy. These properties are achieved using the concepts of minimizers and super-k-mers that we will review in the Methods section, and the concept of (k + x)-mers that we will not use here.

kmc_tools is a binary tool included in KMC for manipulation of its results files, which can perform e.g. set operations on list of k-mers, such as intersection, union, or more complex ones. However, to the best of our knowledge kmc_tools does not support collections of k-mer lists (i.e. k-mer matrices) and is therefore not applicable to the work presented here.

Jellyfish [START_REF] Marçais | A fast, lock-free approach for efficient parallel counting of occurrences of k-mers[END_REF]) is an in-memory k-mer counting tool that relies on an optimized hash table. One of its key advantages, besides efficiency, is that as a byproduct it constructs a k-mer dictionary: i.e. a data structure that can efficiently associate values to k-mers and supports efficient queries. Jellyfish was notably used to perform kmer counting in HowDe-SBT. However, its key-value store feature was not used. Several other k-mer counting tools exist, however a recent benchmark [START_REF] Manekar | A benchmark study of k-mer counting methods for high-throughput sequencing[END_REF] determined that KMC 3 is one of the most efficient ones on a single node.

Simka [START_REF] Benoit | Multiple comparative metagenomics using multiset k-mer counting[END_REF] is a multi-sample k-mer counting and k-mer matrices construction tool that was used for metagenomics. It is based on a variation of the original DSK algorithm, modified to run on a distributed cluster.

HowDe-SBT [START_REF] Harris | Improved representation of sequence Bloom trees[END_REF]) is a k-mer indexing method for large sequencing data collections, that extends the original concept of Sequence Bloom Trees (SBT) [START_REF] Solomon | Fast search of thousands of short-read sequencing experiments[END_REF]. In a nutshell, HowDe-SBT (and in general, any SBT-based method) indexes each sample using a Bloom filter and organizes filters inside a binary tree for performing queries efficiently. HowDe-SBT is the most efficient variant of SBTs to date, showing fast construction and query times, yet requires an expensive pre-processing step. Precisely, the pre-processing step consists in generating from a set of samples, one Bloom filter per sample. Each Bloom filter indexes the k-mers considered as not erroneous contained in its corresponding set. This requires to perform a time-consuming k-mer counting process for each data set.

BIGSI [START_REF] Bradley | Ultrafast search of all deposited bacterial and viral genomic data[END_REF] and COBS [START_REF] Bingmann | COBS: a Compact Bit-Sliced Signature Index[END_REF] are k-mer indexing methods which also use Bloom filters, however organized in a different layout than in the SBT family. These tools represent all Bloom filters of indexed samples in a flat manner, in a way that limits cache (1) Counting: Minimizer repartition is determined by sub-sampling D 1 and D 2 and super-k-mers are then dumped on disk according to this partitioning. Each partition is then counted with the possibility to see each element as a k-mer or as its hash value. In both modes, counted partitions may be optionally dumped to disk. In hash mode specifically, for each partition a bit-vector can be output directly ( symbol).

(2) Merging: Counted k-mers or hashes from equivalent partitions are aggregated. Different kind of matrices can be obtained: a count matrix (in ASCII or binary format), a presence/absence matrix (each row represents a k-mer or a hash value associated with a presence/absence bit-vector), and, only in hash mode, a vector of Bloom filters (i.e. a matrix of presence/absence bit-vectors, where row indices represent hashes). All these matrices can be filtered using a k-mer rescue procedure described in 4.3. In hash mode, in order to obtain samples in rows and then build Bloom filters, each partition-specific sub-matrix can be transposed.

(3) Bloom filter outputs: a Bloom filter is built for each sample through concatenation of transposed sub-matrices (in those, each row corresponds to a sample). Bloom filters can be also obtained from first counting step if aggregation is not required. In this case, this corresponds to a concatenation of bit-vectors from (1) in hash mode without k-mer rescue. misses during query. This flat structure however does not enable to reduce redundancy between samples.

Results

kmtricks: A modular pipeline and library for construction k-mer matrices and Bloom filters on large datasets

In this section we give an overview of our software kmtricks (for "kmer matrix tricks"). A more in-depth presentation and algorithmic details are provided Section 4. Essentially, kmtricks is a set of software components that together perform joint multi-sample k-mer counting and color matrix construction. This allows to efficiently construct the data structures (e.g. Bloom filters) needed for indexing terabase-scale collections of samples.

The components of kmtricks, along with an example execution, are presented in Fig. 1. We highlight the following features which differentiates kmtricks from related works:

• Joint k-mer counting allows to rescue large amounts of k-mers that would otherwise be discarded when processing samples independently. • Direct counting of k-mer hash values instead of counting k-mers saves significant time for subsequent Bloom filter construction. • kmtricks has been designed to be a stand-alone pipeline (Fig. 1), yet it is composed of modular tools (described in Section 4) which are of independent interest: partitioning a set of k-mers (according to their minimizer), jointly count k-mers, construct k-mer matrices, transpose them, and construct Bloom filters.

• kmtricks also provides a C++ library for interfacing with any stage of the pipeline, enabling for instance downstream sequence analyses based on streaming a k-mer matrix in row-major order.

We evaluated the performance of kmtricks in terms of running time, peak memory usage and maximal disk space on 100 and 674 RNA-seq samples (see Supplementary Material, Table S1). On these collections, HowDe-SBT/kmtricks is 1-1.5x faster to construct than HowDe-SBT/KMC, 3-4x faster than HowDe-SBT/Jellyfish, 7x faster than COBS, 2x faster than Mantis. Thus kmtricks yields superior or comparable performance to other methods for indexing sequencing data, even though it performs the more complex operation of joint kmer counting. We will show in Section 3.3 that the performance gap between other methods and kmtricks further widens on larger inputs, i.e. terabyte-sized collections.

Dataset and computing setup

The Tara Ocean experiments (Section 3.3) were performed on large and complex sea water metagenomic data composed of 241 samples (distinct locations) by the Tara Ocean project [START_REF] Karsenti | A holistic approach to marine eco-systems biology[END_REF]. This dataset is composed of approximately 6.5 thousand billion nucleotides, consisting of around 266 billion distinct k-mers (k = 20), among which 174 billions k-mers occur twice or more as estimated by ntCard [START_REF] Mohamadi | ntcard: a streaming algorithm for cardinality estimation in genomics data[END_REF]. Executions were performed on a TGCC node with 4x16-cores Intel Xeon E7-8860 2.20 GHz with 3 TB of memory, on a SDD with 4.5 GB/s and 800 MB/s sequential read write, using 60 threads. Description of the data, tool versions and command lines are provided in a companion Github website (see reference (Lemane and Peterlongo, 2021)). kmtricks enabled to construct Bloom filters for a very large metagenomics collection with very limited amount of RAM and reasonable computation time, outperforming all other methods (Table 1). Disk usage was higher than other tools but of similar magnitude than the input data. kmtricks is ≥3.5 times faster than other pipelines, while achieving superior results as it performs joint k-mer counting and is able to rescue low-abundance shared k-mers.

Scaling to a large sea water metagenome collection

We additionally ran HowDe-SBT on the Bloom Filters generated by kmtricks, thereby creating the first complete index of all metagenomics bacterial sequences obtained in the Tara Ocean project. With Bloom filters given as input, HowDe-SBT ran in 2100 minutes, with a peak RAM of 163 GB. The size of the final index is 612 GB. Of note, kmtricks executed in rescue mode but also discarding any k-mer seen only once takes twice less disk space (around 3 TB).

Collection-aware k-mer filtering recovers large amounts of weak signal present in complex metagenomes

k-mer filtering consists in removing from a sample any k-mer whose number of occurrences is below a certain threshold (called solidity threshold), classically set to 2 or 3. However, with data such as metagenomics or RNA-seq that have uneven coverage and include low abundance species or expressed genes, abundance does not enable to distinguish erroneous k-mers from real ones, as highlighted in Fig. 2(a). Hence we propose to rescue low-abundant k-mers, through a rare but shared k-mer rescue procedure. This procedure consists in keeping any k-mer whose abundance is below the solidity threshold whenever this kmer is sufficiently abundant in one or several other samples. Section 4.3 provides formalization and in-depth description of the procedure.

We evaluated the effect of the k-mer rescue procedure on the Tara Ocean experiment. Intermediate results and dedicated scripts are provided in the companion github web site (Lemane and Peterlongo, 2021). For each sample i, we computed the solidity threshold t i as the smallest value ≥ 1 such that the number of k-mers occurring t i times is smaller than 10% of the total number of k-mers. (using ntCard [START_REF] Mohamadi | ntcard: a streaming algorithm for cardinality estimation in genomics data[END_REF]). In a sample i, any k-mer with abundance higher or equal to t i is conserved. Applying the rescue procedure, we then rescued any k-mer whose coverage was in a range [1, t i ] whenever it had a coverage > t j in at least one other sample j. Hence a k-mer is considered as erroneous in a sample i if its abundance in i is lower than t i and there exists no other sample j in which the k-mer is seen at abundance higher or equal to t j .

We validated this strategy as follows. For each sample we computed 1. err th : the theoretical expected number of erroneous k-mers, 2. errone: the number of k-mers occurring only once, and 3. err unrescued : the number of k-mers that are still considered as erroneous after our rescue procedure.

We then look at the ratio err unrescued /err th and compare it to the ratio errone/err th . The closer a ratio is to one, the better. The Tara Oceans dataset was mainly generated by HiSeq 2000 technology (222 samples out of 241), 8 samples were generated by HiSeq2500, 4 samples by GAIIx. For each of these technologies, we computed the theoretical error rate err th . Given raw sequencing data from Acinetobacter baylyi generated by these three sequencing technologies1 we counted the number of erroneous k-mers (k = 20), i.e. those absent from the reference genome. Error rates are respectively 0.0641%, 0.4838%, and 0.1715% for HiSeq2000, HiSeq2500 and GAIIx.

Results shown in Fig. 2(b) highlight the importance and efficacy of our k-mer rescue procedure. Indeed, the quantity of k-mers filtered out is close to the theoretical expected value when using the rescue procedure (average ratio of 1.01). An order of magnitude too many k-mers appear to be wrongly filtered out when removing k-mers occurring only once (average ratio of 9.12).

Thus, when indexing low-error-rate data containing low-abundant genomes as in the Tara ocean bacterial metagenomes, rescuing appears to be essential as it: 1. side-steps the issue of removing lowabundant k-mers which ends up discarding an order of magnitude too many k-mers; 2. recovers a number of k-mers close to the expected one using co-occurrence across samples.

Methods

Definitions

A minimizer of length m within a sequence s is the smallest m-mer within s, where typically "smallest" is understood in the lexicographical sense. A super-k-mer is a sequence in which all constituent k-mers have the same minimizer.

A Bloom filter [START_REF] Bloom | Space/time trade-offs in hash coding with allowable errors[END_REF]) is an approximate membership query (AMQ) data structure that allows two operations: inserting and querying elements u ∈ U. It is a bit array B[0..n] with l hash functions h i : U → {0, ..., n} ∀i ∈ [1..l]. Insertion can be defined as follows B[h i (x)] ← 1, ∀i ∈ [1..l] and lookup as l i=1 B[h i (x)]. Lookups can return false positives but no false negatives. In the following, we will consider one-hash Bloom filters (l = 1).

We use the terms color-aggregative and k-mer-aggregative as defined in [START_REF] Marchet | Data structures based on k-mers for querying large collections of sequencing data sets[END_REF]. A color-aggregative data structure represents within a single index all k-mers of the collection, and each k-mer is associated to its pattern of presence/absence across the whole collection. Conversely, a k-mer-aggregative data structure constructs separate k-mer indices, one per sample.

We refer to hash counting as the process of counting hash values of a set of elements instead of counting the elements themselves. This is the counterpart of k-mer counting except that here k-mers are represented by their hash values, and several k-mers may collide to the same hash value.

The strand of each sequenced read being unknown, in kmtricks, as in all k-mer counting and indexing tools, each k-mer is represented by its canonical representation: the smallest string (in the lexicographic order) between itself and its reverse complement. 4.2 A modular pipeline for large-scale Bloom Filters construction: kmtricks kmtricks supports the construction of either a k-mer matrix or Bloom filters. In both cases, the input is a collection of sequencing data files in FASTQ format. The output is either a matrix having k-mers as rows, samples as columns and k-mer counts as values, or a collection of Bloom filters, one per sample. In the following, we will focus on Bloom filter construction as this pipeline includes all the ingredients necessary for k-mer matrix construction. We will describe two operational modes: hash counting for Bloom filters, k-mer counting for k-mer matrices.

In other tools, the construction process of Bloom filters can typically be broken into two steps: 1) efficiently counting k-mers then 2) inserting distinct k-mers into filters, on a per-sample basis. kmtricks streamlines this process by realizing that in the case of Bloom filters only the hashes need to be counted, not k-mers; furthermore, in order to cope with terabytes of input data and still be able to efficiently count hashes, a careful partitionaware hashing scheme is designed.

Partitioning

kmtricks performs parallel k-mer counting following the classical paradigm of partitioning k-mers based on their minimizers and then constructing super-k-mers, as in KMC 2 [START_REF] Kokot | KMC 3: counting and manipulating k-mer statistics[END_REF]. However, the process is newly modularized so that intermediate tasks correspond to separate programs. Conceptually, the set of all possible minimizers is first partitioned in the following balanced way: all partitions should contain a roughly equal total number of k-mers. This is performed by the km_-minim_repart module, using the GATB library [START_REF] Drezen | GATB: Genome Assembly & Analysis Tool Box[END_REF] that implements a previously-known algorithm from DSK [START_REF] Rizk | DSK: k-mer counting with very low memory usage[END_REF].

In hash counting mode, in order to take advantage of the partitioning scheme in the context of Bloom filters construction, we use partitioned Bloom filters (pBFs). These are Bloom filters that are partitioned into P sub-filters with exclusive (and consecutive) hash spaces hp : Up → {p × s, ..., p × s + s -1} with p ∈ [0..P -1] and s = bits P (rounded up to 8) with "bits" corresponding to the user-requested Bloom filter size. Having pBFs allows to populate only a small part of a Bloom filter when processing a k-mer partition, which saves memory and enables coarse-grained parallelization at both the construction and query stages. A classical Bloom filter (except for a slightly more complex query operation, see Section 4.2.5) can be obtained by a simple concatenation of the pBFs thanks to the consecutive hash spaces.

Counting

The second step, performed in km_reads_to_superk, consists in computing for each sample its super-k-mers and writing them to their corresponding partitions on disk (Fig 3 .a). From those super-k-mers, k-mers (or their hash values, depending on whether hash counting is performed) are de-duplicated and the abundance of each distinct k-mer (or hash value) is determined within each partition (km_superk_to_-kmer_counts module).

In hash counting mode, kmtricks optimizes the output in the following way. If k-mer rescue (see 3.4) is not performed, bit-vectors are output immediately instead of a list of counted hashes (Fig 3 .1.b). One bit vector is output per partition and per sample. In other words, these bit-vectors correspond to pBFs built from the hashes. Otherwise if k-mer rescue is performed (still in hash counting mode), bit-vectors cannot be immediately output as counts of the same hash value must be examined over all samples. In this case, hashes and their counts are dumped to disk for each partition from each sample (Fig. 3.2.b).

Merging

Finally if k-mer rescue is performed or a holistic view of k-mers (i.e. joint counting) is sought, k-mers (resp. partitions of hash values) need to undergo a merging step in order to obtain a k-mer matrix (resp. a collection of Bloom filters). Aggregation of k-mers or hashes over multiple samples is achieved using the classical k-way merge algorithm on equivalent partitions between samples. This algorithm assumes sorted inputs, which is inexpensive in our case since sorting is already performed by the counting algorithm. Merging is performed in the km_merge_-within_partition module.

In both k-mer counting mode and hash counting mode, each row count vector (corresponding to a single k-mer or hash value) is processed according to the k-mer rescue procedure, details are given in Section 4.3.

In k-mer mode, there is no additional operation after merging, except output formatting (see Section 4.2.4). Therefore the rest of this section is dedicated to the hash counting mode, i.e. the Bloom filters construction pipeline.

In hash counting mode, row count vectors are transformed into a binary representation during the merge step. In a partition, all possible hashes are considered. This means that for each missing hash value (corresponding to a k-mer not seen in the partition), an empty bit-vector is appended to the matrix. Hashes are not stored (only the bit-vectors are), as they implicitly correspond to row indices. At the end of this step, we have P sub-matrices of bits P presence/absence bit-vectors each.

At this point, the resulting matrices (k-mers matrices or Bloom filters) are color-aggregative, i.e. each row represents the presence or the absence (or counts) of the corresponding hash value across samples. If kmtricks is set to construct Bloom filters, one seeks to convert the data into k-meraggregative, where each filter represents hashes for a single collection. Switching from a color-aggregative representation to a k-mer-aggregative representation can be achieved through a bit-matrix transposition. The input matrix needs to be exhaustive in the following sense: missing hashes are represented by empty presence/absence bit-vectors, i.e. in each partition the number of presence/absence bit-vectors corresponds to s, the number of bits in a partition, as described in Section 4.1. It also needs to be sorted so that each bit-vector row corresponds to consecutive hashes in {p × s, ..., p × s + s -1}.

When performing a transposition, we transform a matrix with hashes in rows associated with presence/absence bit-vectors into a matrix with samples in rows associated with a one-hash pBF. Due to Bloom filter partitioning, P transposed matrices are in fact obtained, each with a number of rows corresponding to the number of samples. The horizontal concatenation of each corresponding row from these matrices allows one to build one Bloom filter per sample.

Outputs

kmtricks can output different sort of k-mer matrices. In k-mer mode: count or presence/absence k-mer matrices. In hash mode: hashes presence/absence vectors (kmer-aggregative) or pBFs vectors (coloraggregative), both seen as bit matrices. Of note, pBFs vectors can be converted into sample-specific Bloom filters that are compatible with the SDSL library [START_REF] Gog | From theory to practice: Plug and play with succinct data structures[END_REF] and HowDe-SBT (km_output_convert module).

All these outputs are readable and writable using kmtricks C++ library. In the case of k-mer counts matrix, a text output format is also supported.

Query

Due to how kmtricks creates Bloom filters that are partitioned according to minimizers, the minimizer of each k-mer from a query sequence must be computed in order select the correct hash function. A compatible version of HowDe-SBT is available through the kmtricks release. kmtricks does not yet provide a stand-alone tool to directly query a Bloom filter, however this operation is supported within the kmtricks C++ library.

A novel technique to rescue rare k-mers

To rescue low-abundant but likely correct k-mers, as performed in Section 3.4, we design a rather simple technique based on examining the abundance of each k-mer across sequencing samples. This technique is only practically applicable in conjunction with joint k-mer counting. It cannot be directly implemented in a one-sample-at-a-time construction procedure, unless such procedure discards no k-mer which would result in prohibitively large intermediate storage. When a low-abundant k-mer is observed in a sample (with abundance lower than a user-defined threshold), its abundance in other samples is used to decide whether to keep its abundance for that sample or not. Several thresholding procedures can be specified in kmtricks:

• A hard threshold applied during the counting step, called countabundance-min. This threshold filters out any k-mer whose abundance is below its value, regardless of the presence of the kmer in other samples. Kept k-mers are said to be solid. Note that this threshold can be set on a per-sample basis.

• A soft threshold, this time applied during the merging step, called merge-abundance-min. Any k-mer whose abundance is higher than its value is kept, otherwise it is provisionally discarded yet is considered candidate for being rescued. We call such a k-mer rescueable. This threshold can be set on a per-sample basis. • The merge-abundance-min threshold is modulated by a parameter that we call save-if. A rescue-able k-mer in a sample is kept (rescued) if it is solid in at least save-if other sample(s). • The last parameter, recurrence-min, allows to discard k-mers that occur in less than recurrence-min distinct samples. Such kmers are simply removed from the final matrix (i.e. result in a null bit-vector in hash mode).

Figure 4 presents several examples showing the application of those thresholds. count-abundance-min=1, save-if=3, recurrence-min=2. a H1 has a abundance lower than 3 in D0 but it is solid in at least save-if samples (D2, D3, D4). b H2 is non-solid on D1, D3 and D4 and is solid only in 2 samples, H2 is therefore discarded in D1, D3 and D4. c H3 is solid only in one sample, recurrence-min cannot be satisfied, the whole row is therefore discarded (dash signs in the Figure, or corresponds to the null bit-vector in hash mode).

D0 D1 D2 D3 D4 m-a-min 3 2 2 3 2 a H1 2 0 4 5 3 → 1 0 1 1 1 b H2 4 1 6 2 1 → 1 0 1 0 0 c H3 2 8 1 2 1 → -/0 -/0 -/0 -/0 -/0

Discussion

We propose a novel method for efficiently counting k-mers across multiple samples and for generating Bloom filters. In addition to being the fastest method for generating Bloom filters over terabyte-scale collections, our approach kmtricks proposes a novel mechanism to filter erroneous k-mers using their co-occurrence across samples, i.e. going beyond filtering on a per-sample basis. This approach leads to significantly improved recovery of k-mers in metagenomes.

In our tests on relatively small collections (100-674 RNA-seq datasets, with on average hundreds of millions of distinct k-mers per sample) the performance of kmtricks is roughly equivalent to the state of the art KMC k-mer counter combined with the Bloom filters construction procedure of HowDe-SBT. However kmtricks stands out on larger collections having higher number of k-mers per sample, such as Tara Ocean (> 6 TB of sequences, with several billions of distinct k-mers per sample). For those, Bloom filter construction becomes a bottleneck and highlights the superior efficiency of the streamlined kmtricks pipeline.

At a high level, kmtricks is able to output matrices either in columnmajor order or in row-major order, where rows can either be k-mers or hash values. This flexibility allows kmtricks to provide inputs for both types of indexing data structures: k-mer-aggregative and color-aggregative (as defined in [START_REF] Marchet | Data structures based on k-mers for querying large collections of sequencing data sets[END_REF] and recalled in the Methods section). Rowmajor order makes the presence/absence of a k-mer directly accessible across all samples, and is contiguous in memory. In column-major order, each Bloom filter is independent and provides information about the existence of all k-mers in one sample.

Contemporary of kmtricks, the MetaGraph software [START_REF] Karasikov | MetaGraph: Indexing and Analysing Nucleotide Archives at Petabase-scale[END_REF] is a k-mer indexing structure that represents k-mers exactly (i.e. not using a Bloom filter) and does not support creating k-mer matrices. MetaGraph was applied to very large collections (hundreds of terabases) using cloud resources and KMC 3, which makes its contribution orthogonal to kmtricks, the latter being geared towards making computation more efficient on a single server. Ideally, kmtricks could be integrated within a MetaGraph-like approach to combine single-server efficiency within a cloud architecture.

Fig. 1 .

 1 Fig. 1. kmtricks pipeline overview on two samples, D 1 and D 2 , using two partitions, P 1 and P 2 , with k = 5 and minimizer size of 3. Bold read sequences are minimizers (AAA and CCC). Superscript integers represent hash values.(1) Counting: Minimizer repartition is determined by sub-sampling D 1 and D 2 and super-k-mers are then dumped on disk according to this partitioning. Each partition is then counted with the possibility to see each element as a k-mer or as its hash value. In both modes, counted partitions may be optionally dumped to disk. In hash mode specifically, for each partition a bit-vector can be output directly ( symbol).(2) Merging: Counted k-mers or hashes from equivalent partitions are aggregated. Different kind of matrices can be obtained: a count matrix (in ASCII or binary format), a presence/absence matrix (each row represents a k-mer or a hash value associated with a presence/absence bit-vector), and, only in hash mode, a vector of Bloom filters (i.e. a matrix of presence/absence bit-vectors, where row indices represent hashes). All these matrices can be filtered using a k-mer rescue procedure described in 4.3. In hash mode, in order to obtain samples in rows and then build Bloom filters, each partition-specific sub-matrix can be transposed.(3) Bloom filter outputs: a Bloom filter is built for each sample through concatenation of transposed sub-matrices (in those, each row corresponds to a sample). Bloom filters can be also obtained from first counting step if aggregation is not required. In this case, this corresponds to a concatenation of bit-vectors from (1) in hash mode without k-mer rescue.

Fig. 2 .

 2 Fig. 2. (a) Kmer histogram of one of the Tara ocean samples (chosen arbitrarily), showing a flat distribution of abundances indicative of the presence of low-abundance microbes, also highlighting the lack of separation between erroneous and correct k-mers. (b) Number of k-mers filtered divided by the number of expected number of erroneous k-mers (ideal is close to 1). Green histogram shows results obtained with the proposed rescue procedure. Red histogram shows results obtained by the classical removal of k-mers occurring only once.

Fig. 4 .

 4 Fig. 4. Example of the rescue procedure for three k-mers/hashes and five samples using sample-specific merge-abundance-min and the following set of parameters:

Fig. 3 .

 3 Fig. 3. Bloom filters construction pipeline with two samples D1 and D2 using two partitions: black (1) and gray (2). Sk and Hc denote respectively super-k-mers and hash counted (1) Bloom filters pipeline without k-mer rescue: a Divide sample into partitioned super-k-mers. b Split super-k-mers into k-mers before hashing them and counting hashes in partitions. For each partition, output presence/absence bit-vectors, i.e. partitioned Bloom filters. c Concatenate equivalent partitions between samples to obtain one Bloom filter per sample. (2) Bloom filters pipeline with rare k-mer rescue: a same as (1). b same as (1), but output hashes and their counts. c Merge and binarize (according to the rescue procedure, see 4.3) equivalent partitions to build one sub-matrix per partition with pBFs in columns. d Transpose sub-matrices to obtain pBFs in rows. e same as (1)-c .

Table 1 .

 1 Comparison of construction times between kmtricks and other k-mer counting tools on the 6.5 terabases Tara Ocean collection. The makebf step corresponds to Bloom filter creation from counted k-mers by howdesbt makebf. The Memory column indicates peak RAM usage. KMC and Jellyfish counted each sample independently and removed k-mers with abundance one; whereas kmtricks performed join k-mer counting and lowabundance rescuing (see Section 4.3) which kept some of the unit abundance k-mers. Mantis and COBS were not executed due to their significantly longer construction times observed on smaller data.

		Time (min) Memory (GB) Disk (TB)
	kmtricks	2631	50.3	6.29
	Jellyfish a + makebf >10000 b	80.6	≈ 1.1
	KMC a + makebf	>8500 b	213	≈ 1.1

a Stopped after 50h computation. b Extrapolated estimation.

Jean-Marc Aury, Genoscope, personal communication.

k=20,

k=31, R Rescue mode

Acknowledgements

This work used HPC resources from the Très Grand Centre de Calcul of CEA (http://www-hpc.cea.fr/fr/complexe/ tgcc.htm) and the GenOuest bioinformatics core facility (https: //www.genouest.org). The authors are grateful to Bob Harris for discussion on HowDeSBT, and Eric Pelletier & Jean-Marc Aury who provided links to Tara and Acinetobacter datasets, and precious information about these data.

Funding

The work was funded by IPL Inria Neuromarkers, ANR Inception (ANR-16-CONV-0005), ANR Prairie (ANR-19-P3IA-0001), ANR SeqDigger (ANR-19-CE45-0008).

https://github.com/tlemane/

Supplementary

Human RNA-seq benchmarks

The human RNA-seq benchmarks were done on two subsets with 100 and 674 samples from a common set of 2,585 human RNA-seq sequencing used as inputs in several k-mer indexing benchmarks, and first proposed in [START_REF] Solomon | Fast search of thousands of short-read sequencing experiments[END_REF]. Computations were performed on the GenOuest platform on a node with 4x8-cores Xeon 2,20 GHz with 200 GB of memory. Benchmarks were performed on SSD disk with 900 MB/s and 290 MB/s sequential read/write. All benchmarks are done using 20 cores. Details about data and scripts are available from the kmtricks github companion website (see reference Lemane and Peterlongo (2021)). A Conda environment is also provided to reproduce these benchmarks.

On these datasets, kmtricks outperformed the indexing steps of Mantis, HowDe-SBT and COBS in terms of computing time (by 2-8x) and memory usage (by 1-8x), and uses comparable disk space. We also substituted Jellyfish with KMC in HowDe-SBT, yielding comparable time/memory performance to kmtricks on this collection. However, KMC does not support joint k-mer counting, and its integration in a Bloom filter construction pipeline turns out to be significantly less scalable than kmtricks as shown Section 3.3, dealing with larger and more complex data.

A : 100 RNA-seq (44 GB fasta.gz) Time (min) Memory (GB) Disk (GB) makebf


Bogdan Iorga

Frédéric Eymery

Duncan Carmichael

Philippe Savignac

Dialkyl 1-Alkynylphosphonates, a Range of Promising Reagents

1-alkynylphosphonates / halogen abstraction / SNP(V) / β-elimination / cycloaddition reactions / reduction / hydration The present review covers the preparations of 1-alkynylphosphonates by Michaelis-Arbuzov and Michaelis-Becker reactions, nucleophilic substitutions at phosphorus (SNP(V)) and elimination from 1-alkenylphosphonates. Their reactivity and versatility have made them valuable precursors for other phosphonates and particularly for the synthesis of heterocycles by [2+2], [3+2] and [4+2] cycloaddition reactions.

I. Introduction

Diethyl 1-propynylphosphonate, the first 1-alkynylphosphonate, was described in 1957 [1] and the syntheses forming the basis of modern alkynylphosphonate chemistry were elaborated in the 1960's. The methodologies developed during this period for the synthesis of 1alkynylphosphonates used synthetic concepts which were new to phosphorus chemistry, such as "charge affinity inversion" and "positive halogen abstraction". Four main reaction categories allow the preparation of 1-alkynylphosphonates: the "apparent" Michaelis-Arbuzov and Michaelis-Becker reactions, the phosphite-allenylphosphonate rearrangement, carbanionic displacements at quinquevalent phosphorus centers (SNP(V)) [2] and conversions of vinyl-to alkynylphosphonates by addition-elimination reactions. The first three synthetic procedures rely on the preparation of a terminal alkyne, bearing either a proton or a halide, prior to construction of the C-P bond. The fourth procedure offers a complementary and more versatile multi-step approach involving the elaboration of suitably substituted vinylphosphonates prior to unmasking the triple bond. In this review, particular emphasis will be placed upon synthetic methods and chemistry which are peculiar to 1-alkynylphosphonates.

II. General Methods of Synthesis

A. Nucleophilic Displacement Reactions by Phosphorus Nucleophiles

Michaelis-Arbuzov Reaction

In 1962 it was reported that α-bromoalkynes 2 (X = Br) whose triple bond is conjugated to a benzene ring or other multiple bond react surprisingly easily with trialkyl phosphites 1. A subsequent Michaelis-Arbuzov-type rearrangement gives dialkyl 1-alkynylphosphonates 3 in fair to good yields (48-67%) (Scheme 1). [3]

Scheme 1

Chloro-, bromo-and iodoalkylacetylenes which are not conjugated to an unsaturated system do not react. However, the presence of electronegative atoms or groups increases the reactivity of the haloacetylene functionality, so that substituted haloacetylenes 2 (X = Cl or Br) undergo an "apparent" Michaelis-Arbuzov reaction with trialkyl phosphites 1 when R 1 is an electronwithdrawing or accommodating group (R 1 = Ph, [4] C 6 F 5 , [5] R-C≡C, [6] CH 2 =CH, [7] Cl, [4,8,9] Br, [9,10] (EtO) 2 P(O), [8,11,12] SR, [13,14] SiMe 3 , [15,16] SnEt 3 [17,18] ). The Michaelis-Arbuzov rearrangement of dichloroacetylene 5 proceeds under surprisingly mild conditions even in the cold in ethereal solution, to give mainly the monosubstitution product. For example, the reaction of triethyl phosphite 4 (1 eq.) with a large excess of dichloroacetylene 5 (5 eq.) furnishes diethyl 2-chloroethynylphosphonate 6 in 50% yield (Scheme 2). A better yield (90%) has been reported by working at -20°C. [19] However, the chlorine atom in the product phosphonate 6, which is rather labile because of the polarization induced by the highly electronwithdrawing phosphoryl group, can undergo a further Michaelis-Arbuzov rearrangement with formation of tetraethyl acetylenediphosphonate 7 in 52% yield. [4] Scheme 2

Dialkyl ethynylphosphonates are the simplest but not the easiest of these compounds to prepare. Whilst several approaches were described, no convenient high-yield synthesis appeared until the introduction of the trimethylsilyl functionality as a protecting group for the acetylenic CH linkage. The synthesis of diethyl ethynylphosphonate 10 then involves an "apparent" Michaelis-Arbuzov reaction between chloroethynyltrimethylsilane 8 and triethyl phosphite 4 under heating at reflux for 5 h. The trimethylsilyl group is sufficiently electron accommodating to promote the reaction. The resulting diethyl trimethylsilylethynylphosphonate 9, obtained in high yields (70-82%), may be readily desilylated by 10% aqueous sodium carbonate to give the required diethyl ethynylphosphonate 10 in overall yields up to 77% (Scheme 3). [15] Scheme 3 In view of the supposed inertness of halo-unsaturated substrates in the Michaelis-Arbuzov reaction, it is remarkable that arylalkynyl halides are more reactive than comparable alkyl, aryl, or vinyl halides towards trialkyl phosphites 1. The success of the Michaelis-Arbuzov reaction in the synthesis of dialkyl 1-alkynylphosphonates 3 from haloalkynes 2 has provoked a number of mechanistic studies. Three sites, the halogen, α-carbon, or β-carbon have been investigated as the zone of the initial nucleophilic attack by trialkyl phosphites 1. Studies to date suggest that the reaction proceeds by at least two different mechanisms, and that probably the most important of these involves positive halogen-abstraction (path a) as outlined in Scheme 4. [20][21][22][23][24]

(RO) 3 P (RO) 2 P O C C R 1 C C R 1 X + + X=Cl, Br

Scheme 4

The second mechanism operating may well be the addition / elimination mechanism (path b), also outlined in Scheme 4. The negative charge developing at the β-carbon in the intermediate is consistent with the requirement for electron-withdrawing or accommodating R 1 groups. The first mechanism also satisfies this requirement.

The treatment of propargyl bromide with trialkyl phosphites 1 has been reported to give complex reaction mixtures. For example, from the reaction between triethyl phosphite 4 and propargyl bromide at 90°C only the diethyl 1-propynylphosphonate 18 (R = Et) was isolated in low yields (15%). [25,26] Early transformation of trialkyl phosphites 1 and haloalkynes 2 (R 1 C≡CX) into dialkyl 1alkynylphosphonates 3 was limited to haloalkynes in which R 1 was an electron-withdrawing group. [23,27] In 1990, two innovations worthy of merit were reported. [28,29] The first featured alkynylphenyliodonium salts [28] as alkynylating agents and the second featured NiCl 2 as a catalyst. [29] Alkynylphenyliodonium tosylates 11 react with trialkyl phosphites 1 in a formal Michaelis-Arbuzov reaction to give dialkyl 1-alkynylphosphonates 3 (Scheme 5). It seems plausible that the first step in this reaction is a Michael addition of the trimethyl phosphite 1 (R = Me) to the electron-deficient β-carbon to form an ylide which undergoes loss of iodobenzene and formation of vinylidene. The rearrangement of this carbene affords the alkyne phosphonium which is transformed into 3 and ROTs according to the second step of the Michaelis-Arbuzov reaction. [START_REF] Stang | Modern Acetylene Chemistry[END_REF] For example, when an excess of neat trimethyl phosphite 1 (R = Me) was added to solid (tertbutylethynyl)phenyliodonium tosylate 11 (R 1 = t-Bu) at room temperature, the iodonium salt rapidly disappeared to give 90% yields of dimethyl tert-butylethynylphosphonate 3 (R = Me, R 1 = t-Bu) upon work-up.

(RO) 3 P C C X R 1 + C C R 1 C C R 1 P(OR) 3 C C R 1 P(OR) 2 O C C R 1 P(OR) 3 X b a 2 1 3 P(OR) 3 X X RX (RO) 3 P C C R 1 + C C R 1 P(OR) 2 O neat, r.t. R 1 = i-Pr, t-Bu, s-Bu, c-Pent, Ph 34-90% R=Me, Et, i-Pr IPh 11 1 3

TsO

ROTs PhI

Scheme 5

The reactions of 11 (R 1 = s-Bu, i-Pr, c-Pent, Ph and p-Tol) with trimethyl and higher phosphites have been investigated. Dimethyl 1-alkynylphosphonates 3 (R = Me) may be isolated in yields ranging from 34 to 90%. It is clear that the trimethyl phosphite-induced cleavage of the alkynylphenyliodonium ion is remarkably selective in favour of the alkynyl group. It seems plausible that the alkynylphosphonate formation is initiated by Michael addition of the trimethyl phosphite to the triple bond of 11 followed by vinylidene formation, rearrangement, and Michaelis-Arbuzov collapse. This preparation of dialkyl 1-alkynylphosphonates 3 from alkynylphenyliodonium tosylates 11 is a useful complement to the traditional Michaelis-Arbuzov synthesis. [28] Simultaneously, it was reported that 1-tert-butyl-2-chloroacetylene reacts with trialkyl phosphites 1 between 110 and 160°C in the presence of a catalytic amount of anhydrous NiCl 2 to give the corresponding alkynyl esters in good yields: 73% for the ethyl ester and 75% for the isopropyl ester. [29]

Michaelis-Becker Reaction

The first attempt to prepare 1-alkynylphosphonates 3 by a Michaelis-Becker reaction was reported in 1965. [START_REF] Meisters | [END_REF] However, only octyne was produced when 1-bromooctyne was allowed to react with sodium diethyl phosphite 12 in liquid ammonia, the coproduct being diethyl phosphoramidate. It seems likely that reduction of the bromo compound occurs by an halogen-metal exchange, with the resulting diethyl bromophosphate being immediately converted into diethyl phosphoramidate by the liquid ammonia. [START_REF] Meisters | [END_REF] The difficulties associated with this approach, namely the conversion of the bromoalkynes into sodium acetylides and the subsequent reaction of the latter with the bromophosphate byproducts, may be effectively eliminated by working at low temperature. Thus, sodium diethylphosphite 12 reacts with 1-bromoalkynes 2 in THF at low temperature to give diethyl 1-alkynylphosphonates 13 in fair to good yields (37-75%) (Scheme 6). [32,33,34] Usually, yields are improved upon further lowering the temperature and adding the bromoalkyne slowly. [32,34] However, such precautions are not invariably necessary and fair yields (20-63%) have been observed in the synthesis of a number of heterocycle-containing ethynylphosphonic esters upon reaction of the corresponding bromoacetylenic alcohols even in benzene at 80°C. [35] Likewise, the reaction between diethyl phosphite and 4-chloro-2-methyl-3-butyn-2-ol in dry Et 2 O at room temperature in the presence of a catalytic amount of CuCl and diethylamine reportedly gives good yields (60-72%) of dialkyl 3-hydroxy-3-methyl-1-butynylphosphonate. [36] Formation of dimethyl phenylethynylphosphonate in 68% yield has recently been described by treating alkynyl iodides with copper (I) dimethyl phosphite in a THF suspension under ultrasonic irradiation. [37] Nevertheless, the Michaelis-Becker route does not always proceed cleanly and the dialkyl 1alkynylphosphonates 3 frequently contain undesired side products which are not easily removed. Given the difficulties associated with the use of bromoalkynes 2, it is unsurprising that this reaction is used infrequently and that the general synthetic utility of the procedure remains to be proven. Haloalkynes are triphilic and the approach of anionic and neutral nucleophiles at the haloalkyne has been dicussed and evaluated in terms of the three sites. [24] Scheme 6

(EtO) 2 P O -70°C, THF + (EtO) 2 P O C C C Br C R 1 R 1 R 1 =Me, Et, n-Pr, n-Bu, n-Pent, n-Hex, Ph 37-75% 12 2 13
Na Propargyl bromide reacts with sodium diethyl phosphite 12 to give diethyl 1propynylphosphonate 18 (R = Et). Unfortunately, irrespective of the reaction conditions, (sodium in refluxing THF [38] or liquid ammonia, [START_REF] Meisters | [END_REF] potassium carbonate in benzene at 70°C [39] or potassium fluoride at 60°C without solvent [40] ), complex mixtures containing diethyl 1-propynylphosphonate 18 (R = Et) and 2-propynylphosphonate and diethyl allenylphosphonate 17 (R = Et, R 1 = R 2 = R 3 = H) are obtained.

Rearrangement and Isomerisation Reactions

In 1962 three laboratories, in the Soviet Union [41] and America, [42,43] independently reported the rearrangement of dialkyl 2-alkynylphosphites 16 to dialkyl allenylphosphonates 17. Propargyl phosphites 16, readily obtained from propargyl alcohols 15 and dialkyl chlorophosphites 14 in Et 2 O at 0°C in the presence of Et 3 N or pyridine, rearrange slowly upon standing at room temperature to produce excellent overall yields of readily isolable dialkyl allenylphosphonates 17 (Scheme 7). In ethereal solution at room temperature, the rearrangement stops at the stage of the allenylphosphonate 17. The particular ease with which the acetylenic-allenic rearrangement takes place is evidently due to a combination of the nucleophilic properties of the trivalent phosphorus atom and the rather electrophilic character of the triple bond. This rearrangement has been widely explored because the allenylphosphonates are particularly well suited for elaboration into enaminophosphonates by addition reactions at the allenic carbon atom.

Scheme 7

The prototropic isomerisation of the allenylphosphonate 17 into the 1-propynylphosphonate 18 proceeds partially or completely under the influence of the organic base which is generally present in catalytic amounts in the reaction mixture. [44] When pure dialkyl allenylphosphonates 17 were heated to 200°C, they remained unchanged (apart from partial polymerisation). In the presence of a basic catalysts, sodium ethoxide, [45] NaOH [START_REF] Pines | GB 1221738[END_REF] and sodium hydride [47] at room temperature or triethylamine [48][49][50] and triethylphosphite [48] at high temperature, they undergo prototropic isomerisation into dialkyl 1-propynylphosphonates 18 more or less readily. Thus, diethyl propadienylphosphonate 17 (R = Et, R 1 = R 2 = R 3 = H) was straightforwardly and almost completely isomerized into diethyl 1-propynylphosphonate 18 (R = Et) in excellent yield (92.5%). This method has allowed the preparation of a variety of dialkyl 1-propynylphosphonates 18 bearing different R groups at the phosphorus atom. The rearrangement of γ-substituted propargyl phosphites is accompanied by inversion of the unsaturated groups, but the rearrangement stops at the allenic isomers (R 3 ≠ H) through the lack of a labile hydrogen atom at the carbon bound to the phosphoryl group. Similarly, dialkyl γ,γ-dimethylallenylphosphonate 17 (R 1 , R 2 ≠ H), which is thermodynamically more stable than the acetylenic isomer, does not undergo prototropic transformation in the presence of base. Even heating dialkyl γ,γ-dimethylallenylphosphonates in the presence of sodium ethoxide or triethylamine does not cause prototropic transformation, but instead provokes an intramolecular dimerization of the product, according to a kinetic study. Two variants of this rearrangement have been reported. One uses triethyl phosphite 4 instead of diethyl O HO chlorophosphite 14 (R = Et). [51] Thus, in the presence of catalytic amount of para-toluenesulfonic acid, triethyl phosphite 4 reacts with propargyl alcool in DMF at room temperature to give a mixture of diethyl allenylphosphonate 17 (R = Et, R 1 = R 2 = R 3 = H) (51%) and 1propynylphosphonate 18 (R = Et) (14%). The second [52] converts the allenylphosphonates 17 (R 1 , R 2 ≠ H, R 3 = H) into 1-alkynylphosphonates 18 in benzene with 46-50 % yields by a photochemically allowed [1,3s]-sigmatropic shift.

(RO) 2 P Cl (RO) 2 P O C C CH 3 C C (RO) 2 P O C C CR 1 R 2 + (RO) 2 P C C C 0°C, Et 2 O pyridine r.t. C R 2 R 1 R 1 R 2 R 1 =R 2 =R 3 =H base R 3 R 3

B. Reactions at Electrophilic Phosphorus

Alkynylmagnesiums

In the past, interest in the preparation of dialkyl 1-alkynylphosphonates 3 centred upon studies of nucleophilic addition to carbon-carbon triple bonds which were activated by phosphoryl groups. The parent ethynylphosphonate was prepared in 1960 by the reverse addition of stoichiometric ethynylmagnesium bromide to the appropriate dialkyl chlorophosphates in THF. [53] The product was obtained in very low yield (12 to 25%), presumably because of side reactions involving the relatively acidic alkynyl proton. The yields can be increased slightly (25 to 35%) by the use of (toxic) dialkyl fluorophosphates. [54] Despite advances in developing methodology for the elaboration of 1-alkynylphosphonates, the preparation of the parent ethynylphosphonates remained difficult for a prolonged period. Eventually, diethyl ethynylphosphonate 10 became easily accessible through reaction of a protected synthetic equivalent, trimethylsilylethyne 20, with methylmagnesium bromide in Et 2 O followed by addition to a solution of diethyl chlorophosphate 19 (SNP(V) reaction). [55] The resulting diethyl trimethylsilylethynylphosphonate 9 was deprotected by hydrolysis with 10% Na 2 CO 3 to give the parent diethyl ethynylphosphonate 10 in a good overall yield of 74% (Scheme 8).

Scheme 8

The extension of this principle to higher homologues of acetylene gave superior results. These compounds were readily obtained from dialkyl or diphenyl chlorophosphates and the appropriate terminal alkynylmagnesium bromide, which was prepared in turn from the alkyne 21 and ethylmagnesium bromide in Et 2 O or THF (Scheme 9). [56] The most widely employed phosphorus reagent is diethyl chlorophosphate 19 (R = Et) which is reacted with the alkynylmagnesium bromide through direct [33,34,57] or inverse [56] addition at 0°C in Et 2 O or at -30°C in THF. This procedure has been successfully employed for the preparation of a variety of dialkyl 1-alkynylphosphonates 3 in fair to good yields (51 to 76%), with the best results generally obtained using addition of the alkyne salt to the chlorophosphate.

with Alkynyllithiums

Since lithium reagents are generally more reactive carbanion-equivalents than their Grignard counterparts, it might be expected that they would be able to condense more cleanly with chlorophosphates. Furthermore, the facile and quantitative generation of alkynyllithiums under low temperature conditions makes the use of lithium reagents for the generation of dialkyl 1alkynylphosphonates 3 a useful and especially attractive methodology which has been developed with simple and functionalized alkynes. Alkynes 21 were metallated with n-BuLi in THF solution at low temperature and the resultant lithium acetylides reacted with diethyl chlorophosphate 19 at the same temperature. This procedure minimizes side reactions and provides high and reproducible yields of diethyl 1-alkynylphosphonates 13 (Scheme 10). [58][59][60][61][62][63][64][65][66] The synthesis of diethyl ethynyl phosphonate 10 has recently been described using lithium bis(diisopropylamino)boracetylide as the synthetic equivalent for lithium acetylide. After reaction with diethyl chlorophosphate 19 in THF at -78°C, the protected diethyl ethynylphosphonate was hydrolysed with a 3 M HCl solution to produce 10 in a good overall yield of 72%, [67] comparable with those previously obtained. [15,55] Synthesis of 10 was also reported with an overall yield of 68% by a three-step synthesis including the reaction of lithium trimethylsilylacetylide with diethyl chlorophosphite 14 (R = Et) (83%) followed by oxidation with meta-chloroperbenzoic acid and deprotection with KF in EtOH (82%). [68] Scheme 10

The advantages of lithium acetylides over haloalkynes (Michaelis-Arbuzov or Michaelis-Becker routes) have been clearly demonstrated in several comparable syntheses. In 1976 the preparation of diethyl 3,3-diethoxy-1-propynylphosphonate by condensation of 3,3-diethoxy-1lithio-1-propyne with diethyl chlorophosphate 19 at -65°C was described. [58] The product was easily purified and obtained in 70-80% yield. By way of contrast, the reaction of 1-bromo-3,3diethoxy-1-propyne with potassium or sodium diethyl phosphite 12 (Michaelis-Becker reaction), gave only 30-40% yields of product from which impurities could not be easily removed by distillation. A comparison of the reaction sequences between magnesium and lithium acetylides, with respect to diethyl chlorophosphate 19, has also been undertaken under the same experimental conditions. It reveals that in all cases the use of lithium acetylides in place of the Grignard counterparts results in significantly higher yields. [34] Dialkyl 1-alkynylphosphonates 3 can also be synthesized by the reactions of lithium tetraorganoaluminates with dialkyl chlorophosphates. However, the reaction of these lithium tetraorganoaluminates, prepared from LiAlH 4 and the corresponding substituted alkynes in a pyridine medium, are often sluggish, requiring high temperatures (105°C) and lengthy reaction times (5 h). However, they produce dialkyl 1-alkynylphosphonates 3 in good yields (60 to 80%). [69] C. β-Elimination Reactions.

(RO) 2 P O Cl (RO) 2 P O C C C H C R 1 R = Me, Et, n-Bu, Ph 2) 50-76% R 1 R 1 =Me
Since heteroatom-substituted vinylphosphonates such as enol phosphates and vinyl halides are masked acetylenic compounds, a variety of methods have been developed for their elaboration and subsequent use in the synthesis of 1-alkynylphosphonates 3. These β-eliminations usually have the leaving group β-to the phosphoryl group, although cases where the leaving group is α-to the phosphorus centre are also known (Scheme 11).

Scheme 11

The preparation of 1-alkynylphosphonates 3 by an appropriate β-elimination procedure was first recorded in 1957, when it was reported that the action of sodium ethoxide on diethyl 3diethylphosphonoisoprenyl phosphate 22 in refluxing EtOH led to diethyl 1-propynylphosphonate 18 (R = Et) in 69% yield (Scheme 12). [1,70] The experimental conditions are crucial, and it has been shown that successful elimination of phosphate takes place to the exclusion of the ethanolysis reaction only at elevated temperature. At room temperature, the enol phosphate 22 was reported to undergo competing ethanolysis to triethyl phosphate and diethyl 2-oxopropylphosphonate. Given the drastic reaction conditions required for the subsequent conversion to 1-alkynylphosphonates, this method was rarely used and remained underdeveloped for a significant period of time. Fortunately, many efforts have been made to discover bases which might cause elimination of the phosphate from the enol without also bringing about isomerisation or hydrolysis. The development of a variety of milder alternative methods has led to the much more widespread adoption of this elimination sequence. [71]

Scheme 12

Recently, the conversion of diethyl 2-oxoalkylphosphonates 23 to 1-alkynylphosphonates 13 via transient enol phosphates 24 has been shown to occur in good yields. Thus, treatment of diethyl 2-oxoalkylphosphonates 23 with NaH in THF followed by addition of diethyl chlorophosphate 19 gave the enol phosphate 24. The β-elimination reaction from the enol phosphate was carried out at low temperature using t-BuOK. The reaction proceeds satisfactorily in 72 to 95% overall yield with 2-oxoalkylphosphonates (Scheme 13). [72] In case of long chain substituent (24, R 1 = Et), the product underwent a prototropic isomerisation to give a mixture of diethyl 1-butynylphosphonate 13 (R 1 = Et) and 2-butynylphosphonate.

C C R 1 X(H) (X)H (RO) 2 P O R 1 (RO) 2 P O reagent X = Cl, Br, OP(O)(OR) 2 , OSO 2 CF 3 HX 3
C C P(OEt) 2 Me O C CH 2 P(OEt) 2 H 2 C O O P(OEt) 2 O EtONa/EtOH P(OEt) 2 O NaO + reflux 22

Scheme 13

This approach has been adapted to the preparation of dialkyl fluoro-1-alkynylphosphonates in 65-80% yields through trifluoromethanesulfonation of the dialkyl trifluoro-2hydroxypropenylphosphonate using trifluoromethanesulfonic anhydride in the presence of diisopropylethylamine (3 eq.). [73] Procedures for the conversion of enol phosphates into the corresponding alkynes involve strongly basic conditions, but several milder methods have been reported in the related case of vinyl halides, which are ideal precursors for triple bond generation by a β-elimination reaction. Two complementary approaches for the synthesis of 1-alkynylphosphonates 3 have been developed, one using simple dehydrochlorination of 2-chlorovinylphosphonates and the other by dehydrochlorination with subsequent double bond isomerisation of 2-haloallylphosphonates. For example, dialkyl 2-chlorovinylphosphonates undergo a β-elimination on heating with an equimolecular amount of KOH in absolute EtOH to give the corresponding 1-alkynylphosphonates 3 in 73-85% yields. [74,75] Similarly, by the judicious selection of base, 2-haloallylphosphonates, obtained by a Michaelis-Arbuzov reaction from 2,3-dihalo-1-propenes and trialkyl phosphites 1, may be converted to allenyl-17 or 1-propynylphosphonates 18. Thus, treatment of diethyl 2bromopropenylphosphonate 25 with ethylmagnesium bromide in Et 2 O at room temperature produced the diethyl allenylphosphonate 17 (R = Et, R 1 = R 2 = R 3 = H) in 45% yield while treatment with the more basic NaH in the same conditions gave the diethyl 1-propynylphosphonate 18 (R = Et) in 90% yield (Scheme 14). [47b] Similarly, treatment of diisopropyl 2chloroallylphosphonate with 10% aqueous methanolic sodium carbonate at room temperature provoked facile dehydrochlorination with subsequent double bond isomerisation to afford diisopropyl 1-propynylphosphonate 18 (R = i-Pr) in essentially quantitative yields. [76] In the case of 2-chlorovinylphosphonic dichlorides, the conversion into 1-alkynylphosphonic dichlorides is effected by triethylamine in refluxing benzene. [77]

Scheme 14

Another procedure for the synthesis of dialkyl 1-propynylphosphonate 18 is based upon a simple dehydrochlorination of dialkyl 1-chloro-cis-propenylphosphonate or a double dehydrochlorination-detosylation of dialkyl reaction conditions for the elimination reaction, which involves alkali metal hydroxides or amides in MeOH at room temperature, are relatively mild. [78] An even gentler method for the dehydrochlorination of the diethyl 2-bromopropenoate 26 to 2-propynoate 27 employs triethylamine in refluxing Et 2 O [79] or DBU in Et 2 O at low temperature. [80] The results are better with the former reagent (Scheme 15).

Scheme 15

Diethyl trichloromethylphosphonate 28 appears to be a very useful reagent for the generation of a triple bond from an α-chlorovinylphosphonate 30. The lithiated βhydroxyphosphonates, which are obtained by the addition of the diethyl 1lithiochloro(trimethylsilyl)methylphosphonate 29 to aromatic or heteroaromatic aldehydes, undergo a Peterson reaction to give α-chlorovinylphosphonates 32 as a mixture of Z and E isomers. These latter compounds readily undergo dehydrochlorination at low temperature with LiHMDS or LDA to produce high overall yields (89-96%) of a wide range of novel diethyl 1-alkynylphosphonates 13 bearing an aromatic or heteroaromatic ring in the β position (Scheme 16). [81]

Scheme 16

An intramolecular Wittig reaction has been successfully applied to the synthesis of 1alkynylphosphonates 34 through pyrolysis of perfluoroacyl diphenoxyphosphorylmethylenetriphenylphosphoranes 33. The latter was prepared by a transylidation reaction between the phosphonium salt of 33 and the ylide 31. In general, this phosphonium salt was obtained by action of the perfluoroacetyl chloride 32 in excess on the ylide 31 at 50 °C in benzene. Pyrolysis of the resulting β-ketoylids 33 under nitrogen at reduced pressure (220°C / 10 -5 torr) then produces diphenyl perfluoroalkynylphosphonates 34 in good yield (78-85%) (Scheme 17). [82] (EtO)

Scheme 17

The thermal syn-elimination of selenoxide from α-phosphorylvinyl selenoxides in refluxing benzene solution to give 1-alkynylphosphonates has also been reported. However, the thermolysis reaction, which eliminates selenium-containing by-products, only occurs with the E isomers of αphosphorylvinyl selenoxides. [83] III. Chemistry.

A. Reactions of the Triple Bond

Reduction

Partial reduction of the triple bond has been used for the selective conversion of 1alkynylphosphonates into cis-1-alkenylphosphonates. The first racemic synthesis of the antibiotic fosfomycin 39 in 1969 serves as an illustration. The methodology was based on the stereospecific reduction of dibutyl 1-propynylphosphonate 37 into dibutyl Z-1-propenylphosphonate 38 using the Lindlar catalyst (Pd / CaCO 3 poisoned with lead acetate) in MeOH. [66,84,] Dibutyl 1propynylphosphonate 37 was obtained in reasonable yield (49%) by reaction of propynylmagnesium bromide 35 with dibutyl chlorophosphate 36 in a C 6 H 6 / THF solution (section B. 1) (Scheme 18). [84,85]

Scheme 18

Unfortunately, the subsequent step using the Lindlar catalyst met with little success and nonstereoselective partial reduction of the triple bond was observed. [86] It was reported that most catalytic hydrogenations of 1-alkynylphosphonates 3 in EtOH using 5% Pd / CaCO 3 poisoned with 12.4M HCl quinoline gave mixtures comprising cis-and trans-1-alkenylphosphonate and starting material, from which the predominant cis isomer was isolated. [86,87] On the basis of these results a systematic analysis of the relative formation of these three products from the reduction of tetraethyl acetylenediphosphonate 7 was undertaken using a range of catalysts (Pd / CaCO 3 , Lindlar, Pd / BaSO 4 / Pb, Pd / BaSO 4 , Pd / BaCO 3 , Pd / SrCO 3 ). [88] It appeared that quinoline-poisoned Pd / BaSO 4 was superior to the other catalysts for the selective reduction of the alkyne to the desired cisalkenediphosphonate. Hydrogenation of di-n-butyl-3-hydroxy-1-propynylphosphonate using Pd / BaSO 4 and quinoline in MeOH afforded the desired cis-olefin in 95% yield. [89] Similarly, diethyl 4methanesulfonyl-1-butenylphosphonate was partially hydrogenated with 63% yield using Pd / BaSO 4 in THF / pyridine. [90]

Hydration

The effectiveness of 1-alkynylphosphonates 3 as acetonyl equivalents for the preparation of 2-oxoalkylphosphonates has been long established. Since 2-oxoalkylphosphonates themselves are versatile synthetic intermediates, especially as the reagents of choice for promoting a number of Horner-Wadsworth-Emmons cyclisation reactions, procedures that effect the direct conversion of dialkyl 1-alkynylphosphonates 3 into 2-oxoalkylphosphonates are of special importance. The procedure for the hydration of 1-alkynylphosphonates 3 has remained unchanged since the first report in 1966 (Scheme 19). [32] Thus, treatment of diethyl 1-alkynylphosphonates 13 with aqueous H 2 SO 4 in MeOH in the presence of HgSO 4 gave, after reflux for 15 h [32] or at room temperature for 48 h, [60,91] a quantitative yield of pure diethyl 2-oxoalkylphosphonates 23. In all cases studied, the acetylenic phosphonates were transformed without formation of the isomeric ketophosphonates. When the phosphorus substrate contains an acid sensitive group, the hydration reaction can be performed in good yield at room temperature in aqueous THF in the presence of HgCl 2 (1 eq.) and pyridine (1.5 eq.). [92]

Scheme 19

Sensitive enyne phosphonates have been converted into γ,δ-ethylene-β-ketophosphonates in reasonable yields (25-70%) by treatment with a mixture of HgO / ClCH 2 CO 2 H / BF 3 . Et 2 O / ROH in refluxing EtOH. [93]

Cycloaddition Reactions a. [2+2]

The cycloaddition of enamines 40 with activated alkynes, such as dimethyl acetylenedicarboxylate, is reported to occur at room temperature. In contrast, the less reactive diethyl 1-alkynylphosphonates 13 require reaction temperatures of at least 85°C to permit cycloaddition. Under such conditions, spontaneous ring opening of the thermally unstable cyclobutene intermediate 41 affords the ring enlarged product 42. Acid hydrolysis of the product enamine gave the unsaturated β-ketophosphonate 43 (Scheme 20). [63] The best results for the

(EtO) 2 P O C C R 1 (EtO) 2 P O CH 2 C R 1 O R 1 = Me, n-Bu, n-Pent, n-Hex, Ph 100% 13 23
H 3 O + Hg 2+
cycloaddition were obtained with rigorous exclusion of moisture and with temperatures held below 100°C. Reaction times varied from 24 h (R 1 = H) to 8 days (R 1 = CH 2 OMe). [63] Scheme 20

The reaction must be carefully controlled in order to optimise the yield. Cycloadditions with substituted diethyl 1-alkynylphosphonates 13 are less satisfactory, for example R 1 = H, yield = 77% and R 1 = Ph, yield = 17% (for n = 1).

b. [3+2]

Cycloadditions of diazo-and azidocompounds with acetylenes constitute a well-established method for the synthesis of pyrazoles and triazoles. Addition of diazomethane to ethynylphosphonates provides a convenient method for synthesizing phosphonopyrazoles. [54,94] Thus, diisopropyl ethynylphosphonate 44 reacted smoothly with an excess of diazomethane to give the 1-methyl-5-phosphonopyrazole 45 in 28% yield, with the diazomethane acting as an Nmethylation reagent for the first-formed phosphonopyrazole (Scheme 21). [54] The tetramethyl acetylenediphosphonate 54 reacts spontaneously with diazomethane in cooled Et 2 O to give the 4,5diphosphonopyrazole 46 in 95% yield (Figure 1). [11]

Scheme 21

Cycloadditions of ethyl diazoacetate with 1-alkynylphosphonates 3 have also been studied. [95,96,97] The data indicate that the cycloaddition of ethyl diazoacetate with diethyl ethynyl-10, 1-propynylphosphonates 18 (R = Et) and perfluoroalkynylphosphonates 34, wherein the imino group participates in a strong intermolecular hydrogen bond, gives tautomeric pyrazolylphosphonates 47 in 58-92% yields, as a mixture of regioisomers. Because of its instability, the intermediate 3H-pyrazole is isomerized rapidly to the 1H-pyrazole. The electronaccepting ethoxycarbonyl group, by conferring acidic character on the C 3 -H bond, facilitates this

(EtO) 2 P O C C R 1 R 1 = H, n-Pr, CH 2 OMe, Ph N N R 1 P(OEt) 2 O + 85-100°C neat N R 1 P(OEt) 2 O O R 1 P(OEt) 2 O THF, H 2 O p-TsOH 13 40 41 42 43 C C (i-PrO) 2 P O N N N N CH 2 H (i-PrO) 2 P Me 2 28% r.t., Et 2 O O 44
aromatisation to give the 1H-pyrazole 47. A study of the influence of the phosphorus substituent (Cl, EtO, i-PrO, n-BuO, Et, Ph) upon the cycloaddition reaction has appeared. Ethyl diazoacetate reacts most easily with 1-alkynylphosphonates bearing dichloro substituents at phosphorus, while the reaction with diethyl substituents requires more severe conditions. [95] Figure 1

Other 1,3-dipoles such as C-aryl-N-phenylnitrones, [98] para-substituted phenylazides, [99,100] azidoalkylcarboxylates [97,101] and azidoalkylphosphonates, [102] C-substituted-N-arylnitrilimines, [103] para-substituted benzonitrile oxide [57,97] and N-phenylsydnone [104] react with diethyl 1alkynylphosphonates 13. They gave respectively, 5-isoxazolinephosphonates 48 in 42-72% yield, [98] 1-aryl-4-triazolylphosphonates 49, [95][96][97] 1-carboxyalkyl- [97,101] and 1-phosphonoalkyl-4triazolylphosphonates, [102] 4-or 5-pyrazolylphosphonates 50 and 51, [103] 4-isoxazolinephosphonate in 80-92% yields [57,97] and 3-pyrazolylphosphonates in 53% yield [104] (Figure 2). The reactivity of phosphorylated propynes and the chemo-and regioselectivity of these reactions is controlled both by donor-acceptor interactions between the reactants and the steric requirements of their substituents.

Figure 2 c. [4+2]

The facile Diels-Alder reaction of dialkyl 1-alkynylphosphonates 3 means that organophosphorus-substituted acetylenes are potentially useful precursors for introducing organophosphorus substituents into diverse organic structures. This chemistry has been developed mainly with dienophiles such as ethynyl-, [61] haloethynyl-, [10,11] formylethynyl-, [86] sulfonylethynyl-, [61] sulfoxylethynyl-, [61] phenylethynylphosphonates [105] and acetylenebisphosphonates. [11,19] Only one activating group on the alkyne is necessary for the cycloaddition to occur and the monophosphorylated acetylene reacts as readily as the diphosphorylated. Dienes such as isoprene, [86] 2,3-dimethyl-1,3-butadiene, [10] cyclopentadiene, [11] 1,3-cyclohexadiene, [10] anthracene, [61] 9-methylanthracene [61] 1-phenyl-3,4-dimethylphosphole [105] and α-pyrone [19] have been employed (Figure 3). The reactions may be conducted with, or more rarely without, a solvent. Benzene, toluene, or xylene at reflux are generally preferred and yields are usually good to excellent (65-93%). The strong points of this synthetic procedure are clearly illustrated by the preparation of orthophenylenediphosphonate 54 in 93% yield (Scheme 22) [11] from the reaction of 52 with 1,3cyclohexadiene 53 at 150°C. For 9-methylanthracene, the reaction is highly selective and the cycloadduct contains only one isomer. [61] The Diels-Alder reaction has been investigated in particular detail for sulphonylethynyl-and sulphoxylethynylphosphonates. [61] Scheme 22

d. Intramolecular Ene Reaction

Depending upon the position of unsaturation, two different examples of intramolecular enetype reactions of enynes have been described. The first involves an intramolecular ene reaction of 1,6-enynes whose triple and double bonds comprise part of the same phosphorus substituent. Catalytic amounts of Pd(OAc) 2 in the presence of Ph 3 P were used for the cyclisation. In toluene, slight heating (60°C) for 4 h allowed complete reaction at a reasonable rate. Comparative tests showed that Pd(OAc) 2 and Ph 3 P gave the best results among all the ligands employed. The yield of isolated methylcyclopentylidenephosphonate from a gram-scale reaction was 68%. [62] In the second reaction type, the ene and yne functionalities form part of two different phosphorus substituents (Scheme 23). The 1-alkynylphosphonate 55 underwent facile Pd(OAc) 2 -LiCl catalyzed cyclisation to give the oxaphospholanes 56 in good (77-89%) yield but with low stereoselectivity (Z to E ratios at the exo double bonds being approximately 60 / 40). [106]

Scheme 23

AcOH appears to be the best solvent, and the reaction does not proceed particularly well in MeCN, C 6 H 6 , EtOH, THF or MeNO 2 . The mechanism may involve cis-and trans- halogenopalladation of the triple bond, followed by insertion of the double bond into the C-Pd bond followed by dehalopalladation to regenerate the catalyst. [106]

Addition Reactions

Three types of compounds, dialkyl ethynyl-, 1-alkynylphosphonates and 2chloroethynylphosphonates predominate within this category. Treatment of diethyl ethynylphosphonates 10 with chlorine in CCl 4 [9] or bromine in Et 2 O [54] leads to the formation of isomeric E and Z-1,2-dihalovinylphosphonates in good yields. By selecting the correct conditions, either one or two molecules of EtOH can be added across the triple bond in the presence of EtONa to give, respectively, the 2-ethoxyvinylphosphonates and 2,2-diethoxyethylphosphonates. [54] The related addition of EtSH gives 2-ethylthiovinylphosphonates, but the product is most conveniently obtained as a mixture of both isomers by adding the ethynyl compound to an excess of the thiol containing dissolved sodium. [54] Recently, an efficient stereoselective hydrohalogenation reaction of dialkyl ethynylphosphonates affording the Z-halovinylphosphonates has been reported. [107] Thus, heating diethyl ethynylphosphonate 10 with LiI in AcOH at 70°C for 14 h affords diethyl 2iodovinylphosphonate as the sole product in 85% yield. The corresponding bromo and chloro analogues were also prepared in high regiostereoselectivity, although in lower yields: 50% for the bromo and 30% for the chloro derivatives. [107] Michael addition to the triple bond has also been utilized to prepare alkenylphosphonic acids analogues of nucleosides. Thus, the conjugate addition of heterocyclic bases (adenine, uracil, cytosine, thymine) to diethyl ethynylphosphonate 10 has been investigated in depth. Using t-BuOK as base, 18-crown-6 as catalyst, MeCN or DMF as solvents, the alkylation of heterocyclic bases led to two isomers (Z and E) in moderate yields (32-41%) in approximate Z / E > 1 ratio. The yields are improved to 70-80% using K 2 CO 3 as base in DMF at room temperature. [16,108] A relatively general procedure for the conversion of diethyl 1-alkynylphosphonates 13 to diethyl 2-oxoalkylphosphonates 23 using enaminophosphonates has been developed. When 1alkynylphosphonates 13 were heated under reflux with a ten molar excess of primary or secondary amine, enaminophosphonates were produced in fair to good yields. [109] The addition to the triple bond was complete in 20 h for Et 2 NH [110] and in 3-5 days for n-BuNH 2 . [109] The subsequent hydrolysis of the resulting enaminophosphonates with oxalic acid in a two phase system at room temperature affords the diethyl 2-oxoalkylphosphonates 23 in excellent yields (76-94%). [109] Dialkyl 1-alkynylphosphonates 3 are capable of adding other nucleophilic reagents, in particular diethyl phosphite [111] and ethyl mercaptan, [112] forming products of the addition of one or two molecules of the reagent at the triple bond. [111] For example, 1-tert-butylacetylenephosphonate is subject to a nucleophilic attack by the sodium diethyl phosphite 12 in THF at room temperature for 24 h to give a triphosphonate in good yield. [29] A decrease in the activity of sodium diethyl phosphite 12 was observed in ethanolic solutions. The triple bond is attacked by the sodium diethyl phosphite 12 in the β position with respect to the bulky group and not β to the phosphoryl group. Steric hindrance predominates over the electronic directing influence of the phosphoryl group. The addition of mercaptans proceeds more readily and in the presence of excess mercaptans, addition results in the formation of only 2,2-dithioalkoxypropanes. [112] By way of contrast, heating equimolar amounts of dialkyl 1-propynylphosphonates 3 with alcohols in the presence of sodium alkoxide at 60-70°C leads to only one addition product : 2-alkoxypropene. [112] In the reaction of benzenesulfenyl chloride with diethyl 1-propynylphosphonate 18 (R = Et), the two regioisomeric adducts showing an E arrangement of the phenylthio group and the chlorine atom relative to the double bond were obtained. [113] Alkyl or aryl chalcogenate (S, Se, Te) anions add to diethyl 1alkynylphosphonates 13 to give diethyl 2-chalcogenylvinylphosphonates in satisfactory yields (26-70%). The reaction is stereoselective, giving predominantly or exclusively the Z stereoisomer. [114] Diethyl 1-alkynylphosphonates 13 react readily with an excess of alkyl-or arylmagnesium halides in the presence of CuCl at -30°C in Et 2 O to provide high yields (75-95%) of β-alkylated or arylated diethyl 1-alkenylphosphonates. The addition is highly stereoselective producing almost exclusively the product of cis addition. Stoichiometric lithium dialkyl-or diarylcuprates can also react with 13 in Et 2 O at low temperature to produce 1-alkenylphosphonates in high regio-ans stereoselectivity. The intermediate alkenylcuprates are particularly suited to provide trisubstituted diethyl 1alkenylphosphonates by reaction with a wide range of electrophiles. [87] The phosphorus-containing ynamines have been prepared through the reaction of diethyl 2chloroethynylphosphonates 6 with dialkylamines. [115] Some of these compounds were also prepared by heating 6 with trimethylamine (100% excess) in a sealed tube at 150-160°C. [116] Formation of ynaminophosphonates by electrosynthesis has also been reported. [117] The ynaminophosphonates readily undergo all of the reactions characteristic of ynamines: hydration by water with the formation of acetamides, addition of alcohol with the formation of the corresponding vinyl ethers. [115] The use of tert-butylamine in the reaction with 6 also induces the replacement of halogen, but the reaction is accompanied by isomerisation, giving almost quantitative yields of stable ketenimines. [118,119] The presence of two hydrogen atoms at the nitrogen in the amines permits subsequent prototropic isomerisation with the formation of ketenimines. By way of contrast, reactions with primary phosphines lead to halogen-replaced products with the retention of C≡C bond and P-H bonds. [119] The reaction of ketenimines with water in the presence of catalytic amount of HCl proceeds smoothly and leads to a high yield of the corresponding amide. [120] Reactions of 2-chloroethynylphosphonates 6 have also been studied with a number of charged (EtO -, t-BuO -, PhO -) [121] and neutral [122] nucleophiles containing one or two nucleophilic centers. Treatment of diethyl 2-chloroethynylphosphonate 6 with binucleophilic reagents such orthophenylenediamine, ortho-aminophenol, 2-aminoethanol leads to phosphorylated benzimidazoles, benzoxazoles and 4,5-dihydroxazoles by a mechanism involving initial substitution of the halogen followed by addition of the second nucleophilic center at the same carbon atom. [122]

B. Isomerisation of 1-Alkynylphosphonates

Due to the ready accessibility of 1-alkynylphosphonates 13, their isomerisation to conjugated dienes represents an useful synthetic transformation. In the presence of Pd 2 (dba) 3 CHCl 3 , the thermal isomerisation of diethyl 1-alkynylphosphonates 13 (R 1 = Me, Et, n-Pr, n-Bu) into diethyl 1E,3E-alkadienylphosphonates occurs at 30 °C in toluene, whereas at 110 °C isomeric 2E,3E-alkadienylphosphonates are formed. The transformation is effected with good yields (79-92%), but requires lengthy reaction times (24-69 h). [123] The same isomerisation reaction has been effected with Bu 3 P. [124] C. Reactions of 3-halogenopropynylphosphonates 3-Halogenopropynylphosphonates have been used as phosphonate-containing acetonyl equivalents. 3-Hydroxypropynylphosphonate intermediates, readily obtained through the reaction of lithium reagents of protected propargyl alcohol upon chlorophosphate (section B. 2) are converted into mesylates, and then to iodide 57 by displacement with sodium iodide, [60] or bromide using Ph 3 P / CBr 4 in CH 2 Cl 2 . [125] Subsequent treatment of the diethyl 3-iodopropynylphosphonate 57 with ketone enolates (formed using KHMDS / triethylborane in THF) gave the corresponding alkylation products 58 which were hydrolyzed to the expected β-ketophosphonates 59 (Scheme 24). [60] The reaction has been successfully extended to the preparation of diketophosphonates [92] as well as amino derivatives of phosphonopentynoic acid. [125] Scheme 24

Metallation of diethyl 1-propynylphosphonate 18 (R = Et) has been achieved by treatment with alkaline amides (Li, Na, K) and calcium in liquid ammonia, with isopropylmagnesium chloride in Et 2 O or via metal exchange from the potassium derivative of diethyl 1-propynylphosphonate 18 (R = Et) with copper (I) and cobalt (II) chloride. The alkylation of the potassium derivative with alkyl halides and the hydroxyalkylation with benzaldehyde occur with low yields at the γ-position of the parent compound. [126]

D. Reactions at Phosphorus

Bromo-and iodotrimethylsilane, reagents compatible with alkyne and other functionalities, are suitable for the mild P-O dealkylation of symmetrical 1-alkynylphosphonates 3 to give the corresponding phosphonic acids. [127][128][129] The greater reactivity of iodotrimethylsilane will probably prove advantageous for the low-temperature dealkylation of phosphonates having triple bonds. Transesterification of diethyl 2-propynylphosphonate with iodotrimethylsilane followed by solvolysis with MeOH led quantitatively to the 1-propynylphosphonic acid. [128] Two procedures for the transformation of diesters of 1-alkynylphosphonates 3 into monoesters have been described. They involve the selective replacement of one ethoxy group by chlorine without addition to the triple bond. Treatment of diethyl 1-propynylphosphonate 18 (R = Et) with POCl 3 neat (1.2 eq.) at 60°C for 3 h gives the ethyl 1-propynylphosphonochloridate 60 in 79% yield. [130] Similarly, treatment of 18 (R = Et) with trichloro(orthophenylenedioxy)phosphorane for 24 h gives 60 in 74% yield. [131] The transformation into phosphonic dichlorides 61 is achieved by the reaction of 18 (R = Et) with PCl 5 on heating at 110-135°C for 1 h (Figure 4). [132] Figure 4

IV. Conclusion

The methodologies for the preparation of 1-alkynylphosphonates constitute a valuable class of synthetic reactions. Irrespective of the nature of the alkyne, the elimination route seems to be the most flexible and promising. It would be of interest to apply these approaches to develop a general procedure giving access to 1-alkynylphosphonates containing indifferently alkyl or aryl groups. 1-Alkynylphosphonates possess remarkable potential and, in addition to the useful transformation involving simple reduction and hydration reactions of the triple bond, cycloaddition reactions

  n-Pr, n-Bu, t-Bu, n-Hex, BnOCH 2 , Me 2 C(OH), THPO(CH 2 ) 2 , Ph, Ph-S ...

  Figure 3

  very attractive synthetic procedures. The use of 1-alkynylphosphonates might be developed more largely in [2+2] and [4+2] reactions and employed in [2+2+2] enynes reactions to prepare new phosphorus reagents and new phosphorus-containing heterocycles.

  1-chloro-2-mesityloxypropylphosphonates. The

	(EtO) 2 P O	CH 2 C O 23	R 1	NaH, THF (EtO) 2 P Cl O 19	(EtO) 2 P O	CH C O 24	R 1 P(OEt) 2 O
	-78°C, THF t-BuOK	13 (EtO) 2 P O	C C R 1 72-95%
	R 1 =Me, i-Pr, t-Bu, Ph
	(RO) 3 P	+	Br	CH 2 C CH 2	(RO) 2 P	CH 2 C	CH 2
	4 R = Et, i-Pr		Br		25	O	Br
	EtMgBr Et 2 O	(RO) 2 P O 17	CH C CH 2 45%
	NaH Et 2 O	(RO) 2 P O 18	C C Me 90%

35 36 37 38 39

									Ph 3 P	O	Cl
	2	Ph 3 P CH	P(OPh) 2		R F COCl	+	Ph 3 P	CH 2	P(OPh) 2
			31	O					32	(PhO) 2 P	R F	O
									O	33
		220°C 10 -5 torr	(PhO) 2 P O 34	C C R F 78-85%	Ph 3 PO
	R F = CF 3 , CF 3 CF 2 , n-C 3 F 7
	Me	C CMgBr	+	Cl	P(OBu) 2 O	C 6 H 6 /THF r.t.	Me	C C P(OBu) 2 O 49%
	H 2 / MeOH Lindlar catalyst	Me H	C C	H P(OBu) 2	117°C
					84.2%		O
	H Me	C C	H P(OH) 2 O	1) H 2 O 2 , pH 5.5 Na 2 WO 4 , 55°C 2) resolution	Me H	C C O	H P(OH) 2 O

Acknowledgments

We are grateful to Elf Atochem S.A. for financial support to B. I., to M. Multan from the Ecole Polytechnique (BCX) for assistance in collecting the literature and the Centre National de la Recherche Scientifique (CNRS).