std::vector assign() method

  • since C++20
  • since C++11
  • until C++11

Replaces the contents of the container with the contents of another.

(1) Replaces the contents with count copies of value value .

(2) Replaces the contents with copies of those in the range [ first, last ) .

The behavior is undefined

This overload participates in overload resolution only if InputIt satisfies LegacyInputIterator .

This overload has the same effect as overload (1) if InputIt is an integral type.

(3) Replaces the contents with the elements from the initializer list ilist .

All iterators , pointers and references to the elements of the container are invalidated. The past-the-end iterator is also invalidated.

Parameters ​

  • count - the new size of the container
  • value - the value to initialize elements of the container with
  • first , last - the range to copy the elements from
  • ilist - initializer list to copy the values from

Return value ​

Complexity ​.

  • (1) Linear in count - O(count) .
  • (2) Linear in distance between first and last - O(std::distance(firs,t last)) .
  • (3) Linear in ilist.size() - O(ilist.size()) .

Exceptions ​

  • Return value

std::vector:: assign

Replaces the contents of the container.

1) replaces the contents with count copies of value value

2) replaces the contents with copies of those in the range [first, last)

3) replaces the contents with the elements from the initializer list ilist .

[ edit ] Parameters

[ edit ] complexity.

1) linear in count

2) linear in distance between first and last

3) linear in ilist. size ( )

[ edit ] Example

The following code uses assign to add several characters to a std:: vector < char > :

[ edit ] See also

std::vector<T,Allocator>:: assign

Replaces the contents of the container.

All iterators, pointers and references to the elements of the container are invalidated. The past-the-end iterator is also invalidated.

The following code uses assign to add several characters to a std:: vector < char > :

vector assign for

YetiCodeCamp - C++ for Beginners

Companion website for the c++ for beginners youtube video series., c++ vector assign() function.

The C++ vector.assign() function assigns new values to the vector replacing any existing values.

It is important to keep in mind that the vector assign function will erase any existing data before assigning the new values, if you want to keep the existing value you may want to consider using the vector insert() instead.

Example usage of a vector “v1” and the assign function:

This example uses the assign function with the count and value parameters. The first parameter, ‘10’ is the count or number of elements we want to insert into the vector. The second parameter, ‘42’ is the actual value we want to assign. This example will assign 10 elements of value 42 into the vector.

Output: 42 42 42 42 42 42 42 42 42 42

This second example uses the assign function with the first and last parameters to assign the value of another vector (v1) to vector v2. We are also using the vector begin and end functions to retrieve the starting and ending values of vector v1 and using them in the vector assign() parameter list.

Output: 1 2 3 4 5

This third and last example uses the assign function with an initializer list. Here we are simply assigning 5 values to the vector, which will replace the existing values that were assigned to the vector in the declaration.

Output: 5 6 7 8 9

Learn C++ practically and Get Certified .

Popular Tutorials

Popular examples, reference materials, learn c++ interactively, introduction to c++.

  • Getting Started With C++
  • Your First C++ Program
  • C++ Comments

C++ Fundamentals

  • C++ Keywords and Identifiers
  • C++ Variables, Literals and Constants
  • C++ Data Types
  • C++ Type Modifiers
  • C++ Constants
  • C++ Basic Input/Output
  • C++ Operators

Flow Control

  • C++ Relational and Logical Operators
  • C++ if, if...else and Nested if...else
  • C++ for Loop
  • C++ while and do...while Loop
  • C++ break Statement
  • C++ continue Statement
  • C++ goto Statement
  • C++ switch..case Statement
  • C++ Ternary Operator
  • C++ Functions
  • C++ Programming Default Arguments
  • C++ Function Overloading
  • C++ Inline Functions
  • C++ Recursion

Arrays and Strings

  • C++ Array to Function
  • C++ Multidimensional Arrays
  • C++ String Class

Pointers and References

  • C++ Pointers
  • C++ Pointers and Arrays
  • C++ References: Using Pointers
  • C++ Call by Reference: Using pointers
  • C++ Memory Management: new and delete

Structures and Enumerations

  • C++ Structures
  • C++ Structure and Function
  • C++ Pointers to Structure
  • C++ Enumeration

Object Oriented Programming

  • C++ Classes and Objects
  • C++ Constructors
  • C++ Constructor Overloading
  • C++ Destructors
  • C++ Access Modifiers
  • C++ Encapsulation
  • C++ friend Function and friend Classes

Inheritance & Polymorphism

  • C++ Inheritance
  • C++ Public, Protected and Private Inheritance
  • C++ Multiple, Multilevel and Hierarchical Inheritance
  • C++ Function Overriding
  • C++ Virtual Functions
  • C++ Abstract Class and Pure Virtual Function

STL - Vector, Queue & Stack

C++ Standard Template Library

  • C++ STL Containers
  • C++ std::array

C++ Vectors

  • C++ Forward List
  • C++ Priority Queue

STL - Map & Set

  • C++ Multimap
  • C++ Multiset
  • C++ Unordered Map
  • C++ Unordered Set
  • C++ Unordered Multiset
  • C++ Unordered Multimap

STL - Iterators & Algorithms

C++ Iterators

C++ Algorithm

  • C++ Functor

Additional Topics

  • C++ Exceptions Handling
  • C++ File Handling

C++ Ranged for Loop

  • C++ Nested Loop
  • C++ Function Template
  • C++ Class Templates
  • C++ Type Conversion
  • C++ Type Conversion Operators
  • C++ Operator Overloading

Advanced Topics

  • C++ Namespaces
  • C++ Preprocessors and Macros
  • C++ Storage Class
  • C++ Bitwise Operators
  • C++ Buffers
  • C++ istream
  • C++ ostream

C++ Tutorials

In C++, vectors are used to store elements of similar data types. However, unlike arrays , the size of a vector can grow dynamically.

That is, we can change the size of the vector during the execution of a program as per our requirements.

Vectors are part of the C++ Standard Template Library . To use vectors, we need to include the vector header file in our program.

  • C++ Vector Declaration

Once we include the header file, here's how we can declare a vector in C++:

The type parameter <T> specifies the type of the vector. It can be any primitive data type such as int , char , float , etc. For example,

Here, num is the name of the vector.

Notice that we have not specified the size of the vector during the declaration. This is because the size of a vector can grow dynamically, so it is not necessary to define it.

  • C++ Vector Initialization

There are different ways to initialize a vector in C++.

Here, we are initializing the vector by providing values directly to the vector. Now, both vector1 and vector2 are initialized with values 1 , 2 , 3 , 4 , 5 .

Here, 5 is the size of the vector and 12 is the value.

This code creates an int vector with size 5 and initializes the vector with the value of 12 . So, the vector is equivalent to

Example: C++ Vector Initialization

Here, we have declared and initialized three different vectors using three different initialization methods and displayed their contents.

Basic Vector Operations

The vector class provides various methods to perform different operations on vectors. We will look at some commonly used vector operations in this tutorial:

  • Add elements
  • Access elements
  • Change elements
  • Remove elements

1. Add Elements to a Vector

To add a single element into a vector, we use the push_back() function. It inserts an element into the end of the vector. For example,

Here, we have initialized an int vector num with the elements {1, 2, 3, 4, 5} . Notice the statements

Here, the push_back() function adds elements 6 and 7 to the vector.

Note : We can also use the insert() and emplace() functions to add elements to a vector.

2. Access Elements of a Vector

In C++, we use the index number to access the vector elements. Here, we use the at() function to access the element from the specified index. For example,

  • num.at(0) - access element at index 0
  • num.at(2) - access element at index 2
  • num.at(4) - access element at index 4

Note: Like an array, we can also use the square brackets [] to access vector elements. For example,

However, the at() function is preferred over [] because at() throws an exception whenever the vector is out of bound, while [] gives a garbage value.

3. Change Vector Element

We can change an element of the vector using the same at() function. For example,

In the above example, notice the statements,

Here, we have assigned new values to indexes 1 and 4 . So the value at index 1 is changed to 9 and the value at index 4 is changed to 7 .

4. Delete Elements from C++ Vectors

To delete a single element from a vector, we use the pop_back() function. For example,

In the above example, notice the statement,

Here, we have removed the last element ( 7 ) from the vector.

  • C++ Vector Functions

In C++, the vector header file provides various functions that can be used to perform different operations on a vector.

  • C++ Vector Iterators

Vector iterators are used to point to the memory address of a vector element. In some ways, they act like pointers in C++.

We can create vector iterators with the syntax

For example, if we have 2 vectors of int and double types, then we will need 2 different iterators corresponding to their types:

Initialize Vector Iterators

We can initialize vector iterators using the begin() and end() functions.

1. begin() function

The begin() function returns an iterator that points to the first element of the vector. For example,

2. end() function

The end() function points to the theoretical element that comes after the final element of the vector. For example,

Here, due to the nature of the end() function, we have used the code num.end() - 1 to point to the last element of the num vector i.e. num[2] .

Example: C++ Vector Iterators

In this program, we have declared an int vector iterator iter to use it with the vector num .

Then, we initialized the iterator to the first element of the vector using the begin() function.

Then, we printed the vector element by dereferencing the iterator:

Then, we printed the 3rd element of the vector by changing the value of iter to num.begin() + 2 .

Finally, we printed the last element of the vector using the end() function.

  • Example: Iterate Through Vector Using Iterators

Here, we have used a for loop to initialize and iterate the iterator iter from the beginning of the vector to the end of the vector using the begin() and end() functions.

Also Read :

Table of Contents

  • Introduction
  • Example: C++ Vector
  • Add Elements to a Vector
  • Access Elements of a Vector
  • Change Vector Element
  • Delete Elements from C++ Vectors

Sorry about that.

Related Tutorials

C++ Tutorial

cppreference.com

Std::vector<t,allocator>:: vector.

Constructs a new container from a variety of data sources, optionally using a user supplied allocator alloc .

[ edit ] Parameters

[ edit ] complexity.

  • If first and last are both forward, bidirectional or random-access iterators,
  • The copy constructor of T is only called N   times, and
  • No reallocation occurs.
  • Otherwise ( first and last are just input iterators),
  • The copy constructor of T is called O(N) times, and
  • Reallocation occurs O(log N) times.
  • If R models ranges::forward_range or ranges::sized_range ,
  • Initializes exactly N elements from the result of dereferencing successive iterators of rg , and
  • Otherwise ( R models input range),
  • The copy or move constructor of T is called O(N) times, and

[ edit ] Exceptions

Calls to Allocator :: allocate may throw.

[ edit ] Notes

After container move construction (overload (8) ), references, pointers, and iterators (other than the end iterator) to other remain valid, but refer to elements that are now in * this . The current standard makes this guarantee via the blanket statement in [container.reqmts]/67 , and a more direct guarantee is under consideration via LWG issue 2321 .

The overload (4) zeroes out elements of non-class types such as int , which is different from the behavior of new[] , which leaves them uninitialized. To match the behavior of new [ ] , a custom Allocator::construct can be provided which leaves such elements uninitialized.

Note that the presence of list-initializing constructor (10) means list initialization and direct initialization do different things:

[ edit ] Example

[ edit ] defect reports.

The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

[ edit ] See also

  • Recent changes
  • Offline version
  • What links here
  • Related changes
  • Upload file
  • Special pages
  • Printable version
  • Permanent link
  • Page information
  • In other languages
  • This page was last modified on 5 November 2023, at 12:01.
  • This page has been accessed 2,248,307 times.
  • Privacy policy
  • About cppreference.com
  • Disclaimers

Powered by MediaWiki

  • Standard Template Library
  • STL Priority Queue
  • STL Interview Questions
  • STL Cheatsheet
  • C++ Templates
  • C++ Functors
  • C++ Iterators

Vector in C++ STL

  • Initialize a vector in C++ (7 different ways)

Commonly Used Methods

  • vector::begin() and vector::end() in C++ STL
  • vector::empty() and vector::size() in C++ STL
  • vector::operator= and vector::operator[ ] in C++ STL
  • vector::front() and vector::back() in C++ STL
  • vector::push_back() and vector::pop_back() in C++ STL
  • vector insert() Function in C++ STL
  • vector emplace() function in C++ STL
  • vector :: assign() in C++ STL
  • vector erase() and clear() in C++

Other Member Methods

  • vector max_size() function in C++ STL
  • vector capacity() function in C++ STL
  • vector rbegin() and rend() function in C++ STL
  • vector :: cbegin() and vector :: cend() in C++ STL
  • vector::crend() & vector::crbegin() with example
  • vector : : resize() in C++ STL
  • vector shrink_to_fit() function in C++ STL
  • Using std::vector::reserve whenever possible
  • vector data() function in C++ STL
  • 2D Vector In C++ With User Defined Size
  • Passing Vector to a Function in C++
  • How does a vector work in C++?
  • How to implement our own Vector Class in C++?
  • Advantages of vector over array in C++

Common Vector Programs

  • Sorting a vector in C++
  • How to reverse a Vector using STL in C++?
  • How to find the minimum and maximum element of a Vector using STL in C++?
  • How to find index of a given element in a Vector in C++

Vectors are the same as dynamic arrays with the ability to resize themselves automatically when an element is inserted or deleted, with their storage being handled automatically by the container. Vector elements are placed in contiguous storage so that they can be accessed and traversed using iterators. In vectors, data is inserted at the end. Inserting at the end takes differential time, as sometimes the array may need to be extended. Removing the last element takes only constant time because no resizing happens. Inserting and erasing at the beginning or in the middle is linear in time.

What is std::vector in C++?

std::vector in C++ is the class template that contains the vector container and its member functions. It is defined inside the <vector> header file. The member functions of the std::vector class provide various functionalities to vector containers.

Syntax to Declare Vector in C++

where the data type is the type of data of each element of the vector. You can remove the std:: if you have already used the std namespace.

Initialization of Vector in C++

We can initialize a vector in the following ways:

1. Initialization Using List

This initialization is done with a declaration. Here, we pass the list of elements to the vector constructor to create a vector with the specified elements.

2. Initialization With a Single Value

This initialization is also done with declaration. Here, we specify the size of the vector and then initialize every element of the vector with the value.

3. Initialization From Another Vector

This initialization is used to create a vector that is an exact copy of other_vec.

Some commonly used member functions of std::vector class are written below:

  • begin() – Returns an iterator pointing to the first element in the vector
  • end() – Returns an iterator pointing to the theoretical element that follows the last element in the vector
  • rbegin() – Returns a reverse iterator pointing to the last element in the vector (reverse beginning). It moves from last to first element
  • rend() – Returns a reverse iterator pointing to the theoretical element preceding the first element in the vector (considered as reverse end)
  • cbegin() – Returns a constant iterator pointing to the first element in the vector.
  • cend() – Returns a constant iterator pointing to the theoretical element that follows the last element in the vector.
  • crbegin() – Returns a constant reverse iterator pointing to the last element in the vector (reverse beginning). It moves from last to first element
  • crend() – Returns a constant reverse iterator pointing to the theoretical element preceding the first element in the vector (considered as reverse end)
  • size() – Returns the number of elements in the vector.
  • max_size() – Returns the maximum number of elements that the vector can hold.
  • capacity() – Returns the size of the storage space currently allocated to the vector expressed as number of elements.
  • resize(n) – Resizes the container so that it contains ‘n’ elements.
  • empty() – Returns whether the container is empty.
  • shrink_to_fit() – Reduces the capacity of the container to fit its size and destroys all elements beyond the capacity.
  • reserve() – Requests that the vector capacity be at least enough to contain n elements.

Element access

  • reference operator [g] – Returns a reference to the element at position ‘g’ in the vector
  • at(g) – Returns a reference to the element at position ‘g’ in the vector
  • front() – Returns a reference to the first element in the vector
  • back() – Returns a reference to the last element in the vector
  • data() – Returns a direct pointer to the memory array used internally by the vector to store its owned elements.
  • assign() – It assigns new value to the vector elements by replacing old ones
  • push_back() – It push the elements into a vector from the back
  • pop_back() – It is used to pop or remove elements from a vector from the back.
  • insert() – It inserts new elements before the element at the specified position
  • erase() – It is used to remove elements from a container from the specified position or range.
  • swap() – It is used to swap the contents of one vector with another vector of same type. Sizes may differ.
  • clear() – It is used to remove all the elements of the vector container
  • emplace() – It extends the container by inserting new element at position
  • emplace_back() – It is used to insert a new element into the vector container, the new element is added to the end of the vector

The time complexity for doing various operations on vectors is-

  • Random access – constant O(1)
  • Insertion or removal of elements at the end – constant O(1)
  • Insertion or removal of elements – linear in the distance to the end of the vector O(N)
  • Knowing the size – constant O(1)
  • Resizing the vector- Linear O(N)  

All Member Functions of std::vector

Following is the list of all member functions of std::vector class in C++:

  • How to Check if a Vector Contains a Given Element in C++?

Please Login to comment...

Similar reads.

  • cpp-containers-library

Improve your Coding Skills with Practice

 alt=

What kind of Experience do you want to share?

vector assign for

  • News & Media
  • Military & Veterans Affairs
  • Natural Gas Royalty Lawsuit
  • Bureau of Consumer Protection
  • Civil Rights
  • Consumer Advisories
  • Home Improvement
  • Charitable Giving
  • Identity Theft
  • Insurance Fraud
  • Puppy Lemon Law
  • Opioid Battle
  • Healthcare Matters
  • Medicaid Fraud
  • Coronavirus Updates
  • Official AG Opinions
  • Commonly Asked Questions
  • Brochures & Publications
  • Fireworks Display Registration
  • Law Enforcement Treatment Initiative
  • Send Drug and Child Predator Anonymous Tips
  • Community Drug Abuse Prevention Grant Program
  • ACRE – Agriculture, Communities and Rural Environment
  • Pennsylvania State Coroners’ Education Board
  • Tobacco Enforcement
  • Concealed Carry Agreements
  • Voters’ Rights in Effect at the Polling Places on Election Days
  • Conviction Integrity Section
  • Pennsylvania Reentry Program
  • Home Improvement Contractor Registration
  • Health Club Registration
  • Telemarketing in PA
  • Uniform Planned Community Act
  • Home Improvement Contractor Registration Home Improvement Contractor Registration

Four People Plead Guilty, Sentenced for Multi-Million-Dollar Medicaid Fraud Scheme that Involved Inflated Transportation Costs, Other Phantom Services

HARRISBURG — Attorney General Michelle Henry announced that four people who conspired to defraud Medicaid of nearly $9 million have pleaded guilty and been sentenced for their roles in the scheme.

The scheme involved overcharging Medicaid for non-medical transportation plans that were scarcely used and medically unnecessary. The scheme revolved around three Philadelphia-based service coordination agencies: Brighter Care Services, Pennsylvania Service Coordination Agency, and Pennsylvania Development Agency, and a non-medical transportation service, Rides Your Way.

Jason Alexandre, Rex Barr, Earlson Satine, and Natasha Hudson were charged in 2021 with Medicaid fraud, theft by deception, and related offenses, and ultimately pleaded guilty.

Most recently, Alexandre, owner of Brighter Care, was sentenced to one to three years in prison, seven years of probation, and to pay $1.63 million restitution.

Barr, owner of Rides Your Way, was sentenced to five years of probation and 100 hours of community service. Barr previously repaid $2 million and will repay an additional $1 million, as a condition of his sentence.

“These defendants concocted an elaborate scheme that defrauded Medicaid and took money from vulnerable Pennsylvanians who could have benefited from the program,” Attorney General Henry said. “Those who steal from Medicaid are stealing from Pennsylvanians, including children who need essential services to improve their health and happiness.”

The Office of Attorney General investigation revealed that the service coordination agencies owned by the defendants utilized a non-medical transportation service provider called Rides Your Way, owned by Barr. The service coordination agencies enrolled their participants in Rides Your Way’s expensive non-medical transportation subscription plans, without regard to whether those services were appropriate.

The defendants split the millions of dollars in Medicaid reimbursement while providing minimal services.

Between 2017 and 2019, the service coordination agencies received over $7.9 million from Medicaid, supposedly for reimbursement for services provided by Rides Your Way. However, during that same time period, Rides Your Way only provided a total of 1,712 rides to Medicaid consumers. Most participants enrolled with Rides Your Way never used the service.

Additionally, Alexandre and Satine overbilled Medicaid in excess of $2 million in other services they did not provide.

The 45th Statewide Investigating Grand Jury recommended charges against all four individuals.

In February, Satine pleaded guilty to felony Medicaid fraud and theft by deception and was sentenced to 1½ to 5 years in state prison. He is required to pay $2.8 million dollars in restitution and previously repaid about $1.47 million to the Pennsylvania Department of Human Services in connection to this case.

Hudson pleaded guilty in 2022 to two misdemeanor counts of theft and was sentenced to four years’ supervision, with the first 11 ½ months on house arrest.

The cases were prosecuted by Senior Deputy Attorney General Benjamin McKenna.

The Pennsylvania Medicaid Fraud Control Unit receives 75 percent of its funding from the U.S. Department of Health and Human Services under a grant award totaling $10,632,312 for Federal fiscal year (FY) 2024. The remaining 25 percent, totaling $3,544,100 for FY 2024, is funded by Pennsylvania.

Contact the Press Office

Mailing Address: PA Office of Attorney General / Press Office 16th Floor, Strawberry Square Harrisburg, PA 17120

Phone: 717-787-5211 Fax: 717-787-8242 Email: [email protected]

vector assign for

Biomaterials Science

Non-viral vector-based genome editing for cancer immunotherapy.

ORCID logo

* Corresponding authors

a Department of Biomedical Engineering, McGill University, Montreal, QC, Canada E-mail: [email protected]

b Rosalind & Morris Goodman Cancer Institute, McGill University, Montreal, QC, Canada

Despite the exciting promise of cancer immunotherapy in the clinic, immune checkpoint blockade therapy and T cell-based therapies are often associated with low response rates, intrinsic and adaptive immune resistance, and systemic side effects. CRISPR-Cas-based genome editing appears to be an effective strategy to overcome these unmet clinical needs. As a safer delivery platform for the CRISPR-Cas system, non-viral nanoformulations have been recently explored to target tumor cells and immune cells, aiming to improve cancer immunotherapy on a gene level. In this review, we summarized the efforts of non-viral vector-based CRISPR-Cas-mediated genome editing in tumor cells and immune cells for cancer immunotherapy. Their design rationale and specific applications were highlighted.

Graphical abstract: Non-viral vector-based genome editing for cancer immunotherapy

  • This article is part of the themed collections: Biomaterials Science Recent Review Articles, 2024 and Biomaterials Science Emerging Investigator Series

Article information

Download citation, permissions.

vector assign for

T. Fang and G. Chen, Biomater. Sci. , 2024, Advance Article , DOI: 10.1039/D4BM00286E

To request permission to reproduce material from this article, please go to the Copyright Clearance Center request page .

If you are an author contributing to an RSC publication, you do not need to request permission provided correct acknowledgement is given.

If you are the author of this article, you do not need to request permission to reproduce figures and diagrams provided correct acknowledgement is given. If you want to reproduce the whole article in a third-party publication (excluding your thesis/dissertation for which permission is not required) please go to the Copyright Clearance Center request page .

Read more about how to correctly acknowledge RSC content .

Social activity

Search articles by author.

This article has not yet been cited.

Advertisements

Un-silence of the lambs: Donald Trump (again) praises fictional cannibal Hannibal Lecter

vector assign for

WASHINGTON - Former President Donald Trump replayed an odd campaign-and-movie riff over the weekend: Praise for a fictional cannibal and murderer, one of the most evil characters in the history of cinema.

Hannibal Lecter .

"The late, great Hannibal Lecter," Trump said during a rally Saturday in Wildwood, N..J., citing the psycho protagonist of the novel and Oscar-winning film "The Silence of the Lambs" while discussing immigration policy.

Trump praised Lecter - portrayed by Oscar-winning Anthony Hopkins in the 1991 film - while attacking migrants who are in the United States illegally.

"Has anyone ever seen ‘The Silence of the Lambs’?" Trump told a crowd of supporters. "The late, great Hannibal Lecter. He’s a wonderful man."

Prep for the polls: See who is running for president and compare where they stand on key issues in our Voter Guide

Trump, who did speak in mocking tones and did not appear to be serious, then made reference to the film's famous final scene in which Lecter follows his next victim down a crowded street.

"I'm having an old friend for dinner," Lecter's character had just said in a phone call with newly minted FBI agent Clarice Starling (portrayed by Jodie Foster in another Oscar-winning performance).

At his New Jersey rally, Trump said: “He often times would have a friend for dinner. Remember the last scene? ‘Excuse me, I’m about to have a friend for dinner,’ as this poor doctor walked by. ‘I’m about to have a friend for dinner.’"

Trump closed his tribute by saying: "But Hannibal Lecter. Congratulations. The late, great Hannibal Lecter.”

It was unclear whether Trump was saying the United States should act like Hannibal Lecter, or whether he was comparing some migrants to the crazed serial killer.

Trump has praised Lecter and The Silence of the Lambs in years past, calling the latter one of his favorite movies.

The former president has invoked Lecter while echoing his highly exaggerated claims that prisoners and mental patients are pouring across the U.S. border. "That's 'Silence Of The Lambs;' that's Hannibal Lecter," Trump said during the New Hampshire primary campaign.  "Did you ever hear of Hannibal Lecter? They're being dropped into our country. Hannibal Lecter is coming in."

During a 2023 event in Iowa, Trump confused the character with Hopkins by saying, "Hannibal Lecter, how great an actor was he?” The former president also mistakenly quoted the actor as saying he loved Trump, though there is no record of such a comment ever being made.

Trump's Saturday tribute in New Jersey to a movie character killer drew criticism from his opponents.

On the social media site X, foreign policy author Anne Applebaum wrote: "At what other moment in American history could a presidential candidate praise a fictional serial killer, and inspire almost no reaction at all?"

Help | Advanced Search

Mathematics > Representation Theory

Title: geometric model for vector bundles via infinite marked strips.

Abstract: We present a geometric model for the category of vector bundles over the weighted projective line of type (2,2,n). This model is based on the orbit space of an infinite marked strip under a specific group action. By establishing a bijection between indecomposable bundles and orbits of line segments on the strip, we interpret dimensions of extension spaces as intersection indices of these line segment orbits. Furthermore, our investigation yields geometric interpretations for various aspects, including the slope of indecomposable bundles, the Picard group action, vector bundle duality, projective covers and injective hulls of extension bundles.

Submission history

Access paper:.

  • Other Formats

References & Citations

  • Google Scholar
  • Semantic Scholar

BibTeX formatted citation

BibSonomy logo

Bibliographic and Citation Tools

Code, data and media associated with this article, recommenders and search tools.

  • Institution

arXivLabs: experimental projects with community collaborators

arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs .

<vector>

Std:: vector ::assign, return value, iterator validity, exception safety.

  • Information
  • <cassert> (assert.h)
  • <cctype> (ctype.h)
  • <cerrno> (errno.h)
  • <cfenv> (fenv.h)
  • <cfloat> (float.h)
  • <cinttypes> (inttypes.h)
  • <ciso646> (iso646.h)
  • <climits> (limits.h)
  • <clocale> (locale.h)
  • <cmath> (math.h)
  • <csetjmp> (setjmp.h)
  • <csignal> (signal.h)
  • <cstdarg> (stdarg.h)
  • <cstdbool> (stdbool.h)
  • <cstddef> (stddef.h)
  • <cstdint> (stdint.h)
  • <cstdio> (stdio.h)
  • <cstdlib> (stdlib.h)
  • <cstring> (string.h)
  • <ctgmath> (tgmath.h)
  • <ctime> (time.h)
  • <cuchar> (uchar.h)
  • <cwchar> (wchar.h)
  • <cwctype> (wctype.h)

Containers:

  • <array>
  • <deque>
  • <forward_list>
  • <list>
  • <map>
  • <queue>
  • <set>
  • <stack>
  • <unordered_map>
  • <unordered_set>

Input/Output:

  • <fstream>
  • <iomanip>
  • <ios>
  • <iosfwd>
  • <iostream>
  • <istream>
  • <ostream>
  • <sstream>
  • <streambuf>

Multi-threading:

  • <atomic>
  • <condition_variable>
  • <future>
  • <mutex>
  • <thread>
  • <algorithm>
  • <bitset>
  • <chrono>
  • <codecvt>
  • <complex>
  • <exception>
  • <functional>
  • <initializer_list>
  • <iterator>
  • <limits>
  • <locale>
  • <memory>
  • <new>
  • <numeric>
  • <random>
  • <ratio>
  • <regex>
  • <stdexcept>
  • <string>
  • <system_error>
  • <tuple>
  • <typeindex>
  • <typeinfo>
  • <type_traits>
  • <utility>
  • <valarray>
  • vector<bool>
  • vector::vector
  • vector::~vector

member functions:

  • vector::assign
  • vector::back
  • vector::begin
  • vector::capacity
  • vector::cbegin
  • vector::cend
  • vector::clear
  • vector::crbegin
  • vector::crend
  • vector::data
  • vector::emplace
  • vector::emplace_back
  • vector::empty
  • vector::end
  • vector::erase
  • vector::front
  • vector::get_allocator
  • vector::insert
  • vector::max_size
  • vector::operator=
  • vector::operator[]
  • vector::pop_back
  • vector::push_back
  • vector::rbegin
  • vector::rend
  • vector::reserve
  • vector::resize
  • vector::shrink_to_fit
  • vector::size
  • vector::swap

non-member overloads:

  • relational operators (vector)
  • swap (vector)

Thank you for visiting nature.com. You are using a browser version with limited support for CSS. To obtain the best experience, we recommend you use a more up to date browser (or turn off compatibility mode in Internet Explorer). In the meantime, to ensure continued support, we are displaying the site without styles and JavaScript.

  • View all journals
  • My Account Login
  • Explore content
  • About the journal
  • Publish with us
  • Sign up for alerts
  • Open access
  • Published: 06 November 2023

Integrated vector genomes may contribute to long-term expression in primate liver after AAV administration

  • Jenny A. Greig 1   na1 ,
  • Kelly M. Martins 1   na1 ,
  • Camilo Breton 1 ,
  • R. Jason Lamontagne   ORCID: orcid.org/0000-0002-9068-3348 1 ,
  • Yanqing Zhu 1 ,
  • Zhenning He 1 ,
  • John White 1 ,
  • Jing-Xu Zhu 1 ,
  • Jessica A. Chichester   ORCID: orcid.org/0000-0001-7879-120X 1 ,
  • Qi Zheng   ORCID: orcid.org/0000-0002-2582-1222 1 ,
  • Zhe Zhang 1 ,
  • Peter Bell 1 ,
  • Lili Wang   ORCID: orcid.org/0000-0001-9347-3939 1 &
  • James M. Wilson   ORCID: orcid.org/0000-0002-9630-3131 1  

Nature Biotechnology ( 2023 ) Cite this article

17k Accesses

7 Citations

49 Altmetric

Metrics details

  • Genetics research
  • Translational research

The development of liver-based adeno-associated virus (AAV) gene therapies is facing concerns about limited efficiency and durability of transgene expression. We evaluated nonhuman primates following intravenous dosing of AAV8 and AAVrh10 vectors for over 2 years to better define the mechanism(s) of transduction that affect performance. High transduction of non-immunogenic transgenes was achieved, although expression declined over the first 90 days to reach a lower but stable steady state. More than 10% of hepatocytes contained single nuclear domains of vector DNA that persisted despite the loss of transgene expression. Greater reductions in vector DNA and RNA were observed with immunogenic transgenes. Genomic integration of vector sequences, including complex concatemeric structures, were detected in 1 out of 100 cells at broadly distributed loci that were not in proximity to genes associated with hepatocellular carcinoma. Our studies suggest that AAV-mediated transgene expression in primate hepatocytes occurs in two phases: high but short-lived expression from episomal genomes, followed by much lower but stable expression, likely from integrated vectors.

Similar content being viewed by others

vector assign for

A high efficiency precision genome editing method with CRISPR in iPSCs

vector assign for

Improving prime editing with an endogenous small RNA-binding protein

vector assign for

Lipid nanoparticles for mRNA delivery

Adeno-associated virus (AAV) gene therapies directed to the liver have been approved for hemophilia A and B, and there are many AAV treatments in late-stage clinical development 1 , 2 . However, concerns regarding the durability of AAV gene therapies in the liver, along with the challenge of re-administration, have raised questions about its ultimate utility 3 , 4 , 5 , 6 , 7 , 8 . Clinical studies of AAV-based liver gene therapy have demonstrated reductions in efficacy within the first 2 months of treatment 9 , 10 . Correlations between the appearance of capsid-directed T cells, serum transaminase elevations and reductions of factor IX in hemophilia B trials implicate immune responses in the lack of durability 9 . An immediate reduction in serum bilirubin was observed following AAV gene therapy in an individual with Crigler–Najjar syndrome. However, serum bilirubin returned to pre-treatment levels within 2 months without apparent vector immunity or liver inflammation, suggesting that a non-immune mechanism may lead to loss of efficacy 10 . Following an initial period of expression instability lasting several months, expression appears to be remarkably consistent, albeit at low levels, in both nonhuman primates (NHPs) and humans, which is surprising because the constant turnover of hepatocytes should dilute the episomal AAV genome 11 .

AAV gene therapy is efficient but does not persist at high levels in NHP liver

The goal of our study was to define the mechanism(s) that limit efficient and durable transgene expression following liver gene therapy with AAV vectors. Previous studies with complete preclinical and clinical datasets suggest that NHPs are better suited for evaluating key aspects of vector performance than other animal models 9 , 10 , 12 , 13 , 14 , 15 , 16 . We conducted initial studies in rhesus macaques using macaque-derived β-choriogonadotropic hormone (rh-β-CG; CGB ) as the transgene. rh-β-CG is secreted and has a short serum half-life, meaning it can provide a longitudinal, real-time readout of transgene transcription. As rh-β-CG should be viewed as a self-protein in macaques, confounding adaptive immune responses to the transgene product or to transgene-expressing cells are unlikely. We evaluated two clade E capsids that have been used in multiple clinical trials, AAV8 and AAVrh10 ( n  = 6 NHPs per vector). As an essential and unique aspect of our studies, we analyzed three sequential liver tissue samples from each animal by biopsy at days 14 and 98 and at necropsy at day 182. These analyses included assessment of transgene DNA and RNA by quantitative PCR (qPCR) and cellular distribution of DNA and rh-β-CG protein expression by in situ hybridization (ISH) and immunohistochemistry (IHC), respectively.

We observed similar levels and profiles of rh-β-CG protein expression in serum for each capsid; peak levels were achieved by day 7, followed by a gradual decline to stable levels three- to sixfold lower than the peak (Fig. 1a ) without transaminase elevations (Fig. 1b ). Statistically significant reductions in total vector DNA and RNA occurred over time, although the magnitude of reduction was smaller for DNA than for RNA. Although DNA levels decreased further over the two later time points, RNA levels were stable between days 98 and 182 after the initial decline relative to day 14 (Fig. 1c,d ).

figure 1

a , b , NHPs received i.v. injections of 10 13 genome copies per kg (body weight) of AAV8 or AAVrh10 vectors expressing the self-transgene rh-β-CG ( n  = 6 per group). Serum rh-β-CG levels were evaluated throughout the in-life phase for transgene expression ( a ) as well as alanine aminotransferase (ALT) levels ( b ). Liver tissue was collected during a liver biopsy procedure (14 or 98 days after vector administration) or at the time of necropsy (182 days after vector administration). c , d , DNA ( c ) and RNA ( d ) were extracted from liver samples to evaluate the number of vector genome copies (GC) and transgene RNA levels, respectively. e – j , IHC for rh-β-CG protein was performed on liver samples (brown staining) from animals administered AAV8 ( e – g ) or AAVrh10 ( h – j ). ISH was performed on liver samples using the RNAscope Multiplex Assay. Hybridized probes were imaged with a fluorescence microscope. k , l , Vector DNA was quantified by ISH, and transgene expression was determined by IHC as the percentage of AAV + cells for NHPs administered AAV8 ( k ) or AAVrh10 ( l ). Values are presented as mean ± s.e.m.; * P  < 0.05; ** P  < 0.01; *** P  < 0.001.

Source data

To elucidate the mechanism governing this rapid decline in expression, we evaluated the cellular distribution of rh-β-CG protein expression by IHC (Fig. 1e–j and Supplementary Fig. 1 ) and nuclear DNA by ISH using a probe specific for vector DNA as part of a probe pair to target DNA and RNA separately (Fig. 1k,l ). The number of rh-β-CG + cells declined three- to fivefold from day 14 to day 98 and then remained relatively stable through day 182, consistent with the kinetics of rh-β-CG in serum and transgene RNA expression in the liver. The approximately fourfold reduction in rh-β-CG-expressing cells was not associated with a commensurate reduction in DNA-containing cells, which decreased by only 24–53%.

Vector DNA assembles into discrete nuclear domains that persist despite the loss of transgene expression

We next evaluated the same parameters of gene transfer and expression in macaques intravenously (i.v.) administered AAV8 vectors expressing one of three transgenes: a reporter gene encoding green fluorescent protein (GFP) or a transgene encoding the human or macaque version of the low-density lipoprotein receptor (hLDLR and rhLDLR, respectively; n  = 2 per transgene). These studies allowed us to assess the role of adaptive immunity in the efficiency and stability of transgene expression within a range comprising the highly immunogenic protein GFP to the non-immunogenic self-protein rhLDLR.

Throughout the in-life phase of the study, we used serum LDL levels as an indirect assessment of transgene expression that should reflect the levels of transgene-derived LDLR in real time (Fig. 2a–c ). Animals that received the rhLDLR vector showed an acute and substantial reduction in serum LDL, which returned to levels close to or at baseline within 30 days (Fig. 2a ). We observed a similar pattern of serum LDL for the hLDLR vector but with a lower magnitude of transient reduction (Fig. 2b ). As expected, we did not observe a reduction in serum LDL for the GFP vector (Fig. 2c ). The reduction in serum LDL as a result of transient LDLR expression was associated with an expected acute but transient reduction in serum PCSK9 (Supplementary Fig. 2 ). Serum transaminase levels tracked with the expected immunogenicity of the transgene, ranging from no elevations with rhLDLR (Fig. 2d ) to mild elevations with hLDLR (Fig. 2e ) to a sharp and transient increase with GFP (Fig. 2f ). Sequential measurements of T cells by enzyme-linked immunosorbent spot revealed transgene responses in five of six animals, with the extent of transaminase elevation being commensurate with the degree of transgene immunogenicity (GFP > hLDLR > rhLDLR); T cell activation to the capsid was minimal (Supplementary Fig. 3 ).

figure 2

a – f , NHPs received i.v. injections of 10 13 genome copies per kg (body weight) AAV8 vectors encoding rhLDLR, hLDLR or GFP ( n  = 2 per group). Serum LDL ( a – c ) and ALT ( d – f ) levels were evaluated throughout the in-life phase. Liver tissue was collected during a liver biopsy (14, 77, and 224 days after vector administration) or necropsy (760 days after vector administration). g , h , DNA ( g ) and RNA ( h ) were extracted from liver samples to evaluate the number of vector genome copies and transgene RNA levels, respectively. i – k , ISH was performed on liver samples using the RNAscope Multiplex Assay. The probes used were non-overlapping probe pairs, in which one probe was specific for DNA (binding to the antisense strand), and the second probe hybridized to RNA. Hybridized probes were imaged with a fluorescence microscope. The vector DNA and transgene RNA were quantified as the percentage of AAV + cells for animals treated with AAV vectors expressing rhLDLR ( i ), hLDLR ( j ) or GFP ( k ). Light and dark colors indicate each individual NHP in the cohort; red (rhLDLR), blue (hLDLR) and green (GFP). The dashed lines indicate the level where background can be observed due to autofluorescence.

We performed tissue studies as described for the rh-β-CG experiments, although four samples were available for each animal spanning a longer time frame (that is, biopsies at days 14, 77 and 224 and necropsy at day 760). Analyses of vector DNA and transgene RNA (as measured by qPCR) followed the same trends over time as those for rh-β-CG across all transgenes, showing reductions in both DNA (Fig. 2g ) and RNA (Fig. 2h ), with greater losses in RNA than in DNA. The extent of these reductions was much greater for the transgene encoding GFP (DNA diminished >3,000-fold, and RNA diminished >55,000-fold) than for the transgene encoding rhLDLR (DNA diminished 6-fold, and RNA diminished 29-fold). The hLDLR vector results were more similar to the data for the rhLDLR vector, showing DNA and RNA reductions of 9-fold and 227-fold, respectively.

We performed ISH to characterize the number of cells harboring intranuclear vector DNA compared to those with cytoplasmic transgene-derived RNA (Supplementary Fig. 4 ). The pattern observed for the rhLDLR vector was similar to the rh-β-CG vector results, with high numbers of DNA-containing and RNA-expressing cells at day 14 (65% and 15%, respectively), followed by a 7-fold reduction of DNA over 2 years and a 12-fold reduction in RNA-expressing cells by day 77. The number of RNA-expressing cells then remained stable through day 760, reaching a steady state of ~1% RNA-expressing cells (Fig. 2i and Supplementary Fig. 4 ). The pattern for hLDLR was essentially the same, although with greater reductions in DNA (28-fold) and RNA (~3,000-fold), with RNA-expressing cells falling below the 0.1% threshold of detection at day 760 (Fig. 2j and Supplementary Fig. 4 ). Animals that received the vector encoding GFP exhibited the same high level of gene transfer and transgene expression based on analyses for day 14, although the expression dropped to undetectable levels by day 760 for DNA and by day 77 for RNA (Fig. 2k and Supplementary Fig. 4 ).

DNA-specific ISH revealed two patterns of intranuclear hybridization at day 14: a diffuse granular pattern and a single bright circular structure (Fig. 3a ). Evaluations at later time points demonstrated retention of the circular structures, with a loss of the background granular staining (Fig. 3b ). Confocal imaging illustrated the spherical shape of these structures with a diameter between 0.8 and 1.6 µm (Fig. 3c ). We co-stained sections for vector DNA by ISH and for fibrillarin as a nucleolus marker by IHC. There was no overlap between these two structures, indicating that the single nuclear domain that harbors vector genomes is not related to the nucleolus (Fig. 3d ).

figure 3

a– e , NHPs received i.v. injections of 10 13 genome copies per kg (body weight) of AAV8 vectors encoding rhLDLR, hLDLR, or GFP ( n  = 2 per group). Liver tissue was collected during a liver biopsy (14 days after vector administration) or necropsy (760 days after vector administration). ISH was performed on liver samples using a DNA-specific probe (binding to the antisense strand). a , b , DNA ISH images from NHPs administered rhLDLR at days 14 ( a ) and 760 ( b ) after vector administration. Arrows mark cells with DNA ISH signal that are not hepatocytes; green, vector DNA; blue, DAPI (nuclear counterstain). c , d , Hybridized probes were imaged with a confocal microscope ( c ) and co-stained with a nucleolus marker (fibrillarin antibody) shown in red ( d ). e , Nuclei were extracted from necropsy samples (day 760), and cDNA libraries were created from single nuclei. Nuclei from similar cell types cluster together, and the total percentage of nuclei expressing transgene RNA was evaluated. To enable analysis of transduction at an early time point, we used samples from two additional animals previously treated with 7.5 × 10 12 genome copies per kg (body weight) of AAV8.TBG.GFP and necropsied at day 7 (ref. 17 ). A representative uniform manifold approximation and projection (UMAP) is shown for each group; NK cell, natural killer cell; HSC, hepatic stellate cell.

To better understand the global picture of liver transduction with respect to cell type, we performed single-nucleus RNA sequencing (snRNA-seq; Fig. 3e and Supplementary Fig. 5 ). To enable analysis of transduction at an early time point, we used samples from two additional animals previously administered AAV8.TBG.GFP and necropsied at day 7 (ref. 17 ). snRNA-seq analysis of these liver tissues at day 7 revealed an ~20% transduction of multiple cell types, including hepatocytes, liver sinusoidal endothelial cells (LSECs) and Kupffer cells, indicating that the thyroxine-binding globulin ( TBG ) promoter is not hepatocyte specific. The same analysis of day 760 tissues (Fig. 3e and Supplementary Fig. 5 ) showed reduced transduction similar to that for other measurements of transgene expression in hepatocytes (that is, RNA PCR and RNA ISH), with transduction of 2.5% for rhLDLR, 0.2% for hLDLR and 0.02% for GFP (Fig. 3e ). Only rhLDLR-treated animals had significant detectable transgene expression in non-hepatocytes (that is, LSECs and Kupffer cells) at day 760.

The DNA ISH analyses from rhLDLR tissues were re-evaluated for evidence of vector genomes in non-parenchymal cells in light of the snRNA-seq results that showed expression across multiple cell types. Nuclear staining was indeed demonstrated at day 14 time points in non-hepatocytes, although this was substantially reduced by day 77 (Fig. 3a,b ). The relevance of the wide distribution and expression of the AAV genome throughout different liver cells is unclear to the issue of durability being studied in this manuscript, although it could be important in understanding toxicity of systemic AAVs.

Vector integrates at high frequency throughout chromosomal DNA as complex concatemeric structures

The presence of many non-expressing hepatocytes that continued to harbor vector DNA compelled us to more fully characterize the structure and location of the vector genomes detected by ISH. We and others have shown integration of AAV genome sequences into chromosomal DNA in the setting of DNA repair following double-stranded breaks 18 , 19 , 20 , 21 , 22 , 23 , 24 , 25 . We evaluated liver DNA from rh-β-CG- and LDLR/GFP-treated animals for integrated vector sequences using inverted terminal repeat sequencing (ITR-seq), an anchored multiplexed PCR-based next-generation sequencing method developed by our group to detect AAV ITR sequences that have integrated into the genome 18 . This method captures the chromosomal sequences directly adjacent to insertion sites by ligating specific unique molecular identifier (UMI)-containing adapters to sheared DNA. This is followed by PCR amplification using primers specific to the AAV ITR and ligated adapter sequences. AAV integration sites are determined from chimeric sequencing reads that contain both AAV ITR DNA and the adjacent host chromosomal DNA. The numbers and locations of unique genome–AAV junctions were determined for each sample, and the adjacent genomic DNA sequences in each unique AAV integration were further characterized and annotated.

Analysis of tissues at day 182 from rh-β-CG vector-treated animals showed integration events at frequencies of 1.6 per 100 genomes to 1 per 1,000 genomes (Fig. 4a ). A time course of integrations performed in the GFP/LDLR study showed similar levels of integration events, which declined between days 14 and 77 and subsequently stabilized to levels of 0.1–0.7 AAV integration events per 100 genomes (Fig. 4a ). These integrations occurred across the genome and mostly followed a widely dispersed distribution pattern, with the exception of an increase in integrations in and around genes that are highly expressed in the liver (Fig. 4b and Supplementary Fig. 6 ). None of the identified insertion sites from any of the evaluated NHP samples were located within genic regions frequently mutated in human hepatocellular carcinomas (HCCs; including TP53 , TERT , CTNNB1 and so on 26 , 27 , 28 ) nor in genic regions identified in the development of mouse HCC following AAV treatment ( Dlk1 , Tax1bp1 , Meg8 (the mammalian ortholog of the Rian locus) and so on) 29 , 30 , 31 , 32 .

figure 4

a – c , NHPs received i.v. injections of 10 13 genome copies per kg (body weight) AAV8 vectors encoding rhLDLR, hLDLR or GFP ( n  = 2 per group). Liver tissue was collected during a liver biopsy procedure (14, 77 and 224 days after vector administration) or at the time of necropsy (760 days after vector administration). a , DNA was extracted from liver samples, and the number of AAV integration loci in all injected NHPs was determined by ITR-seq. The number of unique integration loci was normalized to 100 genomes based on input DNA. Each NHP had two samples run at each time point, except for at day 760 when several replicates of each NHP were performed. b , The genomic locations of AAV integration loci were determined by ITR-seq and annotated as being within a gene-coding region (genic) or outside of a gene-coding region (intergenic) according to the rhesus macaque RefSeqGene annotation. Integrations within genic regions were further annotated by the distribution of RNA expression in the human liver (data were taken from the Human Genome Atlas at www.proteinatlas.org ). Expression levels were determined by normalized expression (nx) in the human liver for each annotated gene. The following categories were determined: genes not expressed in liver (1 < nx), genes with low expression in liver (1 ≥ nx < 10), genes with medium expression in liver (10 < nx > 100) and genes with high expression in liver (100 ≥ nx). A random distribution represents 10,000 randomly computationally generated genomic loci in the rhesus macaque genome. The number of AAV integration events in each gene category is presented as a fold change over random sequences. A value of 1 would represent no difference from the distribution of random loci (dashed line). Data are presented as mean ± s.e.m. c , The numbers of clones for each unique integration loci detected were determined by requiring the same insertion site and different adapter positions and different UMIs for each clone. The percentage of unique insertion sites that were clonally expanded (two or more clones) is represented in the graphs. Samples were the same as assessed in a . Of clonally expanded loci, the average number of clones and the largest clone detected between the two NHPs for each group is listed below the graph. Data presented as mean ± s.e.m.

To determine whether any of the detected insertion sites exhibited evidence of clonal expansion, we used the UMIs in the ITR-seq reads and the exact nucleotide position of the genomic DNA adjacent to the adapter to remove PCR duplicates and identify and quantify clonal expansion of unique insertion sites, similar to the technique described by Nguyen et al. 33 We defined clonal expansion as two or more unique integrations (as determined by independent UMI sequences and adapter locations) at the same genomic location. Samples were evaluated for the percentage of integrations with clonal expansion, the average size of detected clones and the largest detected clone within each sample (Fig. 4c ). Animals treated with GFP and hLDLR exhibited an increased number of expanded loci and a larger overall size of clones than rhLDLR-treated animals. For all three groups, the largest increase in clonal integration loci was between days 14 and 77. The size of the largest clone in each sample was similar to results of a recent study with AAV-transduced human hepatocytes expanded in a mouse model of xenogenic liver regeneration 34 , both of which are relatively low compared to observations in AAV-treated dogs up to 10 years after vector administration, where vector-induced expansion was proposed 33 .

To fully characterize the composition of AAV sequences at late time points after vector administration, we used multiple long-read single-molecule sequencing techniques. We first performed long-read sequencing of DNA from vector preparations used for animal dosing to assess the integrity of administered AAV genomes. This approach showed complete ITR-to-ITR vector genomes represented the majority of AAV DNA; however, this approach also revealed a minority population of genomes with truncations that were not present in the input plasmid (Supplementary Fig. 7a ). To determine whether a similar proportion of AAV DNA remained intact and was able to drive transgene expression in vivo, we proceeded to also characterize in vivo vector genomes by long-read sequencing. Due to the relatively low abundance of AAV DNA in vivo and its existence as both episomes and broadly distributed integrants, we used a hybridization-based enrichment approach based on binding to biotinylated oligonucleotides tiled across the individual transcriptional units to enrich for vector-containing DNA sequences. The assay was performed with necropsy samples collected at day 760, when adequate material was available for the pulldown enrichments. Sequencing of enriched DNA was performed using high-fidelity (HiFi) circular consensus sequencing (CCS) on a PacBio Sequel II instrument (>99% accuracy and Q  > 20). The CCS reads were then analyzed for the presence of vector and host genome sequences. This approach yielded individual reads ranging from 51 to 50,419 base pairs (bp) in length, with average sequence sizes ranging from 4,216 to 6,113 bp. The number of reads that contained vector sequences was proportional to the total amount of vector DNA originally detected by qPCR, with rhLDLR > hLDLR > GFP (Table 1 ).

Sequence-based analysis of these vector-containing reads demonstrated remarkable heterogeneity in the structure of AAV sequences present in vivo (Fig. 5 ), which often were present in complex concatemers containing mixtures of rearranged and truncated genomes (examples of these complex concatemers are presented in Fig. 5a–d ). Mapping the reads against the input vector sequence illustrated the extensive nature of the rearrangements/truncations that could not have been explained by erroneous input vector and instead must have occurred after administration (compare Supplementary Fig. 7a and 7b–d ).

figure 5

a – d , NHPs received i.v. injections of 10 13 genome copies per kg (body weight) of AAV8 vectors encoding rhLDLR, hLDLR or GFP ( n  = 2 per group). Liver tissue was collected at necropsy (760 days after vector administration) for each NHP, and high-molecular-weight DNA was extracted from liver samples and enriched by hybridization to probes that tiled the vector sequence. HiFi long-read sequencing of liver DNA was performed using high consensus accuracy CCS on a PacBio Sequel II instrument (>99% accuracy and Q  > 20). CCS reads were mapped to both the vector and host genomes. For CCS reads containing host genomic sequence, the host genomic sequence is indicated below the scale bars as red boxes and the location of integrated vector DNA was determined as indicated by the red lines marked on each chromosomal picture. Blue boxes indicate vector genome sequences, which were further annotated by component (5' ITR; enhancer, E; promoter, TBG ; intron, IVS2; transgene, rhLDLR; PolyA, BGH; 3' ITR) and by orientation (arrows above scale bar). a , A complete integration would contain two chromosomal junctions flanking the entire integration. b – d , Most integrations were complex concatemers and were incompletely captured, as represented by only one chromosomal junction. Vector integrations in head-to-tail ( b ), head-to-tail and head-to-head ( c ) and head-to-tail and tail-to-tail ( d ) complex concatemeric configurations were seen.

To help determine the likelihood that these rearranged genomes retained the ability to express transgene, we evaluated the individual long-read sequences for the presence of intact transgene cDNA. The number of intact cDNA sequences was very low in the GFP group and increased in the LDLR groups, with rhLDLR > hLDLR; in each group, the number of reads with cDNA sequences was 0-44% of those that showed any vector sequence.

A subset of cDNA containing sequences (that is, ~12%) were shown to contain flanking rhesus macaque genomic sequence in at least one end, suggesting that they were derived from integrated genomes. By simultaneously quantifying the presence of genomic and AAV DNA, we estimated that for rhLDLR samples (where the most integration was seen), between 33% and 39% of integrated sequences contained a fully intact transgene cDNA. However, this likely represents an underestimate because of shearing of the DNA during isolation and premature termination of the sequencing run.

Of all reads containing at least one flanking sequence, 92.9% contained at least one ITR, and 85.2% contained two or more ITRs. Only 10.2% of the ITRs were intact, with the majority showing heterogeneous truncations near a common region of the B–B′ palindromic loop, resulting in an average ITR length of 102.6 bp (Supplementary Fig. 8 ) 35 , 36 . There was remarkable homogeneity in ITR sequences within reads that harbored more than one ITR and substantial variation between ITR sequences of different reads. We broadly assessed variations within the genomic flanking DNA to provide insight into the consequences of integration on genome integrity. Based on all reads containing at least one flanking sequence, the genomic DNA was largely intact (96.8%), with only 0.7% insertions and 2.6% deletions in the flanking genomic DNA. We captured at least four long reads with flanking genomic sequence on both ends of a vector sequence. In these examples, flanking host genomic sequences demonstrated a low percentage of mismatches (94–100% identity); in a few cases, some of the flanking sequences were flipped in orientation and/or repeated, but otherwise, the rhesus macaque genome was largely unperturbed.

Our studies reveal a complex interplay between adaptive immunity and DNA repair that affects the performance of AAV gene therapy in the primate liver. An important finding was the formation of large discrete nuclear domains of vector DNA that persist despite concomitant reductions in transgene expression. The presence of these nuclear domains is reminiscent of the replication centers observed during viral infection with adenovirus and herpes simplex virus. One hypothesis is that transcriptionally active genomes located within these structures, or elsewhere in the nucleus, undergo epigenetic silencing in a similar manner to the inactivation of intranuclear genomes of viruses (such as herpesviruses) by innate host responses. Another potential explanation is that genomes that are transcriptionally active soon after delivery are unstable 37 , such as the transiently appearing vector DNA that is widely dispersed in the nucleus, while the vector genomes within the persisting discrete nuclear domains were never transcriptionally active. Transgene-specific biology (for example, circulating half-life, transgene activity and biodistribution) could also contribute to variability in the pattern of expression observed for several AAV gene therapies over time 9 , 16 . The persistence of these non-expressing nuclear vector domains helps explain the long-standing enigma in primate liver gene therapy studies of high vector DNA in the setting of low vector RNA 38 , 39 .

The demonstration of integrated vector sequences at levels of 1 per 100 cells informs the consideration of safety and efficacy of liver gene therapy in several ways. The abundant and broad distribution of integrations has the potential to lead to malignant transformation. However, none of these integrations were within genes known to be associated with HCC, nor was there evidence of marked clonal expansion during the 2 years of follow-up. The fact that integration events are far less common (about 1%) than the number of cells that express at day 14 (that is, ~20%) and the number of cells that retain vector DNA within the nuclear domain (that is, ~10%) indicates that episomal forms of the vector genome must be responsible for early transcription and the formation of discrete nuclear domains. Similarities in the frequency of integration sites to the number of long-term expressing cells as measured by ISH/IHC and snRNA-seq (~1%) suggests that integration may be responsible for durable expression (summarized in Table 1 ). Long-read sequencing revealed the presence of vector genomes in large complex concatemers harboring many truncations and rearrangements. Evidence to support integration of these concatemers was provided in a subset of reads that contained flanking macaque chromosomal DNA. Limitations in the capture of complete concatemeric structures by long-read sequencing precluded a quantitative assessment of integration frequency, although the presence of integrated sequences with intact vector genomes supports the hypothesis that integrated vectors may be responsible for long-term expression. The finding of high vector DNA in the setting of low vector RNA was shown in our studies with two capsids and three transgenes and was similar to that described by others using different promoters, suggesting that this is a class effect of AAV in primate liver 38 , 39 . However, we cannot rule out attributes of the vector, such as promoter sequence, in influencing expression profiles.

Our studies also demonstrate the impact that adaptive immune responses can have on the frequency and molecular state of the vector DNA (for example, episomal versus integrated DNA). In the case of a non-immunogenic transgene, ~10 genome copies per cell are distributed across nuclear domains present in ~10% of cells, with unique integrations detectable in ~1 out of 100 cells at later time points. Activation of a T cell response to the transgene as observed with GFP substantially reduced the overall vector DNA content to 0.02 genome copies per cell and eliminated most of the nuclear domains to only 0.04% of cells without impacting the number of detected unique integration sites (~1 integration locus per 100 cells). Immune-mediated elimination of episomal viral DNA genomes is a well-known host defense mechanism 40 , 41 , 42 . It is interesting that animals treated with immunogenic transgenes demonstrated more truncations/rearrangements, thereby suggesting that cells expressing functional vector genomes are eliminated over time. It has been shown in clinical trials that steroids may diminish the T cell-mediated reduction in transgene expression 9 , 43 , 44 , although we recently showed in NHPs that steroids do not prevent the acute reduction in expression observed in rhLDLR-treated animals 45 .

Our hypothesis is that episomal vector genomes are inactivated via intracellular host defense mechanisms that the primate liver has evolved to neutralize the onslaught of viruses from the gut virome 40 , 41 , 46 . Insertion of vector genomes into transcriptionally active domains of chromosomal DNA should escape this inactivation. Vector-mediated transgene expression is indeed stable in the livers of lower organisms such as rodents, where host defense pathways are very different 47 , 48 . Although the data are limited, we believe a similar situation exists in some models of human liver gene therapy. Analysis of liver biopsies of human gene therapy recipients demonstrated the presence of rearranged concatemers, variation in transgene RNA/DNA ratios, and low levels of integrated vector genomes, consistent with our studies in NHPs 20 , 49 . Indirect measures of transgene expression, such as serum biomarkers, are complicated. A biphasic response to gene therapy was observed using the short half-life biomarker bilirubin in a human CN1 clinical trial, whereas a more uniform kinetic response has been observed in hemophilia A and hemophilia B clinical trials using the longer half-life readout of serum clotting factors 3 , 4 , 5 , 10 . The durability of AAV transgene expression observed in extrahepatic tissues of all species speaks to the unique behavior of primate liver in modulating AAV transgene expression.

Our findings have implications for improving the efficacy of liver gene therapy. One strategy is to enable the retained episomal AAV genomes located in the discrete nuclear domains to be more transcriptionally active by incorporating cis elements, such as different promoters and insulators, or by using drugs that prevent epigenetic silencing 50 . This approach may be effective regardless of whether vector genomes are active and then silenced or are simply never active. Another strategy, based on the proposal that integrated genomes are more likely to confer durable expression, would be to increase the number of vector integrations into safe harbor sites, as is the goal of some editing strategies for treating loss-of-function diseases. In this scenario, we can view editing-based gene insertions as an extension of gene therapy, in which the editing-based insertions are directed to a specific chromosomal location with higher frequency than the broadly distributed background of insertions observed following gene therapy.

AAV vector production

All AAV vectors were produced by the Penn Vector Core at the University of Pennsylvania, as previously described 29 , and visualized using SnapGene (version 6.2.1). Briefly, plasmids expressing rh-β-CG, codon-optimized rhLDLR, codon-optimized hLDLR and enhanced GFP from the TBG promoter were packaged within the AAV8 capsid. A vector expressing rh-β-CG from the TBG promoter was also packaged with the AAVrh10 capsid. Unique biological materials are available upon request, pending permission by the authors and/or patent holder(s).

Animal studies

The Institutional Animal Care and Use Committee of the University of Pennsylvania approved all animal procedures in this study. We obtained wild-type adult cynomolgus and rhesus macaques aged 3–6 years ( n  = 20) from Covance Research Products. We conducted NHP studies at the University of Pennsylvania within a facility that is registered with the U.S. Department of Agriculture, accredited by the American Association for Accreditation of Laboratory Animal Care, and assured by the Public Health Service. As previously described 51 , we housed animals in stainless steel squeeze-back cages with perches. All cage sizes and housing conditions were compliant with the Guide for the Care and Use of Laboratory Animals. A 12-h light/12-h dark cycle was maintained and controlled via an Edstrom Watchdog system. Animals were fed Certified Primate Diet 5048 (PMI Feeds) two times per day (morning and evening). We also provided an additional variety of food treats that were fit for human consumption, including fruits, vegetables, nuts and cereals, daily as part of the standard enrichment process. Manipulanda, such as kongs, mirrors, a puzzle feeder and raisin balls, were provided daily. Animals also received visual enrichment and daily human interaction. All interventions were performed during the light cycle, and animals were fasted overnight before being anesthetized.

On study day 0, rhesus macaques received 10 13 genome copies per kg (body weight) AAV8.TBG.rh-β-CG ( n  = 6), AAVrh10.TBG.rh-β-CG ( n  = 6), AAV8.TBG.rhLDLR ( n  = 2), AAV8.TBG.hLDLR ( n  = 2) or AAV8.TBG.GFP ( n  = 2) as a 10-ml infusion of vector into the saphenous vein at a rate of 1 ml min –1 via an infusion pump (Harvard Apparatus). Macaques were anesthetized, and blood was collected on selected days via the femoral vein for analysis of complete blood counts, clinical chemistries and coagulation panels by Antech. We determined neutralizing antibody titers using serum samples taken before the initiation of the study, as previously described 52 . All animals had neutralizing antibody titers of <1/5 for the administered AAV capsid before vector administration. At baseline and throughout the in-life phase of the study, we evaluated the animals for serum biomarkers to determine the transgene expression of either rh-β-CG (as measured by enzyme-linked immunosorbent assay, as previously described 53 ) or LDL (as a biomarker for rhLDLR and hLDLR transgene expression). Lipid panel analysis was performed by Antech GLP.

We performed liver biopsies on NHPs throughout the in-life phase of the studies (on study days 14 and 98 for NHPs receiving AAV8.TBG.rh-β-CG or AAVrh10.TBG.rh-β-CG and on study days 14, 77, and 224 for NHPs receiving AAV8.TBG.rhLDLR, AAV8.TBG.hLDLR, or AAV8.TBG.GFP). We conducted a mini-laparotomy procedure to isolate liver tissue and divided the collected samples for histopathology analysis (that is, fixed in 10% neutral buffered formalin) and molecular analysis (that is, frozen on dry ice and stored at −60 °C or colder).

At day 182 after vector administration for NHPs treated with rh-β-CG vectors and at day 760 for NHPs treated with rhLDLR, hLDLR, and GFP vectors, animals were euthanized and necropsied.

Vector genome copy and transgene RNA analysis

Tissue samples were snap-frozen at the time of biopsy or necropsy, DNA was extracted using a QIAamp DNA Mini kit (Qiagen), and DNase-treated total RNA was isolated from 100 mg of tissue. RNA was quantified by spectrophotometry and reverse transcribed to cDNA using random primers. We detected and quantified vector genome copy levels in extracted DNA and transgene expression in extracted RNA by qPCR, as previously described 29 , 51 . Briefly, vector genome copy and RNA levels were quantified using primers and a probe designed for a vector-specific sequence.

We performed IHC for CG on formalin-fixed, paraffin-embedded liver sections. Sections were deparaffinized through a xylene and ethanol series, boiled for 6 min in 10 mM citrate buffer (pH 6.0) for antigen retrieval, and treated with 2% H 2 O 2 (15 min), avidin/biotin-blocking reagents (15 min each; Vector Laboratories) and blocking buffer (1% donkey serum in PBS and 0.2% Triton X-100 for 10 min). We then incubated the sections with rabbit serum to human CG (Abcam, ab9376; diluted 1:200) for 1 h at 37 °C, followed by incubation with biotinylated secondary antibodies (45 min at room temperature; Jackson ImmunoResearch) diluted in blocking buffer according to the manufacturer’s recommendations. We used a Vectastain Elite ABC kit (Vector Laboratories) with 3,3′-diaminobenzidine as a substrate to stain bound antibodies according to the manufacturer’s instructions. No counterstain was applied to the sections to facilitate quantification.

For quantification, we acquired ten random images from each IHC-stained section with a ×10 objective. Using ImageJ software (version 1.52a; http://rsb.info.nih.gov/ij/ ), we measured the area positive for CG IHC and the area occupied by central and portal veins for each image to calculate the average percentage of CG + area of liver tissue (excluding vein areas).

ISH for vector DNA and transgene RNA

We performed ISH on formalin-fixed paraffin-embedded liver sections using an RNAscope Multiplex Fluorescent Reagent kit v2 assay (Advanced Cell Diagnostics) following the manufacturer’s protocol. Probes for two-plex ISH were synthesized by Advanced Cell Diagnostics and designed as non-overlapping probe pairs, where one probe is specific for DNA (binding to the antisense strand), and the second probe hybridizes to RNA. Probes for DNA were stained first and detected by Opal 520 precipitates (imaged with a filter set for fluorescein isothiocyanate), and probes binding RNA/DNA were stained in a second step with Opal 570 deposits (imaged with a rhodamine filter set). Reactive Opal dyes were purchased from Akoya Biosciences, and images were acquired with a Nikon Eclipse Ti-E fluorescence microscope. For some sections, we acquired confocal images using a Leica TCS SP5 confocal microscope with an acousto-optical beam splitter.

To quantify ISH + cells, we scanned stained sections with an Aperio Versa fluorescence slide scanner (Leica Biosystems) and analyzed the sections using Visiopharm software (version 2020.06.0.7872) with applications that detect either the probe signal for DNA inside DAPI-stained nuclei or the probe signal for RNA in the cytoplasm.

ISH with nucleolus localization

After performing ISH, as described above, we further stained some sections with an antibody to fibrillarin as a nucleolar marker. After treatment with 0.5% Triton X-100 in PBS for 2 h and blocking with 1% donkey serum/0.2% Triton X-100 in PBS for 1 h, sections were incubated with rabbit anti-fibrillarin (Abcam, ab166630; diluted 1:100 in 0.5% Triton X-100/PBS) overnight at 4 °C, followed by incubation with Cy5-labeled secondary antibody (donkey anti-rabbit, Jackson ImmunoResearch; diluted 1:100 in 0.5% Triton X-100/PBS for 1 h). We mounted sections using ProLong Gold Antifade Mountant with DAPI (Invitrogen).

Nuclei isolation and snRNA-seq

To isolate nuclei from frozen tissue samples, a modified version of previously published nuclei isolation procedures was used 54 . For these isolations, all buffers and samples were maintained on ice throughout the procedure to maintain nuclei integrity. Buffers were typically made as described below, cooled in advance and supplemented immediately before use to make ‘complete’ buffers at a final concentration of 1 mM DTT, 0.8 U/µl RNase inhibitor (Protector RNase Inhibitor, Roche), and 1× protease inhibitor (complete mini EDTA-free, Roche). To isolate nuclei, ~25 mg of frozen tissue was minced with a scalpel and transferred to a pre-chilled 2-ml Dounce homogenizer with 1 ml of cold complete lysis buffer (0.32 M sucrose, 5 mM CaCl 2 , 3 mM magnesium acetate, 0.1 mM EDTA, 10 mM Tris-HCl (pH 8.0), and 0.1% Triton X-100). The tissue was homogenized with ten strokes each of pestle A and then B, sequentially passed through prewet 100-µm and 30-µm filters and collected in a sterile tube. The homogenizer and filters were washed with an additional three volumes of complete lysis buffer collected with the filtered sample. Two volumes of sample was then layered on top of one volume of cold complete isolation buffer (1.8 M sucrose, 3 mM magnesium acetate, and 10 mM Tris-HCl (pH 8.0)) and centrifuged at 21,000 g for 45 min at 4 °C. The supernatant was then carefully removed, and 100 µl of complete resuspension buffer (250 mM sucrose, 25 mM KCl, 5 mM MgCl 2 , and 20 mM Tris-HCl (pH 7.2)) was added to the tube without mixing. Samples were incubated on ice for 10–15 min, and nuclei were fully resuspended by gently pipetting up and down 20–30 times and counted with an automated cell counter (Countess 3, Thermo Fisher). For submission of snRNA-seq samples, the concentration was adjusted to ~1 × 10 6 nuclei per ml (range of 0.7 × 10 6 –1.2 × 10 6 nuclei per ml), as per the 10x Genomics sample loading guidelines. To identify single-nuclei transcriptomes, the manufacturer’s protocol was followed to achieve ~10,000 partitioned nuclei per sample using the Chromium Controller and 3′ Gene Expression Assay (version 3, 10x Genomics). Nuclei partitioning, reverse transcription and cleanup, cDNA amplification, and library construction and cleanup were all performed as described in the manufacturer’s protocol, and libraries were sequenced on an Illumina NextSeq2000 to an average depth of ~34,000 reads per nuclei. In addition to liver samples from NHPs described in these studies and to enable analysis of transduction at an early time point, we used samples from two additional animals previously administered AAV8.TBG.GFP and necropsied at day 7 (ref. 17 ).

snRNA-seq analysis

After sequencing, demultiplexed fastq files were passed through the Cell Ranger count pipeline (version 5.0.1; 10x Genomics) and aligned against a custom reference genome consisting of the rhesus macaque reference (Mmul_10) and the complete annotated plasmid sequence used in the generation of the rAAV vector. Cell Ranger-generated count matrices were then further analyzed within R, with R packages maintained by Bioconductor (version 3.16), using the Seurat package (version 4.3), as previously described 55 . Each individual sample dataset was normalized using the sctransform method, and principal component analysis, UMAP and nuclei clustering were all performed using standard functions within Seurat. For cohort representations, the individual normalized datasets were integrated together by cohort based on the expression of a set of anchor genes using Seurat functions. Cell-type annotation was determined by examining the level of expression of a set of cell-type-specific genes across each cluster of the integrated datasets using the following gene signatures: TTN , TF , FGG , FGA , FGB , SERPINA1 , CPS1 , CYP3A7 and CYP2E1 (hepatocytes); FCGR2A , STAB2 , BMPER , NAV1 , TIE1 , FCN3 , LYVE1 , CLEC4G and F8 (LSECs); CMKLR1 , HTR7 , AOAH , CPVL , MSR1 , CD163 , MRC1 , CD200R1 , ITGAX , ADGRE1 and FCGR1A (macrophages); CMKLR1 , HTR7 , AOAH , CPVL , MSR1 , CD163 , MRC1 , CD200R1 , TIMD4 , ADGRE1 , CLEC4F and FCGR1A (Kupffer cells); RBMS3 , PTH1R , CCBE1 , C7 , ITGA9 and GRK5 (hepatic stellate cells); LCK , CD247 , STAT4 , BCL11B , RASGRP1 , CD3G , CD3D and CD3E (T and natural killer cells); LAMC1 , LAMC2 , BEND5 , VEPH1 , SLC28A3 , GRHL2 and PKHD1 (cholangiocytes) and FCRL1 , FCMR , BANK1 , IRF4 , BLK , MS4A1 , PAX5 and CD19 (B cells). Data visualizations were completed within Seurat and ggplot2 (version 3.4.0)

Next-generation sequencing for AAV integration analysis

We identified AAV integration sites in the host genome by ITR-seq, as previously described 18 . Briefly, purified liver DNA was sheared using an ME220 focused ultrasonicator, end repaired, A tailed and ligated to unique Illumina Y adapters that contain a sample barcode and a randomly assigned UMI sequence (UMI in the form of NNWNNWNN). Using AAV ITR and adapter-specific primers, we amplified ITR-containing DNA fragments and generated next-generation sequencing-compatible libraries. We sequenced the DNA on a MiSeq instrument (Illumina) and mapped the obtained reads to the rhesus macaque reference genome and the administered AAV vector genome. We used a custom script to identify AAV integration sites from the mapped reads, which was updated since previously described 18 to streamline steps, replace outdated programs and allow for the detection of integration site clones.

Mapped reads are labeled with the genomic location of the ITR–genome junction, the adapter–genome junction and the UMI sequence on the adapter. The number of unique genome–AAV junctions was determined for each sample, and this number was normalized to 100 genomes based on input DNA. The number of expansions (clones) for each unique genome–AAV junction was determined by the number of reads at the same unique AAV–genome junction that contain unique adapter–genome junctions and unique UMIs. By requiring both a unique adapter position and a unique UMI for a given ITR integration position, we were able to differentiate between reads originating from cell clones (that is, the same ITR position but different adapter position and different UMI) and PCR duplicates (that is, the same ITR position and same adapter position and/or same UMI) with an enhanced degree of accuracy over previous studies.

The sites were annotated as being within a gene-coding region (genic) or outside of a gene-coding region (intergenic) according to the rhesus macaque Mmul_10 RefSeqGene annotation. Integrations within genic regions were further annotated by the distribution of RNA expression in the human liver (data taken from the Human Genome Atlas; www.proteinatlas.org ) and for the presence within genes identified as commonly mutated in HCC ( TERT , TP53 , CTNNB1 , AXIN1 , ARID1A , BAP1 , KEAP1 , RB1 and NFE2L2 ) and within genes indicated in rAAV-associated mouse HCC ( DLK1 , Tax1bp1 , Hras , Sos1 , Fgf3 and MEG8 (the mammalian ortholog of the Rian locus)). Expression levels were determined by nx in the human liver for each annotated gene. The following categories were determined: genes not expressed in liver (1 < nx), genes with low expression in liver (1 ≥ nx < 10), genes with medium expression in liver (10 < nx > 100) and genes with high expression in liver (100 ≥ nx). A random distribution represents 10,000 randomly computationally generated genomic loci in the rhesus macaque genome. The number of AAV integration events in each gene category is presented as fold change over random sequences. A value of 1 would represent no difference from the distribution of random loci.

Enriched long-read sequencing of liver DNA

Total high-molecular-weight DNA was extracted from liver tissue collected at necropsy from NHPs treated with AAV8.TBG.rhLDLR, AAV8.TBG.hLDLR or AAV8.TBG.GFP (day 760). Biotinylated probes complementary to the ITRs, enhancer, promoter, transgene, woodchuck hepatitis virus post-transcriptional regulatory element (when present) and poly(A) sequences of the vector were hybridized with DNA samples, followed by pulldown with streptavidin-conjugated beads. Enriched DNA was subjected to unbiased linear amplification using the repliG system (Qiagen) and submitted for long-read sequencing using the PacBio Sequel II system and HiFi read technology. To generate these HiFi reads, the pool of enriched DNA was assembled into SMRTbell templates, which contain the double-stranded template DNA to be sequenced with single-stranded hairpin adapters on either end, and subjected to sequencing via CCS with 30 h of sequencing time.

The generated HiFi CCS reads (>99% accuracy and Q  > 20) were mapped to the rhesus macaque and vector genomes with quantitative and qualitative assessments made using a custom analysis pipeline including BEDtools (version 2.30.0), Samtools (version 1.11), Minimap2 (version 2.24), Cutadapt (version 3.4) and Picard (version 2.26.10), along with visualization of individual reads using the Integrative Genomics Viewer (version 2.16.0). The numbers of CCS reads containing a functional transgene with or without a promoter upstream of the transgene sequence were determined. Reads containing flanking genomic DNA and vector DNA were categorized as integrated. The CIGAR string of these AAV/genomic DNA chimeric reads was used to extract the insertions and deletions within the rhesus genome. Reads containing flanking genomic sequence on both ends of vector sequence were broadly assessed for integrity of the adjacent genomic DNA via NCBI BLAST RefSeq Genome Database for Rhesus Macaques. Reads with at least one flanking genomic sequence were assessed for the presence of ITR sequence and whether the ITR was intact or had a break point. An intact ITR sequence was defined as having a length of 165–173 bp. Break points were assessed, and ITRs from the same long read were compared.

Long-read analysis of vector and plasmid DNA by Oxford nanopore sequencing

Plasmid DNA used for vector production was linearized by restriction enzyme digestion and sequenced by Oxford Nanopore Technologies long-read sequencing. For AAV vectors, lambda genome was spiked in, and DNase was added to remove potentially contaminating DNA. The capsid was then denatured, and the vector genomes were annealed to create a double-stranded template. Library preparations for plasmid DNA and vector were performed using the Ligation Sequencing gDNA Native Barcoding kit (SQK-NBD112.24) from Oxford Nanopore Technologies. A custom script tested for remaining lambda DNA (to ensure that the DNase treatment worked) and allowed for subsequent mapping of long-read sequences to the plasmid DNA sequence, vector ITR-to-ITR genome and/or trans - and helper plasmids used in vector production, Escherichia coli and HEK293 cell DNA.

Statistical analysis

Comparisons between time points were performed for vector genome copy, transgene RNA, DNA ISH and RNA ISH levels using paired t -tests in the ‘t.test’ function within the R Program (version 4.1.3). We conducted comparisons between vector genome copies and transgene RNA and quantifications of DNA ISH and IHC using linear mixed-effect modeling and the ‘lme’ function in the ‘nlme’ package for R. A P value of <0.05 was considered significant.

Reporting summary

Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article.

Data availability

All data discussed in the manuscript are available in the main text or Supplementary Materials . ITR-seq data are available on GitHub ( https://github.com/Penn-GTP/ITR-seq2_public , version 2.1.1). Complete clinical pathology data can be obtained upon request.

European Medicines Agency. Hemgenix (etranacogene dezaparvovec). European Medicines Agency https://www.ema.europa.eu/en/medicines/human/EPAR/hemgenix (2023).

European Medicines Agency. Cevenfacta (eptacog beta (activated)). European Medicines Agency https://www.ema.europa.eu/en/medicines/human/EPAR/cevenfacta (2023).

George, L. A. et al. Multiyear factor VIII expression after AAV gene transfer for hemophilia A. N. Engl. J. Med. 385 , 1961–1973 (2021).

Article   CAS   PubMed   PubMed Central   Google Scholar  

Konkle, B. A. et al. BAX 335 hemophilia B gene therapy clinical trial results: potential impact of CpG sequences on gene expression. Blood 137 , 763–774 (2021).

Leavitt, A. D. et al. Updated follow-up of the Alta Study, a phase 1/2 study of giroctocogene fitelparvovec (SB-525) gene therapy in adults with severe hemophilia A. Blood 136 , 12 (2020).

Article   Google Scholar  

Manno, C. S. et al. Successful transduction of liver in hemophilia by AAV-factor IX and limitations imposed by the host immune response. Nat. Med. 12 , 342–347 (2006).

Article   CAS   PubMed   Google Scholar  

Mingozzi, F. et al. Modulation of tolerance to the transgene product in a nonhuman primate model of AAV-mediated gene transfer to liver. Blood 110 , 2334–2341 (2007).

Pasi, K. J. et al. Multiyear follow-up of AAV5-hFVIII-SQ gene therapy for hemophilia A. N. Engl. J. Med. 382 , 29–40 (2020).

George, L. A. et al. Hemophilia B gene therapy with a high-specific-activity factor IX variant. N. Engl. J. Med. 377 , 2215–2227 (2017).

Dhawan, A. et al. Longitudinal study (LUSTRO) of the spectrum of clinical disease in young Crigler–Najjar patients and plans for a phase 1/2 study (VALENS) evaluating UGT1A1 gene therapy safety and preliminary efficacy with an AAV8 vector construct, AT342, in Crigler–Najjar patients. In Abstracts of the 51st Annual Congress of the European Society for Paediatric Gastroenterology, Hepatology and Nutrition (ESPGHAN), Geneva, Switzerland , 9–12 May 2018, Poster H-P-027, Abstract 553 (2018).

Duncan, A. W., Dorrell, C. & Grompe, M. Stem cells and liver regeneration. Gastroenterology 137 , 466–481 (2009).

Article   PubMed   Google Scholar  

Greig, J. A. et al. AAV8 gene therapy for Crigler–Najjar syndrome in macaques elicited transgene T cell responses that are resident to the liver. Mol. Ther. Methods Clin. Dev. 11 , 191–201 (2018).

Greig, J. A. et al. Non-clinical study examining AAV8.TBG.hLDLR vector-associated toxicity in chow-fed wild-type and LDLR +/– rhesus macaques. Hum. Gene Ther. Clin. Dev. 28 , 39–50 (2017).

Greig, J. A. et al. Optimized adeno-associated viral-mediated human factor VIII gene therapy in cynomolgus macaques. Hum. Gene Ther. 29 , 1364–1375 (2018).

McIntosh, J. et al. Therapeutic levels of FVIII following a single peripheral vein administration of rAAV vector encoding a novel human factor VIII variant. Blood 121 , 3335–3344 (2013).

Ozelo, M. C. et al. Valoctocogene roxaparvovec gene therapy for hemophilia A. N. Engl. J. Med. 386 , 1013–1025 (2022).

Greig, J. A. et al. Impact of intravenous infusion time on AAV8 vector pharmacokinetics, safety, and liver transduction in cynomolgus macaques. Mol. Ther. Methods Clin. Dev. 3 , 16079 (2016).

Article   PubMed   PubMed Central   Google Scholar  

Breton, C., Clark, P. M., Wang, L., Greig, J. A. & Wilson, J. M. ITR-seq, a next-generation sequencing assay, identifies genome-wide DNA editing sites in vivo following adeno-associated viral vector-mediated genome editing. BMC Genomics 21 , 239 (2020).

Chandler, R. J. et al. Vector design influences hepatic genotoxicity after adeno-associated virus gene therapy. J. Clin. Invest. 125 , 870–880 (2015).

Gil-Farina, I. et al. Recombinant AAV integration is not associated with hepatic genotoxicity in nonhuman primates and patients. Mol. Ther. 24 , 1100–1105 (2016).

Huser, D., Gogol-Doring, A., Chen, W. & Heilbronn, R. Adeno-associated virus type 2 wild-type and vector-mediated genomic integration profiles of human diploid fibroblasts analyzed by third-generation PacBio DNA sequencing. J. Virol. 88 , 11253–11263 (2014).

Paneda, A. et al. Safety and liver transduction efficacy of rAAV5-cohPBGD in nonhuman primates: a potential therapy for acute intermittent porphyria. Hum. Gene Ther. 24 , 1007–1017 (2013).

Paulk, N. K. et al. Adeno-associated virus gene repair corrects a mouse model of hereditary tyrosinemia in vivo. Hepatology 51 , 1200–1208 (2010).

Kaeppel, C. et al. A largely random AAV integration profile after LPLD gene therapy. Nat. Med. 19 , 889–891 (2013).

Colella, P., Ronzitti, G. & Mingozzi, F. Emerging issues in AAV-mediated in vivo gene therapy. Mol. Ther. Methods Clin. Dev. 8 , 87–104 (2017).

Cancer Genome Atlas Research Network. Comprehensive and integrative genomic characterization of hepatocellular carcinoma. Cell 169 , 1327-1341 (2017).

Nault, J. C. et al. Clinical impact of genomic diversity from early to advanced hepatocellular carcinoma. Hepatology 71 , 164–182 (2020).

Ng, C. K. Y. et al. Integrative proteogenomic characterization of hepatocellular carcinoma across etiologies and stages. Nat. Commun. 13 , 2436 (2022).

Bell, P. et al. Analysis of tumors arising in male B6C3F1 mice with and without AAV vector delivery to liver. Mol. Ther. 14 , 34–44 (2006).

Donsante, A. et al. Observed incidence of tumorigenesis in long-term rodent studies of rAAV vectors. Gene Ther. 8 , 1343–1346 (2001).

Rosas, L. E. et al. Patterns of scAAV vector insertion associated with oncogenic events in a mouse model for genotoxicity. Mol. Ther. 20 , 2098–2110 (2012).

Zhong, L. et al. Recombinant adeno-associated virus integration sites in murine liver after ornithine transcarbamylase gene correction. Hum. Gene Ther. 24 , 520–525 (2013).

Nguyen, G. N. et al. A long-term study of AAV gene therapy in dogs with hemophilia A identifies clonal expansions of transduced liver cells. Nat. Biotechnol. 39 , 47–55 (2021).

Dalwadi, D. A. et al. AAV integration in human hepatocytes. Mol. Ther. 29 , 2898–2909 (2021).

Duan, D., Yan, Z., Yue, Y. & Engelhardt, J. F. Structural analysis of adeno-associated virus transduction circular intermediates. Virology 261 , 8–14 (1999).

Yang, J. et al. Concatamerization of adeno-associated virus circular genomes occurs through intermolecular recombination. J. Virol. 73 , 9468–9477 (1999).

Wang, J. et al. Existence of transient functional double-stranded DNA intermediates during recombinant AAV transduction. Proc. Natl Acad. Sci. USA 104 , 13104–13109 (2007).

Hurlbut, G. D. et al. Preexisting immunity and low expression in primates highlight translational challenges for liver-directed AAV8-mediated gene therapy. Mol. Ther. 18 , 1983–1994 (2010).

Nathwani, A. C. et al. Long-term safety and efficacy following systemic administration of a self-complementary AAV vector encoding human FIX pseudotyped with serotype 5 and 8 capsid proteins. Mol. Ther. 19 , 876–885 (2011).

Chan, Y. K. & Gack, M. U. Viral evasion of intracellular DNA and RNA sensing. Nat. Rev. Microbiol. 14 , 360–373 (2016).

Miettinen, M., Sareneva, T., Julkunen, I. & Matikainen, S. IFNs activate Toll-like receptor gene expression in viral infections. Genes Immun. 2 , 349–355 (2001).

Chisari, F. V., Isogawa, M. & Wieland, S. F. Pathogenesis of hepatitis B virus infection. Pathol. Biol. 58 , 258–266 (2010).

Jiang, H. et al. Effects of transient immunosuppression on adenoassociated, virus-mediated, liver-directed gene transfer in rhesus macaques and implications for human gene therapy. Blood 108 , 3321–3328 (2006).

Nathwani, A. C. et al. Long-term safety and efficacy of factor IX gene therapy in hemophilia B. N. Engl. J. Med. 371 , 1994–2004 (2014).

Wang, L. et al. Prednisolone reduces the interferon response to AAV in cynomolgus macaques and may increase liver gene expression. Mol. Ther. Methods Clin. Dev. 24 , 292–305 (2022).

Cao, Z. et al. The gut virome: a new microbiome component in health and disease. EBioMedicine 81 , 104113 (2022).

Cunningham, S. C., Dane, A. P., Spinoulas, A., Logan, G. J. & Alexander, I. E. Gene delivery to the juvenile mouse liver using AAV2/8 vectors. Mol. Ther. 16 , 1081–1088 (2008).

Dane, A. P., Wowro, S. J., Cunningham, S. C. & Alexander, I. E. Comparison of gene transfer to the murine liver following intraperitoneal and intraportal delivery of hepatotropic AAV pseudo-serotypes. Gene Ther. 20 , 460–464 (2013).

Fong, S. et al. Interindividual variability in transgene mRNA and protein production following adeno-associated virus gene therapy for hemophilia A. Nat. Med. 28 , 789–797 (2022).

Moore, T. V. et al. HDAC inhibition prevents transgene expression downregulation and loss-of-function in T-cell-receptor-transduced T cells. Mol. Ther. Oncolytics 20 , 352–363 (2021).

Greig, J. A. et al. Intramuscular injection of AAV8 in mice and macaques is associated with substantial hepatic targeting and transgene expression. PLoS ONE 9 , e112268 (2014).

Calcedo, R., Vandenberghe, L. H., Gao, G., Lin, J. & Wilson, J. M. Worldwide epidemiology of neutralizing antibodies to adeno-associated viruses. J. Infect. Dis. 199 , 381–390 (2009).

Ziegler, T. E., Matteri, R. L. & Wegner, F. H. Detection of urinary gonadotropins in callitrichid monkeys with a sensitive immunoassay based upan a unique monoclonal antibody. Am. J. Primatol. 31 , 181–188 (1993).

Zhu, Y. et al. Spatiotemporal transcriptomic divergence across human and macaque brain development. Science 362 , eaat8077 (2018).

Hao, Y. et al. Integrated analysis of multimodal single-cell data. Cell 184 , 3573–3587 (2021).

Download references

Acknowledgements

We thank A. N. Avitto, J. K. Chorazeczewski, R. Fadnavis, T. Furmanak, M. Jennis and M. K. Smith for their support of this project and instrumental contributions. We also thank T. Jiang for scanning the slides used for quantification. We thank N. Denton for assistance with manuscript preparation and graphics and H. Yan and K. Olagbegi for help with statistical analysis. We thank the Biostatistics and Bioinformatics Core, Immunology Core, Nucleic Acid Technologies Core, Histopathology Core, Program for Comparative Medicine and Vector Core of the Gene Therapy Program at the University of Pennsylvania for study support. All vectors were produced by the Penn Vector Core (RRID SCR_022432). This work was supported by Amicus Therapeutics, Passage Bio and Ultragenyx.

Author information

These authors contributed equally: Jenny A. Greig, Kelly M. Martins.

Authors and Affiliations

Gene Therapy Program, Department of Medicine, Perelman School of Medicine, University of Pennsylvania, Philadelphia, PA, USA

Jenny A. Greig, Kelly M. Martins, Camilo Breton, R. Jason Lamontagne, Yanqing Zhu, Zhenning He, John White, Jing-Xu Zhu, Jessica A. Chichester, Qi Zheng, Zhe Zhang, Peter Bell, Lili Wang & James M. Wilson

You can also search for this author in PubMed   Google Scholar

Contributions

Conceptualization: J.A.G., C.B., L.W. and J.M.W. Data curation: J.A.G., C.B., Z.H., J.W., P.B. and L.W. Formal analysis: J.A.G., K.M.M., C.B., R.J.L., Z.H., J.W., J.A.C., Q.Z., Z.Z., P.B. and L.W. Investigation: J.A.G., K.M.M., C.B., R.J.L., Y.Z., J.-X.Z., J.A.C., Q.Z., Z.Z., P.B. and J.M.W. Methodology: J.A.G., K.M.M., C.B., R.J.L., Y.Z., J.-X.Z., J.A.C., Q.Z., Z.Z., P.B., L.W. and J.M.W. Supervision: J.A.G., C.B., P.B., L.W. and J.M.W. Visualization: J.A.G., K.M.M., C.B. and R.J.L. Writing, original draft: J.A.G., C.B. and J.M.W. Writing, review and editing: J.A.G., K.M.M., C.B., R.J.L., L.W. and J.M.W. Software development: Q.Z. and P.B. Funding acquisition: J.M.W.

Corresponding author

Correspondence to James M. Wilson .

Ethics declarations

Competing interests.

J.M.W. is a paid advisor to and holds equity in iECURE, Scout Bio, Passage Bio and the Center for Breakthrough Medicines (CBM). J.M.W. also holds equity in the former G2 Bio asset companies and has sponsored research agreements with Amicus Therapeutics, CBM, Elaaj Bio, FA212, former G2 Bio asset companies, iECURE, Passage Bio and Scout Bio, which are licensees of Penn technology. J.A.G., C.B., L.W. and J.M.W. are inventors on patents that have been licensed to various biopharmaceutical companies and for which they may receive payments. All other authors have no competing interests.

Peer review

Peer review information.

Nature Biotechnology thanks Luigi Naldini, Terence Flotte and the other, anonymous, reviewer(s) for their contribution to the peer review of this work.

Additional information

Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Supplementary information

Supplementary information.

Supplementary Figs. 1–8.

Reporting Summary

Source data figs. 1–4.

Source data for Figs. 1a–d,k,l , 2a–k , 3e and 4a–c .

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/ .

Reprints and permissions

About this article

Cite this article.

Greig, J.A., Martins, K.M., Breton, C. et al. Integrated vector genomes may contribute to long-term expression in primate liver after AAV administration. Nat Biotechnol (2023). https://doi.org/10.1038/s41587-023-01974-7

Download citation

Received : 09 March 2022

Accepted : 29 August 2023

Published : 06 November 2023

DOI : https://doi.org/10.1038/s41587-023-01974-7

Share this article

Anyone you share the following link with will be able to read this content:

Sorry, a shareable link is not currently available for this article.

Provided by the Springer Nature SharedIt content-sharing initiative

This article is cited by

A humanized mouse model for adeno-associated viral gene therapy.

  • Mercedes Barzi
  • Karl-Dimiter Bissig

Nature Communications (2024)

Adeno-associated virus as a delivery vector for gene therapy of human diseases

  • Jiang-Hui Wang
  • Dominic J. Gessler
  • Guangping Gao

Signal Transduction and Targeted Therapy (2024)

Engineering APOBEC3A deaminase for highly accurate and efficient base editing

Nature Chemical Biology (2024)

Tracing the fate of AAV vectors in the body

  • Nerea Zabaleta
  • Irene Gil-Farina

Nature Biotechnology (2023)

Quick links

  • Explore articles by subject
  • Guide to authors
  • Editorial policies

Sign up for the Nature Briefing: Translational Research newsletter — top stories in biotechnology, drug discovery and pharma.

vector assign for

An official website of the United States government

Here’s how you know

Official websites use .gov A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS A lock ( Lock Locked padlock ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

Reproducible Data Science in R: Writing functions that work for you

Learn the ropes building your own functions in r using water data examples..

What's on this page

This blog post is part of a series that works up from functional programming foundations through the use of the targets R package to create efficient, reproducible data workflows.

Audience: this article starts from a novice understanding of programming – this isn’t your first time opening up R or RStudio, but you’re still learning the ropes (let’s face it, we all are!).

What is a custom function, why would I need one, and how do I make one?

The what: Functions belong to a class of objects that perform some action when called. They are recognizable by their name, followed by enclosing parentheses. If you program in R, you use functions everywhere, from read.csv() to sum() to mutate() . While these functions are defined in base R or the source code of their respective packages, we can also write and use our own.

The why: Have you ever found yourself copying and pasting the same code chunk over and over in a script, perhaps changing one or two things about it with every iteration? While this may seem like an easy solution in the moment, it can become a liability later on when you need to make edits or an error inevitably crops up. Instead, a better approach might be to write a custom function you can invoke as many times as necessary in the script, where the inputs to the function are the things you frequently swapped out in your copy-paste routine. Writing functions improves consistency, portability, and reproducibility, reduces the chances of introducing errors, improves your ability to locate errors, and often saves many lines in your code (check out the don’t repeat yourself principle of software development for even more justification).

The how: Let’s take a look at a simple function that converts cubic feet per second (cfs) to cubic meters per second (cms).

The function has three main components:

A name: cfs_to_cms

A set of arguments. In this case, it is one argument, x , which appears in the format function(arguments)

A body, enclosed by { }

The function will take the input argument, represented by x and run it through the equation in the body of the function to produce the output y . Because y is the last object in the body of the function, the function cfs_to_cms() will return whatever y is as the output. You could also write return(y) at the end of the function to explicitly define the output, like this:

A primer on environments in R

In a script, every line generally performs some operation on an object, be it a number, string, vector, dataframe, list, etc. But where does this happen in the R programming space? Each of these operations (functions) is carried out within a specific environment in your R session. At its simplest, an environment is a list of named objects (vectors, dataframes, functions, other environments…) in no particular order that share space (or in R-speak: “bindings”) with one another.

We won’t get into the minutiae about environments, but it is important to recognize that by default, your R console opens up to the global environment. When you assign objects in the R console using <- , you are binding those objects to the global environment. Functions are neat in that they create their own environments: think about the body of the function { } as its own workspace where things happen, separate from the global environment. The function’s output, however, is still assigned to the global environment.

Why does this matter for our purposes? Well, just remember that objects defined in a function exist within the function’s environment and are isolated from the global environment (but see here ) unless they are returned from the function.

It is helpful to maintain separate function environments to avoid naming conflicts and isolate custom settings in each environment: how many functions in the R universe have objects in the function body named “data_summary” or “output”? Probably quite a few! Maintaining separate environments ensures those wires don’t get crossed if you happen to be using multiple functions with the same object names in their environments.

Running a custom function

To use the cfs_to_cms() function, you must first “run” the code chunk in the console to add it to the global environment, just like a line of code in a script. After that, we can start using the function on data! Let’s start by converting 100 cfs to cms:

According to our custom function, a flow of 100 cfs is equivalent to 2.83 cms. When cfs_to_cms(100) is not assigned to an object, its returned result (the object y inside the function) is simply printed in the console. However, we can assign that result to an object name, like flow , and it will be stored in the global environment. By typing flow into the R console, we can see the returned value flow represents.

We can also feed this function a vector of numbers, and it will return a vector of converted numbers.

This function might be useful if you commonly use flow data that are set in cfs, and you need those data in cms for your analysis. For example, here is a water quality dataframe containing some flow data, with one flow value expressed in cfs and all others expressed in cms:

Let’s try using the tidyverse mutate() function, in combination with ifelse() to obtain consistent units and convert any flow data with the unit cfs to cms (and rename the unit to “cms”).

Voila! We have written a simple custom function and used it to tidy a dataframe to make analysis easier.

A more involved tutorial on writing functions

We will now go through a coding tutorial that might be familiar to those who have worked with water quality data: creating a statistical summary of the mean, median, and standard deviation of a group of chemicals in a dataset. We will obtain our example dataset using the R package dataRetrieval (De Cicco et al. 2024).

Prerequisites

If you’re following along, make sure you have the dataRetrieval and tidyverse packages installed and loaded into your R session.

Now, let’s download some data from Wisconsin!

Let’s say your collaborator sent you this dataset from the Water Quality Portal with phosphorus and nitrate data for two sites, and you need to get the number of samples, mean, median, and standard deviation of each characteristic at each site and put them into a table.

You may first notice after looking over the data that there are two different types of nitrate measurements in the dataset: nitrate in mg/l as N, and nitrate in mg/l as NO 3 . After a back and forth with your collaborator, you both decide you are only interested in a summary of phosphorus as P and nitrate as N. So, let’s subset to the data you want.

In base R, you might start with a routine like this, where you subset by each characteristic and site individually, and calculate the mean, median, and standard deviation:

Phosphorus is done, now on to nitrate! Let’s do a little copy and paste, shall we?

After copying and pasting the phosphorus lines, we simply went through and changed the filtering term from “Phosphorus” to “Nitrate” and replaced any “P” in the object names with “N”.

Now that we have nitrate and phosphorus tables, let’s bind them together into one table using the base R function, rbind() .

How did we do? We’ve got a nice summary table of phosphorus and nitrate from two sites. But what if our collaborator wanted to add another site to the mix and sent you a new dataset? Or decided that they did, indeed, want to have a summary for nitrate in mg/l NO 3 ? You’d have to copy and paste your code again down below, and move the rbind() below that. Alternatively, what if a colleague asked you for your code, because they wanted to adapt it to their workflow with their sites….and they’re working with temperature and pH data?

In the “what if’s” given above, you or another person would need to do a significant amount of copy/paste and re-writing the site id’s and characteristic names to get to a similar summary table. The number of manual steps required to change the code incrementally increases the chances that an error will be introduced somewhere. Believe me, we ran into several typos just creating this example! We may have missed a “P” somewhere, or a “Nitrate” elsewhere, and debugging the location of your oversight can be onerous. This is a fantastic opportunity to…🥁…write a function!

Let’s take a look at a few different options for our custom function, which are by no means exhaustive.

Option 1: Place calculations in the function, do the subsetting outside of the function

This function calculates the summary statistics before placing them into a dataframe. How might we use this with our datasets?

This saves us quite a few lines of code, and just as many opportunities for typos (though admittedly Elise still made TWO writing up this simplified example).

Important aside: documenting your function

It is critical to document your function as you write it: what does it do? What is it for? What requirements must be satisfied to run without errors? Let’s list a few here for our function:

  • The input must be a dataframe
  • The dataframe must have the columns ResultMeasureValue , MonitoringLocationIdentifier , and CharacteristicName
  • ResultMeasureValue must be a numeric data type
  • The dataframe must contain data from a single MonitoringLocationIdentifier and a single CharacteristicName .

When handing off your code to someone else (or to your future self), it is best practice to describe how your function works in plain human-readable text “commented out” using the hash/pound (#) symbol. Any text following a (#) symbol is ignored by the R program, but hopefully not by the user!

Option 2: Use for-loops to group data and perform calculations within function

WARNING: This option uses nested for loops which can be pretty scary looking for the uninitiated. If you take a look at this and it isn’t your cup of tea, feel free to move on. There are friendlier waters ahead.

Another approach might be to have the function do the grouping and summarizing for you. Let’s give a couple for-loops a try. You’ll notice we are using a for loop that indexes the site id and then another that indexes the characteristic name. These for-loops are used to subset every site-characteristic combination, perform the summary calculations, and then place them in a list object.

In this function variant, we first determine the unique sites and water quality charactersitics on which to calculate summary statistics, and then we create a dataframe containing every characteristic-site combination in its own row. Next, we add empty columns in the dataframe to hold the n count, mean, median, and standard deviations calculated for each combination within the for-loops. Then the looping begins, first on characteristic, then on site. Within both loops (i.e. in each iteration), we filter the dataset down to the particular characteristic-site combination. Finally, we use column and row indexing on the summary dataframe to properly fill each summary value. Not too shabby!

The truth is, for-loops have lost popularity over time, often because they may be less efficient than other iterative options (see lapply() and the purrr package ). Still, for-loops are valuable coding implements to have in your tool box (and sometimes they are still faster than other options!).

Option 3: Leverage the dplyr package and native pipe ( |> ) to group data and apply the function

As a final option, we will explore ditching the for-loops for a more user-friendly approach from the dplyr package in the tidyverse family: using group_by() and summarize() . We’ve also thrown in dplyr’s rename() function to get the summary data frame column names right. Note that functions in the tidyverse often return tibbles , which are a specific type of dataframe designed to make data manipulation a little easier .

You might notice some other new syntax here. First, we define the specific package the function comes from using the syntax package:: (in this case, dplyr:: ). When you call the package::function directly, you only need to ensure the package is installed in your R program; you do not need to use the library() function in your script, which saves lines of code. It also prevents you from accidentally calling the wrong function when you have multiple packages that have functions of the same name . Second, we are using the native R pipe , |> . The native R pipe takes what is on the left-hand side of the equation, and places it into the function on the right-hand side of the equation. To read more about pipes, check out this article .

Embracing the “gray area” of code development

With option 3, we may have pushed the utility of a custom function to its limits. We basically took a set of calculations that at the outset were 23 lines, and turned them into one line. Do we need to throw one line into a function? Maybe, and maybe not. We picked a fairly straightforward task that has endless approaches, both with and without custom functions. Programming is an art and is highly dependent upon your use case. However, when thinking about our future selves or our collaborators, it is always important to strategize how we can write tidy, well-documented code that reduces user error and cognitive load.

The next part in this series hones in on ways that you can elevate your built-with-love functions to well-oiled machines that can stand the test of time. Good luck with your coding project and remember that success comes with patience, friendly collaborators, and practice, practice, practice!

Helpful resources

Links to some additional reading:

Introduction to the R Language - Functions (berkeley.edu)

How to create your own functions in R | R-bloggers

Advanced R - Functional Programming

R for Data Science - Functions

De Cicco, L.A., Hirsch, R.M., Lorenz, D., Watkins, W.D., Johnson, M., 2024, dataRetrieval: R packages for discovering and retrieving water data available from Federal hydrologic web services, v.2.7.15, doi:10.5066/P9X4L3GE

Categories:

  • reproducible data science
  • Beyond Basic R
  • data-science
  • r-programming
  • data-pipelines
  • functional-programming
  • reproducible-workflow
  • efficient-coding
  • data science
  • beyond-the-basics-in-R

Related Posts

The hydro network-linked data index.

November 2, 2020

Introduction updated 11-2-2020 after updates described here. The Hydro Network-Linked Data Index (NLDI) is a system that can index data to NHDPlus V2 catchments and offers a search service to discover indexed information.

Using R to pivot wide water-quality data

January 8, 2020

This article will walk through prepping water-quality chemistry data formatted in a “wide” configuration and exporting it to a Microsoft™ Excel “long” file using R. This article will focus on using functions and techniques from the “tidyverse” collection of R packages (dplyr + tidyr + others…).

Jazz up your ggplots!

July 21, 2023

At Vizlab, we make fun and accessible data visualizations to communicate USGS research and data. Upon taking a closer look at some of our visualizations, you may think:

Hydrologic Analysis Package Available to Users

July 26, 2022

A new R computational package was created to aggregate and plot USGS groundwater data, providing users with much of the functionality provided in Groundwater Watch and the Florida Salinity Mapper.

Large sample pulls using dataRetrieval

dataRetrieval is an R package that provides user-friendly access to water data from either the Water Quality Portal (WQP) or the National Water Information Service (NWIS).

share this!

May 13, 2024

This article has been reviewed according to Science X's editorial process and policies . Editors have highlighted the following attributes while ensuring the content's credibility:

fact-checked

trusted source

Biohybrid robot made from flour and oats could act as a biodegradable vector for reforestation

by Italian Institute of Technology

Flour and oats for the biohybrid robot useful for reforestation

Researchers at Istituto Italiano di Tecnologia (IIT-Italian Institute of Technology) in collaboration with the University of Freiburg have developed a biohybrid robot, which consists of a flour-based capsule created using 3D microfabrication techniques, and two natural appendages from oat fruit capable of moving in response to air humidity.

Named HybriBot, this new device can accommodate natural seeds from different plants, serving as a biodegradable vector for reforestation. The research group has already conducted positive tests with tomato, chicory, and willow herb seeds, the latter being one of bees' favorite flowers, from which the plants germinated. A patent application has been filed for the invention.

HybriBot has been described in a paper published in Advanced Materials ; it is born within the framework of the European project i-Seed coordinated by Barbara Mazzolai, Associate Director for Robotics at the IIT, and the innovation ecosystem RAISE (Robotics and AI for Socio-economic Empowerment).

The first author of the work is Isabella Fiorello, who after a research period at the IIT in Mazzolai's group, is now a Junior Principal Investigator at the Cluster of Excellence Living, Adaptive and Energy-autonomous Materials Systems (livMatS) at the University of Freiburg.

The invention represents a further solution that the Bioinspired Soft Robotics laboratory at the IIT, a pioneer in robotics inspired by living organisms, particularly plants, has identified to address problems related to climate change, such as the need for reforestation of large areas and the protection of biodiversity.

The artificial system HybriBot combines a natural component—the oat fruit appendices—with an artificial one, which acts as a transport vessel for seeds, maintaining the movement and interaction capabilities with the environment of the natural specimen.

The oat appendices react to the presence of moisture with movements. They rotate, intersect, and accumulate elastic energy, which, when released, moves the capsule. Their movements continue until, without any control, the plant creeps into a fissure in the ground where it stops, allowing the seed to germinate. HybriBot's movement, therefore, is not supported by batteries or other additional energy sources.

Flour and oats for the biohybrid robot useful for reforestation

The artificial capsule weighs 60 mg, about 3 times the natural weight. It was created by studying the natural capsule and, then, by constructing a mold using 3D microfabrication techniques. The artificial body was made using flour, coated with ethyl cellulose to make the structure waterproof and stable. Once ready, the capsule can be filled with seeds of other plants and fertilizing substances.

The use of biodegradable materials of plant origin makes HybriBot a low environmental impact device; it is also harmless in the event that an animal might ingest it. The research group tested the effectiveness of seed deposition using various types of seeds, such as tomato, chicory, and willow herb, the latter being particularly useful in beekeeping; and in different types of soil, such as potting soil, clay, and sand.

Provided by Italian Institute of Technology

Explore further

Feedback to editors

vector assign for

Tiger beetles fight off bat attacks with ultrasonic mimicry

4 hours ago

vector assign for

Machine learning model uncovers new drug design opportunities

7 hours ago

vector assign for

Astronomers find the biggest known batch of planet ingredients swirling around young star

vector assign for

How 'glowing' plants could help scientists predict flash drought

8 hours ago

vector assign for

New GPS-based method can measure daily ice loss in Greenland

vector assign for

New candidate genes for human male infertility found by analyzing gorillas' unusual reproductive system

9 hours ago

vector assign for

Study uncovers technologies that could unveil energy-efficient information processing and sophisticated data security

10 hours ago

vector assign for

Scientists develop an affordable sensor for lead contamination

vector assign for

Chemists succeed in synthesizing a molecule first predicted 20 years ago

vector assign for

New optical tweezers can trap large and irregularly shaped particles

Relevant physicsforums posts, is it usual for vaccine injection site to hurt again during infection, a brief biography of dr virgina apgar, creator of the baby apgar test.

May 12, 2024

Who chooses official designations for individual dolphins, such as FB15, F153, F286?

May 9, 2024

The Cass Report (UK)

May 1, 2024

Is 5 milliamps at 240 volts dangerous?

Apr 29, 2024

Major Evolution in Action

Apr 22, 2024

More from Biology and Medical

Related Stories

vector assign for

The first 3D-printed biodegradable seed robot, able to change shape in response to humidity

Apr 19, 2023

vector assign for

The first eco-friendly fluorescent artificial seed for monitoring soil temperature by using drones

Nov 21, 2023

vector assign for

Woodlice hold the new record for smallest dispersers of ingested seeds

May 8, 2024

vector assign for

Natural seed banks are detrimental to biodiversity, according to new study

Feb 22, 2023

vector assign for

Team looks to plant tissues that move for inspiration in designing artificial actuators

Sep 19, 2023

vector assign for

A first biodegradable version of Velcro has been created, drawing inspiration from climbing plants

Nov 18, 2021

Recommended for you

vector assign for

Study shows that capuchin monkeys use sticks and stones to dig for food underground

12 hours ago

vector assign for

Study finds antimicrobial resistance in soils Scotland-wide

vector assign for

Scientists unlock mysteries of orangutan communication

vector assign for

High genetic diversity discovered in South African leopards

vector assign for

Scientists develop sticky pesticide to combat pest insects

14 hours ago

Let us know if there is a problem with our content

Use this form if you have come across a typo, inaccuracy or would like to send an edit request for the content on this page. For general inquiries, please use our contact form . For general feedback, use the public comments section below (please adhere to guidelines ).

Please select the most appropriate category to facilitate processing of your request

Thank you for taking time to provide your feedback to the editors.

Your feedback is important to us. However, we do not guarantee individual replies due to the high volume of messages.

E-mail the story

Your email address is used only to let the recipient know who sent the email. Neither your address nor the recipient's address will be used for any other purpose. The information you enter will appear in your e-mail message and is not retained by Phys.org in any form.

Newsletter sign up

Get weekly and/or daily updates delivered to your inbox. You can unsubscribe at any time and we'll never share your details to third parties.

More information Privacy policy

Donate and enjoy an ad-free experience

We keep our content available to everyone. Consider supporting Science X's mission by getting a premium account.

E-mail newsletter

  • <cassert> (assert.h)
  • <cctype> (ctype.h)
  • <cerrno> (errno.h)
  • C++11 <cfenv> (fenv.h)
  • <cfloat> (float.h)
  • C++11 <cinttypes> (inttypes.h)
  • <ciso646> (iso646.h)
  • <climits> (limits.h)
  • <clocale> (locale.h)
  • <cmath> (math.h)
  • <csetjmp> (setjmp.h)
  • <csignal> (signal.h)
  • <cstdarg> (stdarg.h)
  • C++11 <cstdbool> (stdbool.h)
  • <cstddef> (stddef.h)
  • C++11 <cstdint> (stdint.h)
  • <cstdio> (stdio.h)
  • <cstdlib> (stdlib.h)
  • <cstring> (string.h)
  • C++11 <ctgmath> (tgmath.h)
  • <ctime> (time.h)
  • C++11 <cuchar> (uchar.h)
  • <cwchar> (wchar.h)
  • <cwctype> (wctype.h)

Containers:

  • C++11 <array>
  • <deque>
  • C++11 <forward_list>
  • <list>
  • <map>
  • <queue>
  • <set>
  • <stack>
  • C++11 <unordered_map>
  • C++11 <unordered_set>
  • <vector>

Input/Output:

  • <fstream>
  • <iomanip>
  • <ios>
  • <iosfwd>
  • <iostream>
  • <istream>
  • <ostream>
  • <sstream>
  • <streambuf>

Multi-threading:

  • C++11 <atomic>
  • C++11 <condition_variable>
  • C++11 <future>
  • C++11 <mutex>
  • C++11 <thread>
  • <algorithm>
  • <bitset>
  • C++11 <chrono>
  • C++11 <codecvt>
  • <complex>
  • <exception>
  • <functional>
  • C++11 <initializer_list>
  • <iterator>
  • <limits>
  • <locale>
  • <memory>
  • <new>
  • <numeric>
  • C++11 <random>
  • C++11 <ratio>
  • C++11 <regex>
  • <stdexcept>
  • <string>
  • C++11 <system_error>
  • C++11 <tuple>
  • C++11 <type_traits>
  • C++11 <typeindex>
  • <typeinfo>
  • <utility>
  • <valarray>
  • vector<bool>
  • vector::~vector
  • vector::vector

member functions

  • vector::assign
  • vector::back
  • vector::begin
  • vector::capacity
  • C++11 vector::cbegin
  • C++11 vector::cend
  • vector::clear
  • C++11 vector::crbegin
  • C++11 vector::crend
  • C++11 vector::data
  • C++11 vector::emplace
  • C++11 vector::emplace_back
  • vector::empty
  • vector::end
  • vector::erase
  • vector::front
  • vector::get_allocator
  • vector::insert
  • vector::max_size
  • vector::operator[]
  • vector::operator=
  • vector::pop_back
  • vector::push_back
  • vector::rbegin
  • vector::rend
  • vector::reserve
  • vector::resize
  • C++11 vector::shrink_to_fit
  • vector::size
  • vector::swap

non-member overloads

  • relational operators (vector)
  • swap (vector)

std:: vector ::at

Return value, iterator validity, exception safety.

IMAGES

  1. Vector Assign at Vectorified.com

    vector assign for

  2. R Vector

    vector assign for

  3. Vector Assign at Vectorified.com

    vector assign for

  4. Vector::assign的使用_vector assign-CSDN博客

    vector assign for

  5. Vector Assign at Vectorified.com

    vector assign for

  6. C++ : std::vector::assign equivalent for QVector

    vector assign for

VIDEO

  1. Vector

  2. Vector

  3. Vector

  4. Array of Vectors,Vector of vectors in C++

  5. Vector

  6. Arithmetic operators in R

COMMENTS

  1. std::vector<T,Allocator>::assign

    std::vector<T,Allocator>:: assign. Replaces the contents of the container. 1) Replaces the contents with count copies of value value. 2) Replaces the contents with copies of those in the range [first,last). The behavior is undefined if either argument is an iterator into *this . This overload has the same effect as overload (1) if InputIt is an ...

  2. vector

    Assign vector content Assigns new contents to the vector , replacing its current contents, and modifying its size accordingly. In the range version (1), the new contents are elements constructed from each of the elements in the range between first and last , in the same order.

  3. vector :: assign() in C++ STL

    vector:: assign () is an STL in C++ which assigns new values to the vector elements by replacing old ones. It can also modify the size of the vector if necessary. The syntax for assigning constant values: vectorname.assign(int size, int value) Parameters: size - number of values to be assigned.

  4. std::vector

    namespace pmr {. template<class T > using vector = std ::vector< T, std::pmr::polymorphic_allocator< T >>; } (2) (since C++17) 1)std::vector is a sequence container that encapsulates dynamic size arrays. 2)std::pmr::vector is an alias template that uses a polymorphic allocator. The elements are stored contiguously, which means that elements can ...

  5. vector<...>::assign() method

    std::vector assign () method. Replaces the contents of the container with the contents of another. (1) Replaces the contents with count copies of value value. (2) Replaces the contents with copies of those in the range [ first, last ).

  6. How does vector::assign work in C++?

    1. Read the documentation for vector::assign, which should tell you it changes the size of the vector. memcpy can't do that. - Jonathan Wakely. Mar 8, 2017 at 1:32. 2. It would be more like myvector.resize(3); followed by the memcpy. - M.M. Mar 8, 2017 at 1:36. 1.

  7. std::vector::assign

    count - the new size of the container value - the value to initialize elements of the container with first, last - the range to copy the elements from

  8. vector

    Instead, vector containers may allocate some extra storage to accommodate for possible growth, ... assign Assign vector content (public member function) push_back Add element at the end (public member function) pop_back Delete last element (public member function) insert

  9. std::vector<T,Allocator>::assign

    count - the new size of the container value - the value to initialize elements of the container with first, last - the range to copy the elements from

  10. C++ Vector assign() function

    C++ Vector assign() Function. The C++ vector.assign() function assigns new values to the vector replacing any existing values. It is important to keep in mind that the vector assign function will erase any existing data before assigning the new values, if you want to keep the existing value you may want to consider using the vector insert() instead.

  11. What's difference between those two std::vector's assign methods?

    +1 And note that .assign(beg,end) requires the arbitrary type T be emplace-constructible or move-insertible (the latter for std::vector<T> specifically when the iterator type does not meet forward iterator requirements). The requirements for the assignment operator are different; T must be copy-insertible and copy-assignable. Not that it matters much in the OP's case, but just to note that ...

  12. vector

    Any elements held in the container before the call are either assigned to or destroyed. Parameters x A vector object of the same type (i.e., with the same template parameters, T and Alloc). il An initializer_list object. The compiler will automatically construct such objects from initializer list declarators. Member type value_type is the type of the elements in the container, defined in ...

  13. C++ Vectors (With Examples)

    C++ Vector Declaration. Once we include the header file, here's how we can declare a vector in C++: std::vector<T> vector_name; The type parameter <T> specifies the type of the vector. It can be any primitive data type such as int, char, float, etc.For example,

  14. std::vector<T,Allocator>::vector

    constexpr vector (std::from_range_t, R && rg, const Allocator& alloc = Allocator()); (11) (since C++23) Constructs a new container from a variety of data sources, optionally using a user supplied allocator alloc . 1) Default constructor. Constructs an empty container with a default-constructed allocator. 2) Constructs an empty container with ...

  15. Vector in C++ STL

    Syntax to Declare Vector in C++. std::vector<dataType> vectorName; where the data type is the type of data of each element of the vector. You can remove the std:: if you have already used the std namespace. Initialization of Vector in C++. We can initialize a vector in the following ways: 1. Initialization Using List.

  16. Four People Plead Guilty, Sentenced for Multi-Million-Dollar Medicaid

    HARRISBURG — Attorney General Michelle Henry announced that four people who conspired to defraud Medicaid of nearly $9 million have pleaded guilty and been sentenced for their roles in the scheme.

  17. Non-viral vector-based genome editing for cancer immunotherapy

    Despite the exciting promise of cancer immunotherapy in the clinic, immune checkpoint blockade therapy and T cell-based therapies are often associated with low response rates, intrinsic and adaptive immune resistance, and systemic side effects. CRISPR-Cas-based genome editing appears to be an effective strategy to Biomaterials Science Recent Review Articles, 2024 Biomaterials Science Emerging ...

  18. Donald Trump praises fictional serial killer Hannibal Lecter at rally

    "The late, great Hannibal Lecter," former President Donald Trump said during a rally Saturday in New Jersey.

  19. [2405.07110] A Vector Representation for Phylogenetic Trees

    Good representations for phylogenetic trees and networks are important for optimizing storage efficiency and implementation of scalable methods for the inference and analysis of evolutionary trees for genes, genomes and species. We introduce a new representation for rooted phylogenetic trees that encodes a binary tree on n taxa as a vector of length 2n in which each taxon appears exactly twice ...

  20. Geometric model for vector bundles via infinite marked strips

    View PDF Abstract: We present a geometric model for the category of vector bundles over the weighted projective line of type (2,2,n). This model is based on the orbit space of an infinite marked strip under a specific group action. By establishing a bijection between indecomposable bundles and orbits of line segments on the strip, we interpret dimensions of extension spaces as intersection ...

  21. vector

    Parameters alloc Allocator object. The container keeps and uses an internal copy of this allocator. Member type allocator_type is the internal allocator type used by the container, defined in vector as an alias of its second template parameter (Alloc). If allocator_type is an instantiation of the default allocator (which has no state), this is not relevant.

  22. vector::assign

    Assign vector content. Assigns new contents to the vector, replacing its current contents, and modifying its size accordingly. In the range version (1), the new contents are elements constructed from each of the elements in the range between first and last, in the same order. If a reallocation happens,the storage needed is allocated using the ...

  23. Integrated vector genomes may contribute to long-term ...

    The pattern observed for the rhLDLR vector was similar to the rh-β-CG vector results, with high numbers of DNA-containing and RNA-expressing cells at day 14 (65% and 15%, respectively), followed ...

  24. Reproducible Data Science in R: Writing functions that work for you

    However, we can assign that result to an object name, like flow, and it will be stored in the global environment. By typing flow into the R console, we can see the returned value flow represents. We can also feed this function a vector of numbers, and it will return a vector of converted numbers.

  25. Copying std::vector: prefer assignment or std::copy?

    If v1 is about to expire (and you use C++11) you can easily modify it to move the contents. Performancewise assignment is unlikely to be slower then std::copy, since the implementers would probably use std::copy internally, if it gave a performance benefit. In conclusion, std::copy is less expressive, might do the wrong thing and isn't even faster.

  26. Biohybrid robot made from flour and oats could act as a biodegradable

    Named HybriBot, this new device can accommodate natural seeds from different plants, serving as a biodegradable vector for reforestation. The research group has already conducted positive tests ...

  27. New embedding models and API updates

    For example, when using a vector data store that only supports embeddings up to 1024 dimensions long, ... First, developers can now assign permissions to API keys from the API keys page (opens in a new window). For example, a key could be assigned read-only access to power an internal tracking dashboard, or restricted to only access certain ...

  28. vector

    Returns a reference to the element at position n in the vector. The function automatically checks whether n is within the bounds of valid elements in the vector, throwing an out_of_range exception if it is not (i.e., if n is greater than, or equal to, its size).This is in contrast with member operator[], that does not check against bounds. Parameters n ...

  29. Databricks adds vector search, new LLM support to AI suite

    An estimated three-quarters or more of all data is unstructured. Without vector embeddings, that data is inaccessible and models don't benefit from its information. As a result of the ways vector embeddings can help feed the RAG pipelines that inform generative AI models, vector search and storage are now critical data management capabilities.

  30. Assign part of a vector to itself using std::vector::assign()

    If you want to reset the vector to contain a subrange then you can copy those elements into a temporary vector and then assign that temporary vector back to main vector. This should be a move operation (C++11 and above) so no additional copies are made. v = std::vector<decltype(v)::value_type>(v.begin() + 2, v.begin() + 6);