text
stringlengths 2
132k
| source
dict |
|---|---|
like to give the smallest positive amount to each worker consistent with the constraint that if a developer has written more lines of code than their neighbor, they should receive more money. Given an array representing a line of seats of employees at MegaCorp, determine how much each one should get paid. For example, given `[10, 40, 200, 1000, 60, 30]`, you should return `[1, 2, 3, 4, 2, 1]`. Solution` time. [Solution]( * * * ### Problem 269 []( This problem was asked by Microsoft. You are given an string representing the initial conditions of some dominoes. Each element can take one of three values: * `L`, meaning
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
the domino has just been pushed to the left, * `R`, meaning the domino has just been pushed to the right, or * `.`, meaning the domino is standing still. Determine the orientation of each tile when the dominoes stop falling. Note that if a domino receives a force from the left and right side simultaneously, it will remain upright. For example, given the string `.L.R....L`, you should return `LL.RRRLLL`. Given the string `..R...L.L`, you should return `..RR.LLLL`. Solution`, describing the time `t` it takes for a message to be sent from node `a` to node `b`. Whenever a node receives a message, it immediately passes the message on to a neighboring node, if possible. Assuming all nodes are connected, determine how long it will take for every node to receive a message that begins at node `0`. For example, given `N = 5`, and the following edges: ``` edges = [ (0, 1, 5), (0, 2, 3), (0, 5, 4), (1, 3, 8), (2, 3, 1), (3, 5, 10), (3, 4, 5) ] ``` You should return `9`, because propagating the message from `0 -> 2 -> 3 -> 4` will take that much time. Solution` time. Solution`, that determines how many ways it
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
is possible to throw `N` dice with some number of faces each to get a specific total. For example, `throw_dice(3, 6, 7)` should equal `15`. Solution'`, you should return `4`. Solution` worst-case time complexity. If the pattern is found, return the start index of its location.
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
If not, return `False`. [Solution]( * * * ### Problem 277 []( This problem was asked by Google. UTF-8 is a character encoding that maps each symbol to one, two, three, or four bytes. For example, the Euro sign, `€`, corresponds to the three bytes `11100010 10000010 10101100`. The rules for mapping characters are as follows: * For a single-byte character, the first bit must be zero. * For an `n`-byte character, the first byte starts with `n` ones and a zero. The other `n - 1` bytes all start with `10`. Visually, this can be represented as follows. ``` Bytes | Byte format ----------------------------------------------- 1 | 0xxxxxxx 2 | 110xxxxx 10xxxxxx 3 | 1110xxxx 10xxxxxx 10xxxxxx 4 | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx ``` Write a program that takes in an array of integers representing byte values, and returns whether it is a valid UTF-8 encoding. [Solution]( * * * ### Problem 278 []( **THE PROBLEM & THE SOLUTION WAS TAKEN DOWN DUE TO AMAZON'S COPYRIGHTS INFRINGEMENT** * * * ### Problem 279 []( This problem was asked by Twitter. A classroom consists of N students, whose friendships can be represented in an adjacency list. For example, the following descibes a situation where `0` is friends with `1` and `2`, `3` is friends with `6`, and so on. ``` { 0: [1, 2], 1: [0, 5], 2: , 3: , 4: [], 5: , 6: } ``` Each student can be placed in a friend group, which can be defined as the transitive closure of that student's friendship relations. In other words, this is the smallest set such that no student in the group has any friends outside this group. For the example above, the friend groups would be `{0, 1, 2, 5}, {3, 6}, {4}`. Given a friendship
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
list such as the one above, determine the number of friend groups in the class. Solution` is defined by the equation `a^2 + b^2 = c^2`. [Solution]( * * * ### Problem 283 []( This problem was asked by Google. A regular number in mathematics is defined as one which evenly divides some power of `60`. Equivalently, we can say that a regular number is one
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
whose only prime divisors are `2`, `3`, and `5`. These numbers have had many applications, from helping ancient Babylonians keep time to tuning instruments according to the diatonic scale. Given an integer `N`, write a program that returns, in order, the first `N` regular numbers. Solution` tuples, which tell us where on an imaginary `x`-axis a building begins and ends, and how tall
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
it is. The skyline itself can be described by a list of `(x, height)` tuples, giving the locations at which the height visible to a distant observer changes, and each new height. Given an array of buildings as described above, create a function that returns the skyline. For example, suppose the input consists of the buildings `[(0, 15, 3), (4, 11, 5), (19, 23, 4)]`. In aggregate, these buildings would create a skyline that looks like the one below. ``` ______ | | ___ ___| |___ | | | | B | | | C | | A | | A | | | | | | | | | ------------------------ ``` As a result, your function should return `[(0, 3), (4, 5), (11, 3), (15, 0), (19, 4), (23, 0)]`. Solution pairs that represent users visiting websites. Come up with a program that identifies the top `k` pairs of websites with the greatest similarity. For example, suppose `k = 1`, and the list of tuples is: ``` [('a', 1), ('a', 3), ('a', 5), ('b', 2), ('b', 6), ('c', 1), ('c', 2), ('c', 3), ('c', 4), ('c', 5), ('d', 4), ('d', 5), ('d', 6), ('d', 7), ('e', 1), ('e', 3), ('e', 5), ('e', 6)] ``` Then a reasonable similarity metric would most likely conclude that `a` and `e` are the most similar, so your program should return `[('a', 'e')]`. [Solution]( * * * ### Problem 288 []( This problem was asked by Salesforce. The number `6174` is known as Kaprekar's contant, after the mathematician who discovered an associated property: for all four-digit numbers with at least two distinct digits, repeatedly applying a simple procedure eventually results in this value.
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
The procedure is as follows: For a given input `x`, create two new numbers that consist of the digits in `x` in ascending and descending order. Subtract the smaller number from the larger number. For example, this algorithm terminates in three steps when starting from `1234`: ``` 4321 - 1234 = 3087 8730 - 0378 = 8352 8532 - 2358 = 6174 ``` Write a function that returns how many steps this will take for a given input `N`. [Solution]( * * * ### Problem 289 []( This problem was asked by Google. The game of Nim is played as follows. Starting with three heaps, each containing a variable number of items, two players take turns removing one or more items from a single pile. The player who eventually is forced to take the last stone loses. For example, if the initial heap sizes are 3, 4, and 5, a game could be played as shown below: | A | B | C | | --- | --- | --- | | 3 | 4 | 5 | | 3 | 1 | 5 | | 3 | 1 | 3 | | 0 | 1 | 3 | | 0 | 1 | 0 | | 0 | 0 | 0 | In other words, to start, the first player takes three items from pile `B`. The second player responds by removing two stones from pile `C`. The game continues in this way until player one takes last stone and loses. Given a list of non-zero starting values `[a, b, c]`, and assuming optimal play, determine whether the first player has a forced win. [Solution]( * * * ### Problem 290 []( This problem was asked by Facebook. On a mysterious island there are creatures known as Quxes which
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
come in three colors: red, green, and blue. One power of the Qux is that if two of them are standing next to each other, they can transform into a single creature of the third color. Given N Quxes standing in a line, determine the smallest number of them remaining after any possible sequence of such transformations. For example, given the input `['R', 'G', 'B', 'G', 'B']`, it is possible to end up with a single Qux through the following steps: ``` Arrangement | Change ---------------------------------------- ['R', 'G', 'B', 'G', 'B'] | (R, G) -> B ['B', 'B', 'G', 'B'] | (B, G) -> R ['B', 'R', 'B'] | (R, B) -> G ['B', 'G'] | (B, G) -> R ['R'] | ``` [Solution]( * * * ### Problem 291 []( This problem was asked by Glassdoor. An imminent hurricane threatens the coastal town of Codeville. If at most two people can fit in a rescue boat, and the maximum weight limit for a given boat is `k`, determine how many boats will be needed to save everyone. For example, given a population with weights `[100, 200, 150, 80]` and a boat limit of `200`, the smallest number of boats required will be three. [Solution]( * * * ### Problem 292 []( This problem was asked by Twitter. A teacher must divide a class of students into two teams to play dodgeball. Unfortunately, not all the kids get along, and several refuse to be put on the same team as that of their enemies. Given an adjacency list of students and their enemies, write an algorithm that finds a satisfactory pair of teams, or returns `False` if none exists. For example, given the following enemy graph you should return the teams `{0, 1, 4, 5}` and `{2, 3}`. ``` students
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
= { 0: , 1: , 2: [1, 4], 3: [0, 4, 5], 4: [2, 3], 5: } ``` On the other hand, given the input below, you should return `False`. ``` students = { 0: , 1: , 2: [1, 3, 4], 3: [0, 2, 4, 5], 4: [2, 3], 5: } ``` [Solution]( * * * ### Problem 293 []( This problem was asked by Uber. You have N stones in a row, and would like to create from them a pyramid. This pyramid should be constructed such that the height of each stone increases by one until reaching the tallest stone, after which the heights decrease by one. In addition, the start and end stones of the pyramid should each be one stone high. You can change the height of any stone by paying a cost of `1` unit to lower its height by `1`, as many times as necessary. Given this information, determine the lowest cost method to produce this pyramid. For example, given the stones `[1, 1, 3, 3, 2, 1]`, the optimal solution is to pay 2 to create `[0, 1, 2, 3, 2, 1]`. [Solution]( * * * ### Problem 294 []( This problem was asked by Square. A competitive runner would like to create a route that starts and ends at his house, with the condition that the route goes entirely uphill at first, and then entirely downhill. Given a dictionary of places of the form `{location: elevation}`, and a dictionary mapping paths between some of these locations to their corresponding distances, find the length of the shortest route satisfying the condition above. Assume the runner's home is location `0`. For example, suppose you are given the following input: ``` elevations = {0: 5, 1: 25, 2: 15, 3: 20,
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
4: 10} paths = { (0, 1): 10, (0, 2): 8, (0, 3): 15, (1, 3): 12, (2, 4): 10, (3, 4): 5, (3, 0): 17, (4, 0): 10 } ``` In this case, the shortest valid path would be `0 -> 2 -> 4 -> 0`, with a distance of `28`. Solution` space? [Solution]( * * * ### Problem 296 []( This problem was asked by Etsy. Given a sorted array, convert it into a height-balanced binary search tree. [Solution]( * * * ### Problem 297 []( **THE PROBLEM & THE SOLUTION WAS TAKEN DOWN DUE TO AMAZON'S COPYRIGHTS INFRINGEMENT** * * * ### Problem 298 []( This problem was asked by Google. A girl is walking along an apple orchard with a bag in each hand. She likes to pick apples from each tree as she goes along, but is meticulous about not putting different kinds of apples in the same bag. Given an input describing the types of apples she will pass on her path, in order, determine the length of the longest portion of her path that consists of just two types of apple trees. For example, given the input `[2, 1, 2, 3, 3, 1, 3, 5]`, the
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
longest portion will involve types `1` and `3`, with a length of four. Solution` to a text file. Write a program that reads this file as a stream and returns the top 3 candidates at any given time. If you find a voter voting more than once, report this as fraud. Solution`: Add a value to the set of values. * `check(value)`: Check whether a value is in the set. The check method
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
may return occasional false positives (in other words, incorrectly identifying an element as part of the set), but should always correctly identify a true element. [Solution]( * * * ### Problem 302 []( This problem was asked by Uber. You are given a 2-d matrix where each cell consists of either `/`, `\`, or an empty space. Write an algorithm that determines into how many regions the slashes divide the space. For example, suppose the input for a three-by-six grid is the following: ``` \ / \ / \/ ``` Considering the edges of the matrix as boundaries, this divides the grid into three triangles, so you should return `3`. [Solution]( * * * ### Problem 303 []( This problem was asked by Microsoft. Given a clock time in `hh:mm` format, determine, to the nearest degree, the angle between the hour and the minute hands. Bonus: When, during the course of a day, will the angle be zero? [Solution]( * * * ### Problem 304 []( This problem was asked by Two Sigma. A knight is placed on a given square on an `8 x 8` chessboard. It is then moved randomly several times, where each move is a standard knight move. If the knight jumps off the board at any point, however, it is not allowed to jump back on. After `k` moves, what is the probability that the knight remains on the board? [Solution]( * * * ### Problem 305 []( **THE PROBLEM & THE SOLUTION WAS TAKEN DOWN DUE TO AMAZON'S COPYRIGHTS INFRINGEMENT** * * * ### Problem 306 []( This problem was asked by Palantir. You are given a list of N numbers, in which each number is located at most k places away from its sorted position. For example, if `k = 1`, a given
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
element at index `4` might end up at indices `3`, `4`, or `5`. Come up with an algorithm that sorts this list in `O(N log k)` time. Solution & T` and `F | (T & T)`. [Solution]( * * * ### Problem 309 []( This problem was asked by Walmart Labs. There are `M` people sitting in a row of `N` seats, where `M < N`. Your task is to redistribute people such that there are no gaps between any of them, while keeping overall movement to a minimum. For example, suppose you are faced with an input of `[0, 1, 1, 0, 1, 0, 0, 0, 1]`, where `0` represents an empty seat and `1` represents a person. In this case, one solution would be to place the person on the right in the fourth
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
seat. We can consider the cost of a solution to be the sum of the absolute distance each person must move, so that the cost here would be `5`. Given an input such as the one above, return the lowest possible cost of moving people to remove all gaps. Solution` time. An element is considered a peak if it is greater than both its left and right neighbors. It is guaranteed that the first and last elements are lower than all others. [Solution]( * * * ### Problem 312 []( This problem was asked by Wayfair. You are given a `2 x N` board, and instructed to completely cover the board with the following shapes: * Dominoes, or `2 x 1` rectangles. * Trominoes, or L-shapes. For example, if `N = 4`, here is one possible configuration, where A is a domino, and B and C are trominoes. ``` A B B C A B C C ``` Given an integer N, determine in how many ways this task is possible. [Solution]( * * * ### Problem 313 []( This problem was asked by Citrix. You are given a circular lock with three wheels, each of which display the numbers `0` through `9` in order. Each of these wheels rotate clockwise and counterclockwise. In addition, the lock has a certain number of "dead ends", meaning that if you turn the wheels to one of these combinations, the
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
lock becomes stuck in that state and cannot be opened. Let us consider a "move" to be a rotation of a single wheel by one digit, in either direction. Given a lock initially set to `000`, a target combination, and a list of dead ends, write a function that returns the minimum number of moves required to reach the target state, or `None` if this is impossible. Solution to `1000` (east). Given a list of `N` listeners, and a list of `M` radio towers, each placed at various locations along this line, determine what the minimum broadcast range would have to be in order for each listener's home to be covered. For example, suppose `listeners = [1, 5, 11, 20]`, and `towers = [4, 8, 15]`. In this case the minimum range would be `5`, since that would be required for the tower at position `15` to reach the listener at position `20`. [Solution]( * * * ### Problem 315 []( This problem was asked by Google. In linear algebra, a Toeplitz matrix is one in which the elements on any given diagonal from top left to bottom right are identical. Here is an example: ``` 1 2 3 4 8 5 1 2 3 4 4 5 1 2 3 7 4 5 1 2 ``` Write a program to determine whether a given input is a Toeplitz matrix. [Solution]( * * * ### Problem 316 []( This problem was asked by Snapchat. You are given an array of length `N`, where each element `i` represents the
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
number of ways we can produce `i` units of change. For example, `[1, 0, 1, 1, 2]` would indicate that there is only one way to make `0`, `2`, or `3` units, and two ways of making `4` units. Given such an array, determine the denominations that must be in use. In the case above, for example, there must be coins with value `2`, `3`, and `4`. [Solution]( * * * ### Problem 317 []( This problem was asked by Yahoo. Write a function that returns the bitwise `AND` of all integers between `M` and `N`, inclusive. [Solution]( * * * ### Problem 318 []( This problem was asked by Apple. You are going on a road trip, and would like to create a suitable music playlist. The trip will require `N` songs, though you only have `M` songs downloaded, where `M < N`. A valid playlist should select each song at least once, and guarantee a buffer of `B` songs between repeats. Given `N`, `M`, and `B`, determine the number of valid playlists. [Solution]( * * * ### Problem 319 []( This problem was asked by Airbnb. An 8-puzzle is a game played on a `3 x 3` board of tiles, with the ninth tile missing. The remaining tiles are labeled `1` through `8` but shuffled randomly. Tiles may slide horizontally or vertically into an empty space, but may not be removed from the board. Design a class to represent the board, and find a series of steps to bring the board to the state `[[1, 2, 3], [4, 5, 6], [7, 8, None]]`. [Solution]( * * * ### Problem 320 []( **THE PROBLEM & THE SOLUTION WAS TAKEN DOWN DUE TO AMAZON'S COPYRIGHTS INFRINGEMENT** * * * ### Problem 321 []( This problem was asked by PagerDuty. Given
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
a positive integer `N`, find the smallest number of steps it will take to reach `1`. There are two kinds of permitted steps: * You may decrement `N` to `N - 1`. * If `a * b = N`, you may decrement `N` to the larger of `a` and `b`. For example, given `100`, you can reach `1` in five steps with the following route: `100 -> 10 -> 9 -> 3 -> 2 -> 1`. Solution` time. [Solution]( * * * ### Problem 324 []( **THE PROBLEM & THE SOLUTION WAS TAKEN DOWN DUE TO AMAZON'S COPYRIGHTS INFRINGEMENT** * * * ### Problem 325 []( This problem was asked by Jane Street. The United States uses the imperial system of weights and measures, which means that there are many different, seemingly arbitrary units to measure distance. There are 12 inches in a foot, 3 feet in a yard, 22 yards in a chain, and so on. Create a data structure that can efficiently convert a certain quantity of one unit
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
to the correct amount of any other unit. You should also allow for additional units to be added to the system. [Solution]( * * * ### Problem 326 []( This problem was asked by Netflix. A Cartesian tree with sequence `S` is a binary tree defined by the following two properties: It is heap-ordered, so that each parent value is strictly less than that of its children. An in-order traversal of the tree produces nodes with values that correspond exactly to `S`. For example, given the sequence `[3, 2, 6, 1, 9]`, the resulting Cartesian tree would be: ``` 1 / \ 2 9 / \ 3 6 ``` Given a sequence S, construct the corresponding Cartesian tree. [Solution]( * * * ### Problem 327 []( This problem was asked by Salesforce. Write a program to merge two binary trees. Each node in the new tree should hold a value equal to the sum of the values of the corresponding nodes of the input trees. If only one input tree has a node in a given position, the corresponding node in the new tree should match that input node. [Solution]( * * * ### Problem 328 []( This problem was asked by Facebook. In chess, the Elo rating system is used to calculate player strengths based on game results. A simplified description of the Elo system is as follows. Every player begins at the same score. For each subsequent game, the loser transfers some points to the winner, where the amount of points transferred depends on how unlikely the win is. For example, a 1200-ranked player should gain much more points for beating a 2000-ranked player than for beating a 1300-ranked player. Implement this system. [Solution]( * * * ### Problem 329 []( **THE PROBLEM & THE SOLUTION WAS TAKEN
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
DOWN DUE TO AMAZON'S COPYRIGHTS INFRINGEMENT** * * * ### Problem 330 []( This problem was asked by Dropbox. A Boolean formula can be said to be satisfiable if there is a way to assign truth values to each variable such that the entire formula evaluates to true. For example, suppose we have the following formula, where the symbol `¬` is used to denote negation: ``` (¬c OR b) AND (b OR c) AND (¬b OR c) AND (¬c OR ¬a) ``` One way to satisfy this formula would be to let `a = False`, `b = True`, and `c = True`. This type of formula, with AND statements joining tuples containing exactly one OR, is known as 2-CNF. Given a 2-CNF formula, find a way to assign truth values to satisfy it, or return `False` if this is impossible. Solution` satisfy the following conditions: ``` a + b = M a XOR b = N ``` [Solution]( * * * ### Problem 333 []( This problem was asked by Pinterest. At a party, there is a single person who everyone knows, but who
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
does not know anyone in return (the "celebrity"). To help figure out who this is, you have access to an `O(1)` method called `knows(a, b)`, which returns `True` if person `a` knows person `b`, else `False`. Given a list of `N` people and the above operation, find a way to identify the celebrity in `O(N)` time. Solution * 8 = 24`. Write a function that plays the `24` game. Solution = (1 - d) / N + d * (score(Sx) / Cx+ score(Sy) / Cy+ ... + score(Sz) / Cz)) ``` Here, `Sx, Sy, ..., Sz` denote the scores of all the other sites that have outgoing links to `Sj`, and `d` is a damping factor, usually set to around `0.85`, used to model the probability that
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
a user will stop searching. Given a directed graph of links between various websites, write a program that calculates each site's page rank. Solution, return `9` (`1001`). Solution` on a 2D cartesian plane, find the two closest points. For example, given the points `[(1, 1), (-1, -1), (3, 4), (6, 1), (-1, -6), (-4, -3)]`, return `[(-1, -1), (1, 1)]`. [Solution]( * * * ### Problem 341 []( This problem was asked by Google. You are given an N by N
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
matrix of random letters and a dictionary of words. Find the maximum number of words that can be packed on the board from the given dictionary. A word is considered to be able to be packed on the board if: * It can be found in the dictionary * It can be constructed from untaken letters by other words found so far on the board * The letters are adjacent to each other (vertically and horizontally, not diagonally). * Each tile can be visited only once by any word. For example, given the following dictionary: ``` { 'eat', 'rain', 'in', 'rat' } ``` and matrix: ``` [['e', 'a', 'n'], ['t', 't', 'i'], ['a', 'r', 'a']] ``` Your function should return 3, since we can make the words 'eat', 'in', and 'rat' without them touching each other. We could have alternatively made 'eat' and 'rain', but that would be incorrect since that's only 2 words. Solution is a function that takes in an array, a combining function, and an initial value and builds up a result by calling the combining function on each element of the array, left to right. For example, we can write `sum()` in terms of reduce: def add(a, b): return a + b def sum(lst): return reduce(lst, add, 0) This should call add on the initial value with the first element of the array, and then the result of that with the second element of the array, and so on until we reach the end, when we return the sum of the array. Implement your own version of reduce. [Solution]( * * * ### Problem 343 []( This problem was asked by Google. Given a binary search tree and
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
a range `[a, b]` (inclusive), return the sum of the elements of the binary search tree within the range. For example, given the following tree: ``` 5 / \ 3 8 / \ / \ 2 4 6 10 ``` and the range `[4, 9]`, return `23 (5 + 4 + 6 + 8)`. Solution` satisfies our requirement. Write a function that returns the maximum number of edges you can remove while still satisfying this requirement. Solution` and `(eat, consume)`. Using this set, determine if two sentences with the same number of words are equivalent. For example, the following two sentences are equivalent: * "He wants to eat food." * "He wants to consume food." Note that the synonyms `(a, b)` and `(a, c)` do not necessarily imply `(b, c)`: consider the case of `(coach, bus)` and `(coach, teacher)`. Follow-up: what if we can assume that `(a, b)` and `(a, c)` do in fact imply `(b, c)`? [Solution]( * * * ### Problem 346 []( This problem was asked by Airbnb. You are given a huge list of airline ticket prices between
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
different cities around the world on a given day. These are all direct flights. Each element in the list has the format `(source_city, destination, price)`. Consider a user who is willing to take up to `k` connections from their origin city `A` to their destination `B`. Find the cheapest fare possible for this journey and print the itinerary for that journey. For example, our traveler wants to go from JFK to LAX with up to 3 connections, and our input flights are as follows: ``` [ ('JFK', 'ATL', 150), ('ATL', 'SFO', 400), ('ORD', 'LAX', 200), ('LAX', 'DFW', 80), ('JFK', 'HKG', 800), ('ATL', 'ORD', 90), ('JFK', 'LAX', 500), ] ``` Due to some improbably low flight prices, the cheapest itinerary would be JFK -> ATL -> ORD -> LAX, costing $440. [Solution]( * * * ### Problem 347 []( This problem was asked by Yahoo. You are given a string of length `N` and a parameter `k`. The string can be manipulated by taking one of the first `k` letters and moving it to the end. Write a program to determine the lexicographically smallest string that can be created after an unlimited number of moves. For example, suppose we are given the string `daily` and `k = 1`. The best we can create in this case is `ailyd`. [Solution]( * * * ### Problem 348 []( This problem was asked by Zillow. A ternary search tree is a trie-like data structure where each node may have up to three children. Here is an example which represents the words `code`, `cob`, `be`, `ax`, `war`, and `we`. ``` c / | \ b o w / | | | a e d a | / | | \ x b e r e ``` The tree is structured according to the following rules:
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
* left child nodes link to words lexicographically earlier than the parent prefix * right child nodes link to words lexicographically later than the parent prefix * middle child nodes continue the current word For instance, since code is the first word inserted in the tree, and `cob` lexicographically precedes `cod`, `cob` is represented as a left child extending from `cod`. Implement insertion and search functions for a ternary search tree. Solution. * Keep the first letter. The remaining steps only apply to the rest of the string. * Remove all vowels, including `y`, `w`, and `h`. * Replace all consonants with the following digits: ``` b, f, p, v -> 1 c, g, j, k, q, s, x, z -> 2 d, t -> 3 l -> 4 m, n -> 5 r -> 6 ``` If you don't have three numbers yet, append zeros until you do. Keep the first three numbers. Using this scheme, `Jackson` and `Jaxen` both map to `J250`. Implement Soundex. Solution` * Given `N = 17`, return `2``(16 + 1)` * Given `N = 18`, return `2``(9 + 9)`
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
Solution. Write a program to determine whether a given matrix qualifies as a crossword grid. [Solution]( * * * ### Problem 353 []( This problem was asked by Square. You are given a histogram consisting of rectangles of different heights. These heights are represented in an input list, such that `[1, 3, 2, 5]` corresponds to the following diagram: ``` x x x x x x x x x x x ``` Determine the area of the largest rectangle that can be formed
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
only from the bars of the histogram. For the diagram above, for example, this would be six, representing the `2 x 3` area at the bottom right. [Solution]( * * * ### Problem 354 []( This problem was asked by Google. Design a system to crawl and copy all of Wikipedia using a distributed network of machines. More specifically, suppose your server has access to a set of client machines. Your client machines can execute code you have written to access Wikipedia pages, download and parse their data, and write the results to a database. Some questions you may want to consider as part of your solution are: * How will you reach as many pages as possible? * How can you keep track of pages that have already been visited? * How will you deal with your client machines being blacklisted? * How can you update your database when Wikipedia pages are added or updated? [Solution]( * * * ### Problem 355 []( This problem was asked by Airbnb. You are given an array `X` of floating-point numbers `x1, x2, ... xn`. These can be rounded up or down to create a corresponding array `Y` of integers `y1, y2, ... yn`. Write an algorithm that finds an appropriate `Y` array with the following properties: * The rounded sums of both arrays should be equal. * The absolute pairwise difference between elements is minimized. In other words, `|x1- y1| + |x2- y2| + ... + |xn- yn|` should be as small as possible. For example, suppose your input is `[1.3, 2.3, 4.4]`. In this case you cannot do better than `[1, 2, 5]`, which has an absolute difference of `|1.3 - 1| + |2.3 - 2| + |4.4 - 5| = 1`. [Solution]( * * * ### Problem 356 [](
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
This problem was asked by Netflix. Implement a queue using a set of fixed-length arrays. The queue should support `enqueue`, `dequeue`, and `get_size` operations. Solution`, where `l` corresponds to the left child and `r` corresponds to the right child. If either `l` or `r` is null, it will be represented as a zero. Otherwise, it will be represented by a new `(lr)` pair. Here are a few examples: * A root node with no children: `(00)` * A root node with two children: `((00)(00))` * An unbalanced tree with three consecutive left children: `((((00)0)0)0)` Given this representation, determine the depth of the tree. Solution` time: * `plus`: Add a key with value 1. If the key already exists, increment its value by one. * `minus`: Decrement the value of a key. If the key's value is currently 1, remove it. * `get_max`: Return a key with the highest value. * `get_min`: Return a key with the lowest value. [Solution]( * * * ### Problem 359 []( This problem was asked by Slack. You are given a string formed by concatenating several words corresponding to the integers zero through nine and then anagramming. For example, the input could be 'niesevehrtfeev', which is an anagram of 'threefiveseven'. Note that there can be multiple instances of each integer. Given this string, return the original integers in sorted order. In the example above, this would be `357`. [Solution]( * * * ### Problem 360 []( This problem
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
was asked by Spotify. You have access to ranked lists of songs for various users. Each song is represented as an integer, and more preferred songs appear earlier in each list. For example, the list `[4, 1, 7]` indicates that a user likes song `4` the best, followed by songs `1` and `7`. Given a set of these ranked lists, interleave them to create a playlist that satisfies everyone's priorities. For example, suppose your input is `{[1, 7, 3], [2, 1, 6, 7, 9], [3, 9, 5]}`. In this case a satisfactory playlist could be `[2, 1, 6, 7, 3, 9, 5]`. [Solution]( * * * ### Problem 361 []( This problem was asked by Facebook. Mastermind is a two-player game in which the first player attempts to guess the secret code of the second. In this version, the code may be any six-digit number with all distinct digits. Each turn the first player guesses some number, and the second player responds by saying how many digits in this number correctly matched their location in the secret code. For example, if the secret code were `123456`, then a guess of `175286` would score two, since `1` and `6` were correctly placed. Write an algorithm which, given a sequence of guesses and their scores, determines whether there exists some secret code that could have produced them. For example, for the following scores you should return `True`, since they correspond to the secret code `123456`: `{175286: 2, 293416: 3, 654321: 0}` However, it is impossible for any key to result in the following scores, so in this case you should return `False`: `{123456: 4, 345678: 4, 567890: 4}` [Solution]( * * * ### Problem 362 []( This problem was asked by Twitter. A strobogrammatic number is a positive number that appears the
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
same after being rotated `180` degrees. For example, `16891` is strobogrammatic. Create a program that finds all strobogrammatic numbers with N digits. Solution -> 7 add_subtract(1)(2)(3) -> 1 + 2 - 3 -> 0 add_subtract(-5)(10)(3)(9) -> -5 + 10 - 3 + 9 -> 11 ``` Solution` time. Solution`: add a new item `x` to the left end of the list * `pop()`: remove and return the item on the left end of the list * `pull()`: remove the item on the right end of the list. Implement a quack using three stacks and `O(1)` additional memory, so that the amortized time for any push, pop, or pull operation is `O(1)`. [Solution]( * * *
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
Title: A Map-like Micro-Organization of Grid Cells in the Medial Entorhinal Cortex URL Source: Markdown Content: A Map-like Micro-Organization of Grid Cells in the Medial Entorhinal Cortex - ScienceDirect =============== Typesetting math: 100% Skip to main content []( "My account") []( "Sign In") * View**PDF** 2. Summary 3. Graphical Abstract 4. Keywords 5. Introduction 6. Results 7. Discussion 8. STAR★Methods 9. Acknowledgments 10. References Show full outline Cited by (60) ------------ 1. ") 2. Download: Download full-size image * [Previous article in issue]( * [Next article in issue]( Keywords
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
-------- medial entorhinal cortex grid cell grid module grid phase pyramidal cell stellate cell calcium imaging microprism virtual reality continuous attractor network models Introduction ------------ Topographical maps have been observed in many sensory and motor systems. For example, neurons in primary visual cortex form a retinotopic map, in which neuronal responses are anatomically organized to reproduce the visual image on the retina (Tootell et al., 1982, body surface, and body musculature are represented by topographically arranged neurons in the auditory cortex (tonotopic map) (Weisz et al., 2004 (somatotopic map) (Kaas et al., 1979 (Purves et al., 2001 for cognitive variables have not been widely reported. A notable exception is a recently revealed topographical organization in the central complex of the fly, where a bump of activity is generated within a circle of dendritic arbors and tracks the fly’s orientation (Seelig and Jayaraman, 2015
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
but not others indicates that topography is not required for the function of neural networks, as some networks can operate by enforcing a certain connectivity diagram on randomly arranged neurons. However, in the presence of topography, the anatomical arrangement of neurons mirrors the pattern of projections they receive (e.g., somatotopic map) or the property of the variable computed in the network (e.g., tonotopic map), favoring both the precision and efficiency of neural connectivity and facilitating circuit function. Here, we address the relationship between anatomical location and function of grid cells in the mouse medial entorhinal cortex (MEC), a higher cognitive system important for spatial representation and episodic memory. In rodents, the firing fields of each grid cell lie on a triangular lattice characterized by spatial scale, lattice orientation, and phase (Hafting et al., 2005, which are arranged in patches on a triangular lattice, and stellate cells, which distribute between patches
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
(Kitamura et al., 2014 are organized. In one class of continuous attractor networks (CAN) that model grid firing, neuronal activity across the population is manifest as multiple bumps of activity in a two-dimensional (2D) sheet of phase-arranged grid cells (Burak and Fiete, 2009 uses the efficiently implemented synaptic connectivity underlying attractor models, in which each neuron has spatially restricted interactions with its surrounding neighbors, one predicts that grid cells with identical phase might be anatomically located in a set of vertices of a grid like lattice pattern across the cell sheet. Also, in the local neighborhood of any particular grid cell the relative anatomical arrangement of cells with different phases would correspond to their relative 2D phase offsets (Figure 1. During early development, such a topographically arranged network could also serve as a teaching signal for a less topographical grid cell network in adults ([McNaughton et al., 2006]( Although evidence exists supporting CAN models ([Couey et al., 2013]( [Domnisoru et al., 2013]( [Heys et al., 2014]( [Pastoll et al., 2013]( [Stensola et
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
al., 2012]( Yoon et al., 2013. Such topographical randomness increases the difficulty of establishing the precise synaptic connectivity matrix required for CAN models. In general, a better understanding of the micro-organization of grid phases will help to elucidate the potential biological implementation of CAN models. !Image 12]( "Download high-res image (1MB)") 2. Download: Download full-size image Figure 1. Possible Anatomical Organizations of Grid Cells in CAN Models (A) An animal navigates past three locations in a square environment. (B) Firing fields of three grid cells with different phases (a, b, and c) active at the three locations in (A) (1, 2, and 3, respectively) and their relative phase offsets, shown in the phase overlay. (C) Two possible anatomical organizations of grid cells under the synaptic connectivity predicted by CAN models. (i) Grid cell somas are organized by their phase offsets. Top: at every location the animal passes, the cell sheet exhibits multiple activity bumps arranged in a triangular lattice. The cells generating these bumps have identical phases in the environment (e.g., all cells at magenta bumps have identical phases as cell a in (B)). The lattice of activity bumps moves along with the animal’s trajectory so that the trajectory in the environment is mapped to multiple activity trajectories on the cell sheet. Middle: cells with identical phases are anatomically arranged at vertices of
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
a triangular lattice. Bottom: relative anatomical arrangement of cells in local brain neighborhoods corresponds to their phase offsets (phase overlay in (B)) and repeats on the cell sheet. (ii) Grid cell somas and activity bumps are randomly arranged. The anatomical arrangement of cells with identical phases (middle) and the relative arrangements of cells in local neighborhoods (bottom) are random. Here, we investigated the micro-organization of grid cells in mouse MEC using cellular resolution two-photon calcium imaging during navigation, which allowed us to precisely correlate grid cell activity with anatomical location. We demonstrate a significant map-like relationship between the topography of these neurons and their circuit function. Results ------- ### Simultaneous Imaging of Pyramidal and Stellate Cells during Virtual Navigation Two-photon calcium imaging of neurons in layer 2 of the mouseMEC was performed using a microprism chronically implanted into the transverse fissure, providing fields of view (FOVs) nearly parallel to the cortical surface (Low et al., 2014. !Image 13]( "Download high-res image (3MB)") 2. Download: Download full-size image Figure S1. Cellular-Resolution Two-Photon Imaging of Grid Cells in Layer 2 of the Mouse MEC during Virtual Navigation, Related to Figure 2 Microprism implant placement for cellular-resolution imaging of the MEC. (B) Strategy for chronic cellular-resolution optical access to the MEC using a 1.5mm right angle microprism inserted into the transverse fissure. (C) Parasagittal slice of the MEC from a GP5.3 mouse stained with [WFS1]( "Learn more about WFS1 from ScienceDirect's
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
AI-generated Topic Pages") (wolframin ER transmembrane glycoprotein 1) and REELIN antibodies. Region between the two dashed yellow curves is layer 2, in which GCaMP6f was highly expressed in stellate (REELIN+) and pyramidal cells (WFS1+). D: dorsal; V: ventral; P:posterior; A: anterior. Same in all figures. Scale bar: 100μm. (D) Parasagittal slice showing expression of GCaMP6f in REELIN+ neurons, which included stellate cells and REELIN+interneurons in layer 2 (the region between the two dashed yellow curves) of the MEC in GP5.3 mice. Interneurons were stained with GAD67 antibody. Scale bar: 50μm. (E) Percentage of different REELIN+ neurons expressing GCaMP6f. First two columns show percentages of GCaMP6f+ stellate cells and REELIN+interneurons. Last column shows percentage of REELIN+interneurons among all REELIN+ neurons. Intnr: interneuron. (F) Fluorescence intensity of GCaMP6f, which was quantified by mean gray value, in stellate cells and REELIN+ interneurons. Intnr: interneuron. (G) Percentages of stellate (Ste) and pyramidal (Pyr) cells that expressed GCaMP6f. Note: since only 3.32 ± 1.1% of REELIN+ neurons were interneurons ((D)and(E)), contamination in REELIN+ stellate cells by interneurons was negligible and all the observed REELIN+ neurons were considered to be stellate cells. (H) _In vivo_ two-photon image of GCaMP6f-labeled cell bodies in layer 2 of the MEC in GP5.3 mice. Scale bar: 50μm. (I) Pyramidal and stellate cells in layer 2 of the MEC (the region between the two dashed yellow curves) had different cell body diameters in _in vitro_ brain slices (parasagittal). Left panels, from left to right: expression
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
of GCaMP6f in layer 2 neurons of the MEC; WFS1 staining reveals pyramidal cells; REELIN staining reveals stellate cells. Middle panels: overlay of GCaMP6f with WFS1 (left) or REELIN (right). Right panel: diameters of cell bodies. Each dot represents the COM of one cell with a color representing the diameter of its cell body. Scale bar: 50μm. (J) Cell body diameters of GCaMP6f+ layer 2 neurons in the MEC measured in _in vitro_ brain slices. Left: diameters of individual cells. Magenta and green dots represent pyramidal and stellate cells, respectively. Right: distribution of cell diameters of all GCaMP6f+ layer 2 cells _in vitro_ is shown by both a histogram (bars) and a kernel density estimate (red curve). (K) Identification of pyramidal and stellate cells based on their diameters. Magenta and green dots represent real pyramidal and stellate cells, respectively. (L) Cell body diameters of pyramidal and stellate cells _in vivo_. Left: layer 2 neurons in the MEC _in vivo_ imaged using a two-photon microscope. Middle: diameters of cells _in vivo_. Each dot represents the COM of one cell with a color showing the diameter of its cell body. Right: identified pyramidal (magenta) and stellate (green) cells based on their cell body diameters. Scale bar: 50μm. (M) Cell body diameters of GCaMP6f+ layer 2 neurons of the MEC _in vivo_. Top: diameters of individual cells. Each dot represents one cell. Bottom: the distribution of all cell diameters shown by a histogram (bars) and a kernel density estimate (red curve). (N) Distributions of pyramidal and stellate cells identified _in vivo_ in two mice (left and right examples). Green and magenta dots represent the
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
COMs of stellate and pyramidal cells, respectively. Scaler bar: 100μm. D: dorsal. V: ventral. M: medial. L: lateral. Same in all following figures. (O) Schematic diagram of experimental apparatus, consisting of an air-supported spherical treadmill, axle positioned to constrain treadmill rotation to the forward/backward direction, visual display system for VR (RM, reflecting mirror; AAM, angular amplification mirror, toroidal screen, a megapixel camera to record treadmill rotation, PC running ViRMEn software), custom two-photon microscope with rotatable objective, headpost (headplate was mounted only on the right side of the animal), and a water-reward delivery system. (P) Schematic of a 1000-cm virtual linear track used for navigation during imaging of neurons in the MEC. Blue light was displayed to reduce detection of projected light by the microscope. (Q) Spatial dependence of calcium transients of an imaged grid cell. Top: heat plot of ΔF/F versus linear track position for a set of sequential traversals (Runs). Middle: mean ΔF/F versus linear track position, Bottom: 1-p value function (1-p, dark blue) along the track, indicating statistical significance of the calcium signals in each spatial bin compared to shuffled data. In- and out-of-field periods (red and gray blocks) were identified based on the 1-p value within the periods. (R) Example of schematic response of a cue cell that matches the distribution of salient cues along the virtual track. From top to bottom: side view of a 1000-cm long VR track; the cue template of the track showing the distribution of salient cues; 1D response of a cue cell on the track. (S) To calculate the cue score, the 1D response of a cue cell was shifted according to
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
its correlation to the cue template. Top: cross-correlation between the cue cell response and cue template under spatial shifts (lags) up to 300 cm in both directions. Middle: cue template. Bottom: 1D response of the cue cell was shifted by the amount of the lag, at which the correlation was maximal. (T) Cue score was calculated as the mean correlation between each cue and the 1D response around the cue. Five cues were involved in the calculation for this example. The last cue, which was located at the very end of the track (indicated in (S)), was removed from the analysis. Cells with cue scores above the 95 th percentile of shuffles were identified as cue cells. (U) Tetrode-recorded cue cells and grid cells on a VR track. Each cell was recorded in a real 2D environment and 1D VR track. For each cell: left top: spikes (red dots) and trajectory (gray trace) in a 0.5× 0.5 m real 2D environment. Left middle: firing rate in the 2D environment, calculated based on the spikes on top. Left bottom: autocorrelogram of the firing rate in the middle. Right top: spikes (red dots) and trajectory (gray trace) on multiple traversals of the 1D VR track. Right middle: firing rate along the track calculated from the spikes on top. Right bottom: overlay of cue template (C.T., in red) and shifted firing rate (F.R., in gray) according to the lag. (V) Imaged cue cells and grid cells on a VR track. Cells were only imaged on 1D VR tracks and classified based on the grid cell classifier and their cue scores. For each cell: top: heat plot of ΔF/F versus linear track position for a
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
set of sequential traversals. Middle: mean ΔF/F versus linear track position. Bottom: overlay of cue template (C.T., in red) and shifted mean ΔF/F (M. ΔF/F, in gray) according to the lag. Error bars: mean ± SEM. A, B and O were modified from Low et al. (2014) (Dana et al., 2014 (Figures S1 diameters: stellate cells generally have larger diameters than pyramidal cells. The two cell types were classified with high accuracy (98.0% and 96.4% for stellate and pyramidal cells, respectively), and classified pyramidal cells formed multiple patches surrounded by stellate cells, as previous observed (Kitamura et al., 2014. As shown previously, cells exhibited multiple “spatial fields,” which were used to identify putative grid cells by applying a previously developed 1D grid cell classifier (Domnisoru et al., 2013 (7.3% ± 1.3% of cells originally
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
classified as grid cells), which represents environmental features (Diehl et al., 2017 than among pyramidal cells (18.4% ± 2.9%) (Figures 2, and most grid cells were stellate (75.6% ± 3.2%). Relatedly, significant calcium transients in stellate cells generally showed higher frequencies and larger amplitudes than in pyramidal cells (Figure S2]( "Download high-res image (852KB)") 2. Download: Download full-size image Figure 2. Grid Cells Are Mostly Stellate Cells and Form Clusters (A) Baseline-subtracted ΔF/F (black) and significant calcium transients (red) in three stellate and pyramidal cells. Virtual track position and water rewards are shown at bottom. (B) Spatial dependence of calcium responses of stellate and pyramidal grid cells. For each cell: (top) heat plot of ΔF/F versus track position of sequential traversals, black dots are bins without imaging data due to very low or high running speed (STAR Methods mean ΔF/F versus track position; (bottom) 1-p value function (1-p). (C) Percentage of GCaMP6f+ stellate and pyramidal cells that were grid cells (517
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
stellate and 408 pyramidal cells in 18 FOVs of six mice). p= 2.5× 10−4. (D) Pairwise distances between grid cells (G/G) and grid and non-grid cells (G/NG) (294 grid and 631 non-grid cells in 18 FOVs of six mice). p=5.2× 10−29. (E) Percentage of pyramidal grid cells at different distances from centers of pyramidal patches (272 pyramidal cells in 14 FOVs of five mice). Curves: real data (magenta) and 100 shuffles (gray). Bin width: 15 μm. (F) Pairwise distances between pyramidal grid cells and stellate cells (PG), and pyramidal non-grid cells and stellate cells (PNG) (517 stellate and 408 pyramidal cells in 18 FOVs of six mice). p= 3.3× 10−38. (G) Distribution of grid (G) and non-grid cells (NG). Dots and circles represent centers of mass (COMs) of individual cells, similar in all figures. Scale bar, 100 μm. Gray patterns represent blood vessels. D, dorsal; V, ventral; M, medial; L, lateral, similar in all figures. ∗p ≤ 0.05, ∗∗∗p ≤ 0.001, Student’s t test. Error bars: mean ± SEM (standard error of the mean). See also Figures S1]( "Download high-res image (2MB)") 2. Download: Download full-size image Figure S2. Properties of Pyramidal and Stellate Cells in Virtual Navigation; Assigning Grid Modules Based on Their 1D Responses, Related to Figures 2 Percentages of imaged cue cells that were classified as stellate (SteC) and pyramidal cells (PyrC). p= 4.6× 10−3. (B) Pairwise distances between cue cells versus those between cue and grid cells. (C) An example of the distribution of cue and grid cells among stellate and pyramidal cells. Scale bar: 50μm. (D) Amplitudes (left) and frequencies (right) of significant transients of stellate and pyramidal cells (517 stellate cells and 408 pyramidal cells in 18 FOVs
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
of six mice). p= 2.7× 10−9 and 1.1× 10−9 for amplitudes and frequencies, respectively. (E) Amplitudes (left) and frequencies (right) of significant transients of stellate grid cells (G-S) and pyramidal grid cells (G-P) (75 pyramidal grid cells and 219 stellate grid cells in 18 FOVs of six mice). (F) Example showing frequencies and amplitudes of significant transients of pyramidal cells within a patch. Top left: GCaMP6f+ pyramidal cells imaged _in vivo_. Top right: white dots: COMs of identified pyramidal cells from the left. Red square: center of the patch. Bottom: pyramidal cells color-coded by frequency (Freq., left) and amplitude (Amp., right) of significant transients. Scale bar: 50μm. (G) Relationship between frequencies (left) or amplitudes (right) of significant transients of pyramidal cells and their distances to patch centers. Dark gray dots: individual cells. Curves: frequencies (left) or amplitudes (right) for real (black) and shuffle data (light gray, 100 shuffles) at different distances from patch centers. Bin width: 15μm. Frequencies and amplitudes positively correlate with the distances (p= 1.36× 10−6 and 2.07× 10−5, respectively). (H) Parasagittal slice of the MEC from an Emx1-IRES-Cre; CaMKIIa-tTA; Ai93 (Ai) mouse stained with WFS1 antibody. The region between the two dashed yellow curves is layer 2, in which GCaMP6f was highly expressed in pyramidal cells (WFS1+). Scale bar: 50μm. (I) Comparison of percentages of pyramidal cells (Pyr) in Ai mice, stellate (Ste) and pyramidal (Pyr) cells in GP 5.3 mice that expressed GCaMP6f. (J) Fluorescence intensity in cell bodies of pyramidal cells (Pyr) in Ai mice, stellate (Ste) and pyramidal (Pyr) cells in GP 5.3 mice that expressed GCaMP6f. The fluorescence intensity is represented as mean gray value, which was measured _in vivo_ under two-photon microscope with comparable laser powers used in different mice. (K) _In
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
vivo_ two-photon image of GCaMP6f-labeled cell bodies in layer 2 of the MEC in Ai mouse. Scale bar: 50μm. Note that the labeled cell bodies cluster in a patch, consistent with the immunohistochemistry results that most labeled cells were pyramidal cells. (L) Spatial dependence of calcium transients of an imaged grid cell in an Ai mouse on a 1000 cm-VR track. Annotations are similar to Figure S1 Percentage of grid cells in GCaMP6f+ pyramidal cells (Pyr) in Ai mice, GCaMP6f+ stellate (Ste) and pyramidal (Pyr) cells in GP 5.3 mice (2216 pyramidal cells in 37 FOVs of three Ai mice, 517 stellate and 408 pyramidal cells in 18 FOVs of six GP 5.3 mice). (N) Percentage of pyramidal grid cells at different distances from centers of pyramidal patches in Ai mice (1863 pyramidal cells in 37 FOVs of three mice). Curves: real data (magenta) and 100 shuffles (gray). Bin width: 15μm. (O) An example of a ground truth dataset, in which grid cells were recorded using tetrodes in both a 2D real and two 1D virtual environments. These grid cells were clustered into two modules based on their 2D scales. (P) Clustering of the four parameters (1D field widths and spacings on two VR tracks, as shown in Figure 3. (Q) Comparison of module assignment of cells in (O) using 1D and 2D responses. The accuracy is 100% for this dataset. (R–T) Module assignment for another ground truth dataset. Annotations are the same as in (O)-(Q). Accuracy is 98% for this dataset. (U) Fitting quality of co-modular grid cells assigned based on their 1D calcium responses. Co-modular cells were simultaneously fit as parallel slices in the same triangular lattice. Each
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
dot represents the percentile of the fitting score of cells in one module compared to those of 100 shuffled datasets. Red dashed line marks the 75 th percentile of the shuffled fitting scores. (V) Ratios of 2D grid scales of successive modules, which were the 2D spacings of their fitted 2D triangular lattices. Each dot represents the spacing ratio of a pair of successive modules. Red dashed line marks the average ratio (1.51) of all pairs of modules. ∗p ≤ 0.05. ∗∗p ≤ 0.01. ∗∗∗p ≤ 0.001. n.s. p > 0.5. Student’s t test. Error bars: mean ± SEM. Anatomically, grid cells mainly clustered and were largely separated from non-grid cells, as revealed by shorter pairwise distances between grid cells than between grid and non-grid cells (Figure 2. The relatively low percentage of grid cells among pyramidal cells and the edge-distribution of grid cells within pyramidal patches were also consistently observed in another transgenic mouse line (Emx1-IRES-Cre;Camk2a-tTA;Ai93), in which 95.3% of pyramidal cells in layer 2 of the MEC were specifically labeled by GCaMP6f ([Figures S2]( This observation provides evidence that the different features of grid cells in pyramidal and stellate cells, especially grid cell percentages, were not
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
biased by the lower percentage of GCaMP6f labeling of pyramidal cells than stellate cells in the GP 5.3 mice. In summary, grid cells in layer 2 form clusters that are comprised of mostly stellate cells and some pyramidal cells at patch edges (Figure 2 scales of neurons in 2D environments (Stensola et al., 2012]( "Download high-res image (1MB)") 2. Download: Download full-size image Figure 3. Grid Modules Form Anatomical Clusters (A) Diagram for assigning grid cells in the same FOV to different modules, based on the field width (W) and spacing (S) of their 1D calcium responses on two VR tracks or two trials on the same VR track. (B) Examples of 1D activity of grid cells (among 19 simultaneously imaged grid cells) in modules 1 (smallest spacing) and 2 (with the second smallest spacing) in two trials of the same 1D VR track. Annotations are similar to Figures 2 Clustering of 1D spacings (S1 and S2) and widths (W1 and W2) for the 19 cells. Each dot represents one cell. (D) Anatomical locations of the 19
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
cells in two modules. Scale bar, 50 μm. (E) Pairwise distances of cells in (D). 1-1, 2-2, and 1-2 are distances of cells in module 1, in module 2, and between modules 1 and 2, respectively. p= 4.9× 10−9 for 1-1 and 1-2, and 2.6× 10−14 for 2-2 and 1-2. (F) Intra- and inter-module pairwise distances of multiple modules (20 modules in ten FOVs of six mice). p= 7.1× 10−4. (G) Anatomical distribution of grid modules in two mice. Grid spacing increases from modules 1 to 3. To show the distribution of modules from clearly defined pyramidal patches, each panel contains merged FOVs from multiple focal planes. Scale bar, 50 μm. (H) Percentage of pyramidal cells in different modules (individual dots, 23 modules in ten FOVs of six mice). ∗∗∗p ≤ 0.001. n.s. (not significant) p > 0.05. Student’s t test. Error bars: mean ± SEM. See also Figure S2; the 2D field width, spacing, and orientation of the cell were estimated as the width and spacing of the lattice, and the angle of the slice, respectively ([Yoon et al., 2016]( We observed that 1D responses of assigned co-modular grid cells were well fit by parallel slices in the same triangular lattice ([Figure S2]( consistent with observations that co-modular grid cells share scale and orientation ([Stensola et al., 2012]( The ratio of 2D spacing between successive modules, which was the spacing of their best fit triangular lattice, was 1.51 on average ([Figure S2]( close to the ratio in
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
2D real environments (1.42) (Stensola et al., 2012, we identified the anatomical locations of grid cells and calculated their pairwise distances (Figure 3 were greater than those between cells in the same module (intra-module distances) (Figure 3 of the environment in the unit-rhombus, which is a repeating unit of the triangular lattice. All possible phases can therefore be fully sampled as [point
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
locations]( "Learn more about point locations from ScienceDirect's AI-generated Topic Pages") throughout the rhombus, and the phase distance between a pair of grid cells is the distance between their point locations within the rhombus (Figure 4 distances between grid cells (linear correlation of 2D and 1D phase distances, r 2= 0.71; absolute error: 0.08 ± 0.01, Figures S3]( "Download high-res image (1MB)") 2. Download: Download full-size image Figure 4. Anatomical Arrangement of Grid Phases in Local Brain Neighborhood (A) Schematic diagram for calculating phase distance of two co-modular grid cells from their spatial responses in a 2D environment. (B) Schematic diagram for calculating phase distance of two simultaneously imaged co-modular grid cells from their spatial responses on a 1D track. (C) Anatomical locations of nine module 1 cells, color-coded based on phase distance from the reference cell (Ref.). Scale bar, 25 μm. (D) Phase distances of the reference cell (Ref.) and its close (cell 1) and distal (cell 2) cells, as indicated in (C). Left: calcium response (black) and modeled activity based on slice fit (gray). Right: phase distance to the reference cell (yellow line) based on the starting points of their
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
fitted slices (red and black dots) in the same unit-rhombus (white). (E) Pairwise phase versus physical distances (bin width, 30 μm) of the nine cells in (C). (F) Phase plot showing relative anatomical locations of cells in (C) with small (80 th percentile), axes as in (C). (G) Pairwise phase versus physical distances of all module 1 cells (modules with the smallest spacing; bin width: 30 μm; 10,246 cell pairs in 17 modules of six mice). The blue rectangle highlights physical distances ≤120 μm. (H) Relationship of pairwise physical distances within 120 μm and the percentage of module 1 cell pairs with small and large phase distances (black: 90 th percentile, right y axis; bin width: 15 μm; 1,044 and 1,030 cell pairs with small and large phase distances in 17 modules of six mice, respectively). (I) Folding analysis of a cell group chosen around a center cell (C.C.). In brain and phase spaces, the same cells are assigned to the same color and a triangle of the same color is drawn between the same three cells. Scale bar, 20 μm. (J) Comparison of folding scores of real and 100 shuffled phases of the cell group in (I). (K) Comparison of folding scores of 29 co-modular cell sets (242 cell groups composed of 345 unique cells) with real (red) and shuffled phases (gray, 100/set). Mean score of all cell groups in each co-modular cell set was used for the comparison. The mean folding scores were normalized so that shuffled scores had mean 0 and SD (standard deviation) 1. Probabilities were normalized so that the maximal probabilities of real and shuffled data were 1. p= 1.3× 10−7, Kolmogorov-Smirnov
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
test. p values in (E) and (G) were calculated as the percentage of shuffled data points that are below (if mean of real data ≤ mean of shuffled data) or above real data (if mean of real data ≥ mean of shuffled data). ∗p ≤ 0.05, ∗∗p ≤ 0.01, ∗∗∗p ≤ 0.001. Error bars: mean ± SEM. See also Figure S3]( "Download high-res image (2MB)") 2. Download: Download full-size image Figure S3. Methods for Calculating Phase Distances; Additional Methods and Results for Local Phase Arrangement, Related to Figure 4 Calculation of phase distance of a pair of grid cells based on fitted slices of their 1D responses. (1) Starting points of fitted 1D slices of two co-modular grid cells (green square and circled magenta star) are shown in the same unit-rhombus (red). The four points of the rhombus are mathematically equal and also equal to other surrounding points of the lattice (gray dots). “s” is the spacing of the lattice. Coordinates of each dot are labeled next to it. Original phase distances of the two cells (D orig) are marked with a black line. (2) To calculate the real phase distance of the two cells, the starting point of one cell (green square) was fixed while the other one was placed at the eight other mathematically equivalent locations (magenta stars without circles). Distances from the green square to all nine magenta stars were calculated (dashed black lines from the green square to magenta stars). (3) Real phase distance of the two cells (D transf) was determined as the distance of the green square to the nearest magenta star, as shown with a black line. (B) An example of
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
a ground truth dataset, testing the accuracy of identifying grid phase distances based on slice fit of 1D grid responses. Four grid cells were simultaneously recorded with tetrodes in 2D real and 1D VR environments. Their 1D responses were fitted as parallel slices in the same triangular lattice. For each cell: left top: spikes (red dots) and trajectory (gray) in a 0.5× 0.5 m real 2D environment. Left middle: firing rate in the 2D environment, calculated based on the spikes on top. Left bottom: autocorrelogram of the firing rate in the middle. Right top: spikes (red dots) and trajectory (gray) on multiple traversals on the 1D VR track. Right bottom: overlay of real firing rate along the track calculated from the spikes on top (black) and simulated activity of fitted slice (gray). (C) 2D and 1D phase distances of the four grid cells in (B). Each dot represents phase distance of one pair of grid cells. R 2 reveals the linearity of the relationship of 1D and 2D phase distances. (D) 2D and 1D phase distances of additional pairs of simultaneously recorded grid cells (25 pairs in three datasets like (B)). Each dot represents phase distance of one pair of grid cells. R 2 reveals the linearity of the relationship of 1D and 2D phase distances. (E) Errors in calculating 2D pairwise phase distances using the 1D slice fit. Each dot represents the absolute difference (error) of the 1D and 2D phase distances of one pair of cells. The absolute error is 0.08 ± 0.01. (F) Plotting the relative anatomical location of cell pairs with different phase distances shown in Figure 4. (1) One cell was set as the reference cell (Ref.) and the locations of all cells were shifted so that the reference cell was at (0,0).
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
Each cell was colored according to its phase distance to the reference cell. Here we show examples for two different reference cells, but plots for all nine reference cells were similarly generated. (2) The nine plots described in (1) were overlaid, with colors from those plots (indicating phase distances between pairs of cells) all renormalized to the same color scale. (3) The points (cell pairs) with phase distances either greater than T large (e.g., 80%) or less than T small (e.g., 20%) were kept in the plot. (4) For better visualization, the points with large and small phase distances were plotted in red and black, respectively. (G) Relationship between phase and physical distances shown in a group of ten cells in module 2, which had the second smallest spacing in an animal. Top left: anatomical locations of the ten module 2 cells, color coded based on their phase distance to the reference cell (Ref.). Scale bar: 25μm. Other panels: phase distances of the reference cell (bottom left) and its close (cell1) and distal (cell2) cells. Distances were determined by fitting 1D calcium responses of all cells to parallel slices in the same triangular lattice. Annotations are similar to Figures 4 Pairwise phase distances versus physical distances for the ten cells in (G). Bin width: 30μm. (I) Phase plot showing relative anatomical locations of cells in (G) with small (below 20 th percentile) and large (above 80 th percentile) phase distances to reference cells, the locations of which were set at (0,0). X and Y axes correspond to the X and Y axes in (G). (J) Relationship of pairwise physical and phase distances of all module 2 cells (bin width: 30μm; 1536 cell pairs in 11 module 2
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
datasets of five mice). Blue rectangle indicates the portion of the plot corresponding to physical distances shorter than 120μm. (K) Relationship of pairwise physical distances and percentage of module 2 cell pairs with small (black: 80 th percentile, right y axis). Only cell pairs physically closer than 120μm are shown. Bin width: 15μm. 716 cell pairs with small or large phase distances (308 pairs for each distance group) in 11 module 2 datasets of five mice were used. (L and M) Calculation of folding score. (L) Triangulation of a cell group in brain space (brain triangles, left) and two sets of hypothetical phases for those cells, plotted in the unit-rhombus (phase triangles, middle and right). In the brain (left), the cell group includes a center cell (C.C.) and all cells within a distance r from the center cell. Throughout all six subpanels, the same colored dot represents the same cell. The phases in Phase 1 were chosen to match the cells’ arrangement in the brain, whereas those in Phase 2 do not, as can be visualized via the corresponding triangulations in the second row. (M) Calculation of folding score. Top: the folding score for the above cell group was calculated based on the phase triangles. It was the ratio of the area of the smallest polygon that contains all the triangles to the sum of the areas of all the individual triangles. Middle: the folding score is 1 for the first phase map (Phase 1), because the triangles do not overlap. Bottom: the folding score is less than 1 for the second phase map (Phase 2), because the triangles overlap. p values in (H) and (J) were calculated as the percentage of shuffled data points that are below
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
(when the mean of real data ≤ the mean of shuffled data) or above real data (when the mean of real data ≥ the mean of shuffled data). ∗p ≤ 0.05. ∗∗p ≤ 0.01. ∗∗∗p ≤ 0.001. Error bars: mean ± SEM. Using this method, we examined the relationship between grid phase and physical distance. In a cell group with one reference cell and its neighbors (maximal distance between neighboring cells and the reference cell: 119.5 μm, Figure 4, respectively (Figure 4 in local brain neighborhoods matches the arrangement of their phases determined by spatial responses (spatial tuning phases). To test this, we performed a “folding triangle analysis” (Figures S3, in which small groups of cells were
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
connected using non-overlapping triangles (“brain triangles”), and the spatial tuning phases of the same cells were connected using the same triangles (“phase triangles”). If the layouts of their anatomical and spatial tuning phases match, the phase triangles should show a low degree of overlap (high “folding score”). This measurement reflects more than the correlation of local phase and physical distances, because nearby cells with similar phases but with incorrect arrangement will produce overlapping phase triangles (low “folding score”). We observed that the phase triangles of real data showed significantly less overlap than shuffles, in which the phases within the local group of cells were randomly permuted (Figures 4? We observed that the physical and phase distances of grid cells had no consistent relationship beyond 120 μm, as cells at further anatomical separations could have short phase distances (Figures 4 not only clustered locally, but could also be widely distributed at multiple locations (Figure 5, indicating that the lattice pattern did not rely on the anatomical distribution of grid cells per se, but instead reflected their phase relationships. The lattice-shaped phase clusters were similarly observed in a
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
module with larger spacing (Figures S4 than pyramidal patches (Figures S4. !Image 19]( "Download high-res image (3MB)") 2. Download: Download full-size image Figure 5. Global Arrangement of Grid Phases (A) Phase clusters of a group of module 1 grid cells. Cells with similar phase (phase distances <10 th percentile of all distances) are assigned to the same color. Scale bar, 50 μm. (B) Phase cluster lattice. Left: phase plot showing relative anatomical locations of cells with small phase distances (<10 th percentile). Middle: same data as on left but spatially binned (15 μm × 15 μm bins). Right: autocorrelogram of the middle map and its grid score. (C) Phase plot and autocorrelogram of a shuffled dataset. Annotations are the same as in (B). (D) Comparison of grid scores of real data in (B) and its 200 shuffles. (E) Comparison of grid scores of the 29 modules with their shuffles (200/module). Grid scores
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
were normalized so that shuffled scores of each module had mean 0 and SD 1. Probabilities were normalized so that the maximal probabilities of real and shuffled data were 1. p= 1.8× 10−11. (F) Two models for global arrangement of grid phases. Left: spatial tuning phases of three different phase cluster sets (red, blue and yellow) in a unit-rhombus. Middle and right: in the brain, the arrangements of their anatomical locations and spatial tuning phases match (model 1) or do not match (model 2). (G) An example of co-modular grid cells in a FOV. Cells with the same color belonged to the phase cluster in (H) with corresponding color. Scale bar, 100 μm. (H) Global lattice fit of cells in (G). From left to right: phases, spatial tuning phases of all cells were assigned to five clusters (five colors); autocorrelogram, the best fit lattice generated based on two generating vectors (v1 and v2) drawn from the center to two vertices in the phase cluster autocorrelogram; cell migration, the migration distances (orange dotted lines) of cells from their original locations (circles) to the locations matching their spatial tuning phases (orange crosses). Green, magenta, and gray circles represent identified stellate, pyramidal, and unidentified cells due to unclear cell body boundaries. Note that the best fit lattice minimizes cell migration distance in the brain for the perfect match. Scale bar, 100 μm. (I) Lattice fits of cells in (G) with “locality preserving” shuffled phases. Annotations are similar to (H). Scale bar, 100 μm. Note that (1) only two phase clusters (dark blue and green) were permuted (red arrows); (2) the autocorrelograms of phase clusters and the best fit lattices in (H) and (I) are
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
very similar; and (3) the cell migration distances in (I) are longer than that in (H). (J) Comparison of fit scores of cells in (G) with real (red) and shuffled phases (gray). The score was the mean migration distance of all cells in the best fit lattice. (K) Comparison of normalized fit scores of cells with real (red) and shuffled phases (gray) in the 29 sets of co-modular cells. Fit scores were normalized so that the shuffled scores of each module had mean 0 and SD 1. Probabilities were normalized so that the maximal probabilities of real and shuffled data were 1. p=1.8× 10−5. (L) Diagram showing how to place cells in all unit-parallelograms of a lattice into a single anatomical unit-rhombus. The color and location of a cell in the unit-rhombus represent spatial tuning phase and anatomical phase, respectively. (M) Distributions of spatial tuning phases in anatomical rhombus after global lattice fit analysis, representing noise of anatomical phase maps in fitted lattices. Spatial tuning phases were represented in three color schemes (the first column, from top to bottom): 1D colors in two axes (r1 and r2) of the rhombus and 2D colors. From second to last column: perfect match between anatomical and spatial tuning phases, real data of all mice combined, real data of mouse 1, real data of mouse 2, and random spatial tuning phases. Note: due to limited sampling of lattices, some noise was introduced to the perfect case by the lattice fitting procedure. For “perfect,” “all mice,” and “random”: n= 744 (29 FOVs in six mice). For mouse 1: n= 236 in ten FOVs. For mouse 2: n= 183 in six FOVs. ∗∗∗p ≤ 0.001. Kolmogorov-Smirnov test. See also Figures S4]( "Download high-res image (2MB)")
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
2. Download: Download full-size image Figure S4. Additional Methods and Results for Global Phase Arrangement, Related to Figure 5 Transformation of a lattice to a regular triangular lattice and calculation of grid score. Left: the original autocorrelogram of the distribution of phase clusters, shown in Figure 5. Step 2: fitting the six vertices in step 1 to an ellipse (white ellipse). Step 3: reshaping the lattice to a regular hexagon based on the long and short axes of the ellipse in step 2. Step 4: calculating grid scores based on the transformed regular triangular lattice in step 3. (B–D) An example of phase clusters in module 2 cells, which had the second smallest spacing in an animal. (B) Anatomical locations of 18 grid cells in module 2 with different phases. Cells with similar phase (phase distances< 15 th percentile of all distances) are represented in the same color. Scale bar: 50μm. (C) Phase cluster distribution. Left: phase plot showing relative anatomical locations of cells with small phase distances (< 15 th percentile of all phase distances). Middle: same data on the left but spatially binned (in 20μm × 20μm spatial bins). Right: autocorrelogram of the middle map and its grid score. (D) Phase plot and autocorrelogram of a shuffled dataset of (C). Annotations are same as in (C). (E) Two examples of multiple phase clusters in combined FOVs. For each example, left: anatomical distribution of cells in two sets of phase clusters (magenta and green). Scale bar: 50μm. Right: autocorrelogram of phase plots for cells on the left in the same set
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
of phase clusters. (F) Comparison of grid scores of phase clusters in 29 sets of co-modular cells with those of shuffles. The red dashed line indicates 60 th percentile of shuffles. Each dot represents one set of co-modular cells. Note that all the grid scores are above the 60 th percentile of shuffles. (G–I) Shapes of phase cluster lattices. (G) Plotting the two shortest vectors of the phase cluster autocorrelogram. Left: original autocorrelogram of phase clusters. Middle: the vectors v1 and v2 point to the two autocorrelogram vertices (p1 and p2) nearest to the origin (excluding reflections), with |v1|< |v2|. Right: v1 and v2 were transformed so that v1 was sent to (1, 0), and then v2 was reflected and translated by v1 until its _y_ coordinate was positive and its _x_ coordinate was between 0 and 0.5. Black: the vectors v1 and v2 after the transformation. Gray: transformed v1 and v2 for a regular triangular lattice. (H) Diagram for interpreting the shape of the phase cluster lattice from the vector plot shown in (G). The v2 vectors were expected to be placed in the green zone. Gray: v1 and v2 of a regular triangular lattice. Magenta: an example of v2 of a non-regular triangular lattice. The ideal triangular lattice (black) and the lattice shape according to the magenta v2 (dotted) were plotted. Note that the dotted lattice is skewed compared to the regular triangular lattice. (I) The vectors v2, after transformation shown in (G), for all 29 individual co-modular cell sets (shown in (F)), giving a quantification of the lattice shapes across the cells. As explained in (H), all 29 lattices were skewed compared to the regular triangular lattice. (J) The relationship of physical spacings of phase clusters and
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
spacings of grid modules determined from their spatial tuning responses. Each dot represents one module (n= 29). Red dashed line is the best fit line to the data. p value of the correlation between the two sets of spacings is 3.4× 10−5. (K) Four examples of the relative distribution of phase clusters and pyramidal clusters. Grid cells (colored dots) with similar phases are represented with the same color. Pyramidal cells are represented as white circles. Scale bar: 100μm. (L) Comparison of spacings of phase clusters and pyramidal clusters. p= 9.8× 10−14, Kolmogorov-Smirnov test. (M–P) Global lattice fit. (M) Cell locations in brain space and corresponding phases in the unit-rhombus. (N) Generation of candidate anatomical lattice vectors based on the autocorrelogram of phase clusters. (1) Left: autocorrelogram of phase clusters in (M) with six vertices nearest to the origin (red circles, three pairs of vertices are symmetric) identified. Right: Reflected vertices were excluded, producing the three vertices p 1,p 2,p 3 (in what follows, we define each vertex with its corresponding 2D vector, pointing to that vertex from the autocorrelogram center). (2) For each choice of two vectors from the three vectors in (1), for example p 1 and p 2, the two shortest vectors p˜1 and p˜2 generated by p 1 and p 2, were constructed, and we then constructed the eight shortest vectors generated by p˜1 and p˜2. This produced the 8 shortest vectors in the lattice L p 1,p 2. (3) As candidate fit vectors for the next step, we took all pairs v 1,v 2 of the eight shortest vectors generated above. Here we show 4
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
examples of 40 total choices. Each pair of these 40 pair choices will serve as generating vectors of an anatomical lattice, as described in (O) below. (O) Calculation of fit score. (1) Cell locations were first mapped in an anatomical lattice by sending the vectors v 1,v 2 to the generating vectors in the parallelogram, as indicated, and then applying a possible shift of the parallelogram in the FOV (shift= 0 in this example). An anatomical lattice was then generated under this pair of vectors and the shift by repeating the parallelogram across the FOV (gray lattice). (2) The cell location in the parallelogram was proportionally converted to a location in a unit-rhombus. We then refer to the cell locations in the unit-rhombus under this mapping as the “anatomical phases” (green circle for cell 1), and the true phase of cells as “spatial tuning phases” (magenta cross for cell 1). (3) The fit score of the mapping was then defined to be the average over all cells of the necessary migration distance (magenta dashed line) to reach the perfect match between anatomical phases and the spatial tuning phases. We similarly generated many lattices under all pairs of vectors (described in (N)) and different shifts, and identified the best fit lattice, which has the lowest fit score (minimal migration distances to reach the perfect match between the anatomical and spatial tuning phases) (P) Generation of “locality preserving” shuffles. (1) Shuffles were generated by clustering phases into five clusters in the unit-rhombus and permuting the phase clusters via translation. (2) After the shuffling, while the cells stayed in their original anatomical locations, the phases of cells were changed together and therefore the autocorrelogram of the shuffled phase clusters remained similar to the true autocorrelogram of phase clusters. ∗∗∗p ≤ 0.001. While cells
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
with similar spatial tuning phases form a phase cluster lattice, how are different phase cluster lattices relatively arranged in the brain? Our previous results showed that the local arrangements of anatomical and spatial tuning phases were well-matched. This local match and the existence of the phase cluster lattice together suggest that the local organization of grid cells may globally repeat in a lattice, in which the arrangements of anatomical and spatial tuning phases are also consistent (Figure 5 between the arrangements of anatomical and spatial tuning phases of cells in the fitted lattice. If the arrangements truly match, we expect short migration distances (low “fit score”), otherwise, the distance would be longer (high “fit score”). Because the clustering of similar phases may bias toward shorter migration distances even when the relative distributions of different phases are random, we designed “locality preserving” phase shuffles as controls to account for this effect (Figure S4 in the rhombus were permuted. These shuffles maintained the property of phase clustering,
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
as reflected by their similar autocorrelograms to real data, and allowed us to understand the organization of phases beyond clustering. We observed that for the best fit lattice, the total migration distance of real cells was shorter than that of the “locality preserving” phase shuffles (Figures 5, suggesting that grid phases are more likely arranged in an anatomically repeating lattice pattern. To visualize this anatomical phase map, especially how much noise exists in the map compared to a perfect phase lattice, we placed cells from all unit-parallelograms, which constituted the best fit lattices from the above analysis, in a single unit-rhombus (anatomical rhombus). The original locations of cells (without migration) in the anatomical rhombus, i.e., their anatomical phases, were preserved to reveal the “noise” in the fitted anatomical lattice. The spatial tuning phase of each cell was represented by color (Figure 5 on the MEC cell sheet (Figure 5: Figures S5]( "Download high-res image (4MB)") 2. Download: Download full-size image Figure S5. Noise of
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
the Anatomical Phase Map, Related to Figure 5 Modeling of anatomical phase maps with noise. (1) To represent different spatial tuning phases, the spatial tuning phase unit-rhombus was divided into nine color zones. The anatomical phase unit-rhombus was divided accordingly. (2) In the anatomical phase unit-rhombus, the location of each dot represents the anatomical phase of one cell, which is colored according to its spatial tuning phase. In the perfect case, anatomical and spatial tuning phases were perfectly consistent. In the noisy case, they were inconsistent and the difference between the anatomical phase and spatial tuning phase was termed “noise” of a grid cell. (3) When more cells were included, the color patterns in the spatial tuning and anatomical phase rhombuses were identical for the perfect case, but different for the noisy case. (4) The global lattice fit analysis generated a new anatomical lattice (gray), in which the cells could migrate at the shortest distance (on average) to reach the best match between their anatomical and spatial tuning phases. Therefore, in principle zero migration was required for the perfect case. In the real analysis, due to the limited sampling of the
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
anatomical lattice (limited choices of lattice sizes and offsets in the brain, etc.), small migrations were still necessary. However, the fit score for the perfect case, which was equal to the average migration distance of all cells in the fitted lattice, was very low. In contrast, in the noisy case, larger migrations were necessary even in the new anatomical lattice, so the fit score was much higher compared to the perfect case. The fit score increased with the increase in noise level. Note that the fit score was the minimal cell migration required in the new optimized anatomical lattice. Therefore, the fit score was equal to the new noise in the new anatomical lattice. This new noise was generally lower than the noise of the data in the original anatomical lattice (the anatomical lattice in (2)). In the rest of this figure, we termed the original noise before the lattice fit as the “noise” of the phase map. Also note that in Figure 5 An example of identifying the noise level of the anatomical phase map of a set of co-modular cells based on its fit score of the global lattice fit analysis. The x axis indicates different levels of noise (original mean noise level of all cells before the global lattice fit) introduced to spatial tuning phases that perfectly match anatomical phases, as explained in (A). The y axis indicates the fit scores (new noises after the global lattice fit) of the co-modular cell sets with different noise levels in the global lattice fit analysis. The corresponding noise level with the fit score of real data is the estimated original noise level of the data (red
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
dot on the x axis). (C) Noise levels of anatomical phase maps of all 29 sets of co-modular cells. The dashed line indicates the mean noise level (0.22). (D) Comparison of the mean noise level of real data (0.22, black line) to that of 50 randomized datasets (gray histogram). Each randomized dataset was developed from the original 29 sets of co-modular cells by maintaining the anatomical locations of cells and assigning random phases to the cells (29 randomized sets). The global lattice fit analysis was then performed on the 29 randomized cell sets to estimate their noise levels, which were further averaged as the mean noise level of the randomized dataset. The histogram represents the distribution of mean noise levels of the 50 randomized datasets. Note that the real data had lower mean noise level than all randomized datasets, suggesting that the anatomical arrangement of grid phases in real data are not random. This arrangement is closer to a triangular lattice pattern than any random arrangement. (E) 2D and 1D color schemes to represent spatial tuning phases, as in Figure 5), and in 1D by color gradients along the two axes (r1 and r2) of the unit-rhombus. (F) Distribution of spatial tuning phases in the anatomical phase unit-rhombus of real data after the global lattice fit analysis (same as in Figure 5. r1, r2: the distribution of spatial tuning phases represented by the 1D color scheme along axes r1 or r2 of the unit-rhombus, as explained in (E). Note that the color patterns in the two unit-rhombuses largely follow the 1D color schemes in (E), indicating that grid phases form a phase lattice
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
map in the brain. However, this map is noisy. Note that the noise observed here is the new reduced noise in the fitted lattice. In (G), we provided modeled phase maps to reveal the original noise (for example, 0.22 on average, as shown in (C)) of the phase map before the global lattice fit. (G) The modeled anatomical phase map under the noise level of the data. The cells from all 29 sets of co-modular cells were used (n= 744) to generate these modeled data. Four noise levels were modeled: (1) zero noise; (2) maximal noise (random); (3) mean noise of the data (0.22, as indicated in (C)); (4) each FOV with its own noise (as plotted in (C)). For each noise level: “Original”: for each FOV, the anatomical phases of cells were their locations in the unit-rhombus of a regular triangular lattice randomly constructed in the brain. The perfect spatial tuning phases were set to be identical to the anatomical phases. Different levels of noise were introduced to the perfect spatial tuning phases. The distribution of the noise-introduced spatial tuning phases in the anatomical phase unit-rhombus of all 29 cell sets was represented by 2D coloring (as in (E)), 2D tiling (2× 2 tiling the anatomical unit-rhombus to better reveal the 2D color pattern of a single unit-rhombus) and 1D coloring (as in (E)). “Fit”: the global lattice fitting analysis was performed on cells in each FOV, which contained the modeled anatomical and spatial tuning phases with different levels of noise introduced. The optimized anatomical phases were plotted in the unit-rhombus and colored according to the spatial tuning phases (1D coloring, as in (E)). Note: the phase lattice maps with different noise levels were represented by the “Original” plots. While the “Original” zero-noise lattice maps show perfectly matched color
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
patterns to those in E, and the maximal-noise lattice (random) maps show random color-patterns, the “Original” maps with mean data noise (0.22) and matched noise to each FOV show comparable color patterns. The color patterns of their “Fit” anatomical phase unit-rhombuses are similar to those of real data shown in (F). Thus the “Original” maps with mean data noise and matched noise to each FOV represent the anatomical phase map with the noise obtained from the current data. (H) Modeled anatomical phase map without the noise introduced by 1D slice fit. The noise of the current phase lattice map has at least two sources: (a) the noise generated from the estimation of phase relationship of a pair of cells based on their 1D responses (1D noise); (b) the noise generated from the migration of cells in the brain tissue (brain noise). To reveal the phase lattice map with only the brain noise (b), we modeled the phase lattice maps by subtracting the 1D noise, which was 0.08 (Figure S3E). The two noise levels, (1) mean data noise subtracted by the 1D noise and (2) matched noise of each FOV subtracted by the 1D noise, were modeled. Note: these phase lattice maps of these two noise levels are similar and represent the phase lattice map with the noise in the brain. (I) Scale of noise level representing the noise of the phase map in mouse MEC (noise level 0.14) compared to the perfect hexagonal phase lattice (noise level 0) and purely random phase arrangement (noise level 0.34). Assuming the change of noise level is linear, the phase map in mouse MEC is closer to the perfect hexagonal phase lattice than to the purely random phase arrangement. ]( "Download high-res image (2MB)") 2. Download: Download full-size image Figure S6. Global Lattice Fit and Anatomical Phase Map of Individual Mice; Co-active Cells Form a Lattice Similar to that Formed by Phase Clusters, Related to Figures 5 Global lattice fit results, anatomical phase maps, and noise levels of the anatomical phase map are shown for individual mice. From left to right: results of mice 1 to 6. For each mouse, from top to bottom: global lattice fit result as in Figure 5 showed significantly lower fit scores (shorter anatomical migration distances to reach a perfect phase lattice) compared to shuffles. The other two mice (2 and 4) showed very low p values. Exact p values (Kolmogorov-Smirnov test): mouse 1: 0.030; mouse 2: 0.071; mouse 3: 0.043; mouse 4: 0.053; mouse 5: 0.049; mouse 6: 0.041. For the anatomical phase map, all cells in the same mouse are plotted in the same unit-rhombus. Cell number in each mouse: mouse 1: 236 (10 FOVs); mouse 2: 109 (4 FOVs); mouse 3: 75 (3 FOVs); mouse 4; 58 (3 FOVs); mouse 5: 183 (6 FOVs); mouse 6: 83 (3 FOVs). The noise level of a mouse is the mean noise level of all FOVs of the same mouse. (B–D) Example group of co-modular cells showing correlation of lattices of co-active cells and phase clusters, represented by their autocorrelograms. (B) Autocorrelogram of co-active cells. Left: calcium responses of seven cells co-active within the spatial bin n in a 1000cm-long VR track, which was split into 80 bins under 12.5cm bin width. Significant
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
spatial fields are highlighted in pink and the peak mean ΔF/F of each field is indicated by a green dot. These peak locations represent field locations. Note that all the seven cells showed fields within the range of bin n (dotted rectangular area), so they were determined as co-active cells. Top right: an image frame n was generated based on the activity in the spatial bin n. In this frame n, the areas of co-active cells were assigned to 1 and the remaining pixels were 0. An autocorrelation was then performed on the frame (step 1). The same procedure was repeated for all 80 frames (for 80 spatial bins) along the track and averaged to get a mean autocorrelogram (step 2; the autocorrelogram was smoothed with a 2D Gaussian smoothing kernel with standard deviation of 10 for better visualization, same for all activity autocorrelograms in the figure). Bottom right: the calcium responses were shuffled among all cells in the group and the mean autocorrelogram of co-active cells in the shuffle dataset was similarly generated. Scale bars: 100μm. (C) Comparison of the autocorrelograms of co-active cells and phase clusters of cells in (B). In the overlay figures, the autocorrelograms of co-active cells and phase clusters are shown in magenta and green, respectively. The overlaid areas of the two autocorrelelograms show white color. Scale bar: 100μm. (D) Comparison of the autocorrelograms of co-active cells and phase clusters of the shuffled dataset for cells in (B). (E) Comparison of correlation coefficients between the autocorrelograms of co-active cells and phase clusters for real data in (B) and its shuffles, in which the calcium responses were randomly
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
permuted among the cells (50 shuffles). The real correlation coefficient was higher than 98% of shuffled coefficients. (F) Comparisons of the autocorrelograms of co-active cells and phase clusters of three more groups of co-modular cells ((1)-(3)). Scale bars: 100μm. (G) Comparison of correlation coefficients of the autocorrelograms of co-active cells and phase clusters of cells in 16 groups of co-modular cells and their shuffles (50 shuffles for each group). The correlation coefficients were normalized so that the shuffled coefficients in each group had mean 0 and standard deviation 1. The probabilities were normalized so that the maximal probabilities of real and shuffled data were 1. p= 2.4× 10−11. ∗p ≤ 0.05. ∗∗∗p ≤ 0.001. Kolmogorov-Smirnov test. ### Propagation of Grid Cell Activity Supports the Anatomical Phase Map While the phase analyses suggest a lattice arrangement of grid phases, we further asked whether the intrinsic dynamics of the grid cell network, which is independent of the phase analyses, also supports this phase map. In a grid phase lattice, when the animal unidirectionally traverses a linear track, the activity trajectory on the MEC cell sheet should move accordingly in one direction, and this unidirectional flow should also repeat in each unit-parallelogram of the lattice (Figure 6 to their next active cells (downstream cells) within a range of a unit-parallelogram (“short vectors”) should largely point along consistent directions. The resultant vector of a set of these vectors should point in the direction corresponding to the motion (Figure 6. However, vectors between all sequentially active cell pairs (each pair contains one upstream cell and one downstream cell and the vector points from the upstream to the
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
downstream cell), regardless of their anatomical distances (“short and long vectors”), may be oriented differently, such that the resultant vector has reduced amplitude (Figure 6. To test these hypotheses, we studied the directionality of vectors connecting sequentially active cells, whose spatial fields sequentially occurred during navigation (Figures 6. Indeed, we found that short vectors exhibited higher directionality compared to those of shuffled datasets with randomly permuted calcium responses (Figures 6]( "Download high-res image (1MB)") 2. Download: Download full-size image Figure 6. Activity Propagates along Consistent Directions within the Anatomical Lattice during 1D Virtual Navigation (A) Predicted activity flow in the phase lattice map. Grid cells with different phases (green, magenta, and blue dots) are similarly arranged in each unit-parallelogram of the lattice (gray). Large gray arrow indicates activity trajectory during 1D navigation. Top: short vectors (white arrows) between sequential cell pairs in the same unit-parallelogram. Bottom: short and long vectors between all sequential cell pairs regardless of their anatomical distances (only arrows from cell 1 and cell 2 are shown for simplicity). (B) Calcium responses of a sequentially active cell pair (annotations are similar to Figure 2 and peak ΔF/F of each field (green or magenta dot), indicating the field location. (C) Identification of the two cells in (B) as sequential cells. Top: field peaks indicating field locations. Pairs of sequential fields are grouped (gray
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
boxes). Bottom: overlay of mean ΔF/F of the two cells. Note that for each pair of sequential fields, the field of cell 1 always occurred before that of cell 2, so they are a sequential cell pair and cell 1 was the upstream cell. (D) Short vectors between a group of co-modular grid cells (gray dots). Gray: fitted anatomical lattice. Vectors with angles between 120° to 300° are magenta, otherwise they are green. Scale bar, 50 μm. (E) Distribution of short vector angles and their resultant vector (yellow). Angle colors are consistent with (D). (F) Comparison of resultant vector lengths of real and shuffled data of cells in (D). The real resultant vector was longer than 95.5% of 200 shuffled vectors. (G) Comparison of resultant vector lengths of 13 groups of co-modular grid cells with shuffles (200/group). Lengths of resultant vectors were normalized so that shuffled vector lengths in each group had mean 0 and SD 1. Probabilities were normalized so that the maximal probabilities of real and shuffled data were 1. p=7.3× 10−4. (H–K) Directionality of short and long vectors between sequential cells in (D). Annotations and angle colors are similar to (D)–(G). (H) Short and long vectors between cells. (I) Distribution of short and long vector angles and their resultant vector. (J) Resultant vector length in (I) was only longer than 17.5% of 200 shuffles. (K) Resultant vector lengths of 13 groups of co-modular grid cells were not significantly different from those of shuffles (200/group). p= 0.52. ∗∗∗p ≤ 0.001, n.s. p > 0.05. Kolmogorov-Smirnov test. See also [Figure S6]( We also examined the pattern of activity bumps on the anatomical sheet while activity propagated during navigation. If grid phases repeated in a lattice, during navigation grid cells with
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
similar phases would be co-active and generate activity bumps forming the same lattice. We tested this hypothesis by identifying the anatomical distribution of co-active cells, which represent the pattern of activity bumps during navigation (Figure S6, it is possible that cells in different units exhibit some functional autonomy. Indeed, we observed that anatomically separated phase clusters, although correlated, could exhibit some independence, as revealed by an analysis of “missed fields.” When the animal traveled along the virtual track, there were individual traversals during which the expected firing was absent in a field (a “missed field”) (Domnisoru et al., 2013. The intra-cluster correlations of missed-field patterns were higher than the inter-cluster correlations for this field ([Figure 7]( and all fields in the same cells ([Figure 7]( as well as for many phase clusters in multiple animals ([Figure 7]( indicating that different phase clusters are not perfectly synchronized. The
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
functional independence of phase clusters further supports the lattice map of grid phases. !Image 24]( "Download high-res image (1MB)") 2. Download: Download full-size image Figure 7. Phase Clusters Are Independent Functional Units (A) Phase clusters of a set of co-modular grid cells, color-coded based on their phase distances to the reference cell (Ref.). Scale bar, 50 μm. (B) Phase distances of grid cells with similar phase as reference cell but in same (1–3) or different phase clusters (4–6) (annotations are similar to Figure 4 Missed-field patterns of the highlighted field in (B) in the six cells. Top: run-by-run significant transients in the field highlighted in (B) (each red dot is the track location of a significant transient peak). Bottom: missed-field pattern of the field in each cell. (D) Correlation of the missed-field patterns of the field in (C) for cells within same (intra) and in different phase clusters (inter). p= 6.1× 10−4. (E) Intra- and inter-cluster correlations of missed-field patterns of all fields in the cells in (A). p= 8.1× 10−3. (F) Missed-field correlations for intra- and inter-cluster cells in 191 phase clusters in 22 FOVs of six mice. Each dot represents the mean intra- or inter-cluster correlation of the missed field patterns of a set of phase clusters. p= 3.9× 10−4. (G) Diagram of the micro-organization of grid cells in layer 2 of the MEC. For simplicity, stellate cells between pyramidal patches are not shown. The grid phase lattice is only shown for module 1, but similar phase lattices exist for larger modules. Grid cells in module 1 are represented in nine colors based on their spatial tuning phases and distributed in an anatomical phase lattice with six repeating units.
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
Note that the phase map is distorted in at least two ways: (1) the global distortion of a rigid lattice to match the geometry of the module; (2) the local distortion of grid phases within each unit of the lattice: while most cells are located in color zones matching their spatial tuning phases, some cells are located in non-matching zones. Scale bar, 120 μm. ∗∗p ≤ 0.01. ∗∗∗p ≤ 0.001. Student’s t test. Error bars: mean ± SEM. See also Figure S7]( "Download high-res image (1MB)") 2. Download: Download full-size image Figure S7. Method for Calculating Missed-Field Patterns; Possible Mechanisms for Generating Grid Cells in Stellate Cells in Layer 2 of the MEC, Related to Figure 7 Calculation of missed-field patterns. (A) An example of spatially modulated calcium activity of one grid cell. Top: significant transients versus linear track position for a set of sequential runs. Each red dot represents the location of the highest peak of one significant transient. The red dots are plotted over a gray line representing the y position in each run. Middle: mean ΔF/F versus linear track position. Bottom: 1-p value function (1-p, dark blue) versus track position. In- and out-field periods are indicated in red and gray, respectively. Six spatial fields were identified for this cell. (B) Calculation of the missed-field pattern of the cell in (A). Top left: run-by-run significant transients of the six spatial fields in A. For each field, a single red dot represents the location of the highest peak of one significant transient. The gray lines represent the y position through that field for each run. Bottom left: missed-field pattern for each field, indicating for each run whether that field contained a significant transient (show-field, white)
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
or not (missed-field, black). Right: the missed-field patterns were converted to binary vectors (show-field= 1, missed-field= 0) and then averaged across all fields to obtain the missed-field pattern for the cell, which was a vector with one entry between 0 and 1 for every run. This missed-field pattern was then used to calculate the correlations between different cells. (C–E) Possible mechanisms for generating grid cells in stellate cells. (C) 2D model for path integration. Top: in the presence of surround inhibition (not shown), a focused activity bump is formed within a layer of neurons, which are recurrently connected (connections are indicated by red arrows). Bottom: during locomotion, the bump can be made to move by intermediate layers of cells that perform path integration. These cells are conjunctive for position and head-direction of the animal and positively modulated by speed. They receive position information from the bump of activity in the top cell layer, and generate information about the displacement vector (with both direction and speed information) for the future displacement of the bump. Note that there are multiple layers of cells encoding different head directions (five layers are shown, indicated by arrows), which can be mixed together in fewer real cortical layers. Modified from McNaughton et al., 2006. (D) Different connectivity patterns for layer 2 stellate and pyramidal cells within the MEC. Functional cell types in each layer are indicated. (E) Two possible models for generating grid cells in stellate cells in layer 2 of the MEC. Each gray dot represents a single stellate cell in layer 2 or a single pyramidal cell in deep layers of the MEC. Gray dots with magenta or blue rings are active cells at
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
a particular location of the environment during animal’s locomotion. Left:grid cells are locally generated within stellate cells in layer 2, which are recurrently connected (red arrows). During locomotion, activity bumps are made to move via the communication between layer 2 grid cells and cells in deep layers of the MEC (green and blue arrows), which contain grid-head direction conjunctive cells to perform path integration. Right: grid cells in layer 2 are inherited from the grid-like activity in deep layers of the MEC via feedforward excitation from deep layers to stellate cells (blue arrows). Our current results suggest that majority of grid cells in layer 2 are stellate cells. Although substantial additional research is needed to elucidate which brain area(s), layer(s), cell type(s) primarily contribute to the grid cell population and grid formation, converging lines of evidence point to the idea that layer 2 stellate cells may play a role because of their special connectivity: (1) Inhomogeneity of layer 2 of the MEC Compared to visual cortex and hippocampus, which exclusively consist of pyramidal neurons, layer 2 of the MEC contains two different excitatory cell types: stellate cells and pyramidal cells. These cells differ not only in their morphologies and molecular profiles, but also distinct anatomical distributions: pyramidal cells cluster into multiple hexagonally arranged patches, while stellate cells fill the inter-patch spaces ([Kitamura et al., 2014]( [Ray et al., 2014]( Based on current literature, grid-like responses do not seem to rely on stellate cell type per se, because grid cells have also been found in deeper layers of the MEC, as well as
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
pre- and parasubiculum, which do not contain stellate cells (Boccara et al., 2010 The connectivity pattern of stellate cells is favorable for the formation of grid cells (illustrated in (D)) Although it is still unclear how grid cell activity emerges, models propose that it can arise through local lateral (recurrent) connections between grid cells (Burak and Fiete, 2009. In particular, if the lateral connectivity is topographically local and Mexican-hat shaped, with strong inhibitory surrounds, then it is predicted that the neural sheet should exhibit multiple activity bumps themselves arranged in a triangular lattice pattern. Clusters of local cells should then have similar phase, with phase similarity within one locally connected region decreasing with distance, and multiple, periodically arranged groups of cells with the same phase, similar to the patterns observed in the current study. Moreover, a model by Widloski and Fiete (2014) excitation between principal cells is important for obtaining grid-like patterning among excitatory cells while avoiding similar patterning in inhibitory cells (even though recurrent inhibition is predicted to be essential for grid patterning). Based on the above models, grid cells in layer 2 of the MEC should fulfill some of the three criteria: a) interact through a
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
strong lateral inhibitory input, b) receive direct recurrent excitation, c) communicate with grid-head direction conjunctive cells to receive velocity signals and drive path-integration based updates of the location code in grid cells. Based on current experimental findings summarized below, stellate cells better meet these criteria and are thus better-placed to be grid cells than are pyramidal cells: (a) Lateral inhibition: Fast-spiking pavalbumin (PV)+ interneurons have been shown to be necessary for the maintenance of grid activity (Miao et al., 2017 Lateral excitatory connectivity: Recent reconstructions of local synaptic organization in the MEC show that both pyramidal and stellate cells can connect to other excitatory cells (Schmidt et al., 2017 Communication with conjunctive grid-head direction cells Unlike pyramidal cells, stellate cells appear to be more interconnected with deeper layers of the MEC, which contain head direction and grid-head direction conjunctive cells (Sargolini et al., 2006 of stellate cells, but not pyramidal cells, are enriched in layer 5 ([Sürmeli et al., 2015]( It was also shown that dendritic bundles of layer
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
3 pyramidal cells only overlap with stellate area and avoid pyramidal patches (Tang et al., 2015 Grid cell activity patterning is locally generated among layer 2 stellate cells ((E), left panel), and updated in accordance with animal movements based on interactions with the deeper layers: The grid-like activity bumps can be formed in recurrently connected stellate cells, in which the strength of connections between a pair of cells decays with the increase of their physical distance, with an effective net Mexican-hat interaction profile obtained by combining lateral excitation and inhibition. When the animal moves, the activity bump in layer 2 shifts through interactions with conjunctive grid-head direction cells, which are located in deep layers of the MEC: these cells receive position information from layer 2 grid cells, then shift the layer 2 state based on their velocity inputs. (b) Grid cell activity in stellate cells in layer 2 is inherited from deeper layers of the MEC ((E), right panel) Assuming that the recurrent connections between stellate cells are not enough, or other mechanisms are required for generating grid cells, grid cell activity can be possibility generated in deeper layers (e.g., layers 3 or 5) of the MEC. Stellate cells in layer 2 can then directly acquire the grid-like activity by receiving feedforward
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
excitatory inputs from the deep layers. Discussion ---------- Our results revealed a close correspondence between the functional and anatomical organization of the grid cell network at multiple levels ([Figure 7]( First, grid cells were mainly stellate and clustered. Second, co-modular grid cells formed clusters. Third, grid cells were anatomically organized in local regions according to their spatial tuning phases, with nearby cells exhibiting similar phases. This phase pattern repeated anatomically in a global lattice. The anatomical clustering of grid cells, grid modules, and phases suggests strong intra-cluster connectivity, weak inter-cluster connectivity, and specific inputs to different clusters. These predicted connectivity patterns suggest a degree of functional independence of grid and non-grid cells, modules, and phase clusters ([Diehl et al., 2017]( [Stensola et al., 2012]( The cell type specificity of grid cells in layer 2 of the MEC has been previously studied with conflicting results. It was reported that pyramidal cells, rather than stellate cells, were more likely to be grid cells ([Tang et al., 2014]( In contrast, we and another group found that grid cells were present in both cell types ([Domnisoru et al., 2013]( [Sun et al., 2015]( While the latter group showed similar abundances of grid cells in the two cell types ([Sun et al., 2015]( our study determined that most grid cells were stellate cells. The high percentage of grid cells in stellate cells suggests that the stellate population contains more spatial information than the pyramidal population, consistent with the role of stellate cells in encoding context information for fear memory ([Kitamura et al., 2015]( and estimating locations during spatial learning ([Tennant et al., 2018]( In addition, while recent evidence supports the existence of structural and functional connections between and onto stellate cells ([Beed et al., 2013]( [Couey et al., 2013]( [Fuchs et al., 2016]( [Pastoll et
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
al., 2013]( Schmidt et al., 2017 connectivity within a network (Burak and Fiete, 2009 of grid cell phases directly correlates with the local anatomical organization of cells with different phases, and therefore, anatomically nearby grid cells share more similar phases than distal cells. According to different implementations of CAN models, the network can either contain a single unit-rhombus (single activity bump), or multiple unit-rhombuses tiling the neuron sheet (multiple activity bumps) ([Burak and Fiete, 2009]( [Fuhs and Touretzky, 2006]( [Guanella et al., 2007]( Our results are consistent with the multi-bump model at both the local and global scales. Moreover, we also observed that instead of being regular triangular lattices, the phase lattices were skewed in the brain, similar to the elliptically distorted hexagons of pyramidal patches ([Ray et al., 2014]( The importance
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
and implications of these distortions remain unclear. Last, the micro-organization of grid phases within a short physical distance is consistent with the recently identified short-range synapses in layer 2 of the MEC, which are mostly from excitatory cells to other cells within 100 μm (Schmidt et al., 2017 likely occur between grid cells with similar phases within local brain neighborhoods and could explain the functional independence of different phase clusters. The microstructural organization of grid cells described here provides a much finer resolution understanding of the circuits than what was previously available using electrophysiological methods, and calls for further studies of the MEC at the microstructural level. The grid phase map, although noisy, provides strong support for continuous attractor network models as prime candidates for explaining grid formation. Further studies using more advanced approaches to assess network activity of the MEC in different species will be necessary to generalize our conclusions. The relationship between the anatomical distribution of grid cells and their function in mouse MEC demonstrates how topography and function can be intimately related in neural circuits. STAR★Methods ------------ ### Key Resources Table | REAGENT or RESOURCE | SOURCE | IDENTIFIER | | --- | --- | --- | | **Antibodies** | | Mouse monoclonal anti-REELIN (CR-50) | MBL Life science | Cat#D223-3; RRID: AB_843523 | Millipore | Cat# MAB5406; RRID: [AB_2278725]( | | **Experimental Models: Organisms/Strains** | | Mouse: Thy1-GCaMP6f transgenic line GP5.3 | [Dana et al., 2014]( | N/A | | Mouse: Emx1-IRES-Cre; CaMKIIa-tTA; Ai93 | [Madisen et al.,
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
2015]( | N/A | | Mouse: wild type C57BL/6J mice | The Jackson Laboratory | Stock No: 000664 | Black 6 | | **Software and Algorithms** | | MATLAB | MathWorks | | | ImageJ | National Institutes of Health | [ | | ScanImage 5 | Vidrio Technologies | [ | | ViRMEn (Virtual Reality Mouse Engine) | [Aronov and Tank, 2014 | Giovannucci et al., 2018). ### Experimental Model and Subject Details All experiments were performed in accordance with the Guide for the Care and Use of Laboratory Animals ( and the procedures were approved by the Princeton University Institutional Animal Care and Use Committee. Mice used in the [two photon imaging experiments were six adult male GP5.3 (Dana et al., 2014GP5.3Dkim/J, JAX stock #028280), which were 10-12 weeks old at the beginning of experiments, and three adult male triple transgenics mice (Madisen et al., 2015 of three parental strains: (1) B6.Cg-Tg(Camk2a-tTA)1Mmay/DboJ, JAX 007004; (2) B6.129S2-Emx1tm1(cre)Krj/J, JAX 005628; (3) B6;129S-Igs7tm93.1(tetO-GCaMP6f)Hze/J, JAX 024103), which were 11-22 weeks old at the beginning of experiments. The tetrode experiments were performed on four C57BL/6J male mice aged 3-6 months during experiments. Mice were maintained on a 12-hr light on / 12-hr light off schedule. All surgical manipulations and behavioral tests were conducted during their light off period. Mice were free of all known mouse [pathogens]( "Learn more
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
about pathogens from ScienceDirect's AI-generated Topic Pages") (Surveillance PRIA®, Charles River, Wilmington, MA), were not involved in previous procedures, and were drug and test naive. ### Method Details #### Implantation of microprism for MEC imaging The microprism implant assembly and surgical procedures were similar to those described previously (Low et al., 2014; Optosigma) bonded to the center of a circular coverslip (3.0 mm diameter, #1 thickness, BK7 glass; Warner Instruments). The coverslip was bonded to the end of a thin metal cylinder (304 stainless steel, 0.8mm height, 3.0mm outer diameter, 2.8mm inner diameter; MicroGroup). All components were bonded together using UV-curing optical adhesive (Norland #81). ##### Surgical procedures The microprism implantation was always performed in the left hemisphere as its vasculature pattern was more suitable for implantation based on previous observations (Low et al., 2014 under anesthesia induced by isoflurane (induction: 2%–3%, surgery: 0.75%–1.5%). Body temperature was maintained at 37°C using a homeothermic blanket (Harvard Apparatus). Buprenorphine (5 μg), dexamethasone (2mg/kg) and saline (0.9% NaCl, 0.5ml) were administered by intraperitoneal (IP) injection. A circular craniotomy (3mm diameter) was performed over the [implantation site]( "Learn more about implantation site from ScienceDirect's AI-generated
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
Topic Pages"), centered 3.4mm lateral to the midline and 0.75mm posterior to the center of the transverse sinus (at 3.4mm lateral). The dura over the cerebellum was removed. Mannitol (3g/kg) was administered by IP injection 30-60 min before the durotomy. The microprism assembly was manually implanted, with the prism inserted into the subdural space within the transverse fissure. The gap between the skull and the implant was sealed with n-butyl cyanoacrylate tissue adhesive (Vetbond, 3M), and the implant was bonded to the skull using dental cement (Metabond, Parkell). A titanium headplate, having a single flange for external mounting on the side opposite to the side of the craniotomy, was bonded to the skull using Metabond. #### Histology Histology was performed to verify GCaMP expression in layer 2 cells in the MEC of GP5.3 mice (Figures S1 (200mg/kg) and xylazine (20mg/kg) and transcardially perfused. Mice were first perfused with 20-30 mL ice-cold PBS, followed by 30-50 mL ice-cold paraformaldehyde (4% in PBS). The brain was post-fixed in 4% paraformaldehyde for 24 hr at 4°C and then sectioned sagittally (40μm thickness) on a vibrating [microtome]( "Learn more about microtome from ScienceDirect's AI-generated
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
Topic Pages") (Vibratome Model 1500). All slices were stored in 0.1M phosphate buffer (PB, 0.019M NaH 2 PO 4, 0.081M NaH 2 PO 4, pH 7.4) with 0.1% NaN 3. ##### Immunohistochemistry To examine the expression of GCaMP6f in layer 2 of the MEC, we performed immunohistochemistry on the sagittal slices generated above with different antibodies. The general procedure was as follows. After rinsing the slice four times with PBS for 10 min each time, the slice was incubated with blocking buffer (10% BSA, 0.5% Triton X-100, in PBS) for one hour at room temperature. Primary antibodies were then applied at appropriate concentrations in the antibody buffer (2% BSA, 0.4% Triton X-100, in PBS) for 48-72 hr at 4°C. After the antibody incubation, the slice was rinsed four times with PBS (10 min for each rinse). Alexa fluor secondary antibodies (Molecular Probes) were applied at 1:500 in the antibody buffer for 2 hr at room temperature. The slice was finally rinsed two times in PBS (10 min for each rinse) and once in 0.1M PB for 5 min, and mounted with Vectashield mounting medium (H-1000; Vector Laboratories). The gap between the coverslip and slide was sealed with nail polish (New York Color). Several primary antibodies were used to target different antigens: anti-REELIN (mouse IgG1, CR-50, MBL Life science) at 1:100; anti-WFS1 (rabbit, 11558-1-AP, Proteintech) at 1:500; anti-GAD67 (mouse IgG2a, 1G10.2, EMD Millipore) at 1:500. Secondary antibodies targeting different species or mouse IgG isotypes of the primary antibodies were conjugated with [Alexa fluor]( "Learn more
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
about Alexa fluor from ScienceDirect's AI-generated Topic Pages") dye 568 or 647 so that their emission spectra were largely separated from that of GCaMP6f. We observed that GCaMP6f was expressed in three major cell types (interneurons, pyramidal and stellate cells), which were characterized using specific antibodies against WFS1, REELIN, and GAD67 (Chin et al., 2007, which were further distinguished by the interneuron-specific antibody GAD67. We found that GCaMP6f+ neurons showed immunoreactivity to either WFS1 or REELIN. GCaMP6f was highly expressed in pyramidal and stellate cells (77.6 ± 5.0% and 91.0 ± 1.2%, respectively), but rarely observed in interneurons (24.0 ± 6.5%). Only 3.3 ± 1.1% of REELIN+/GCaMP6f+ neurons were identified as interneurons, which expressed GCaMP6f at lower intensity comparing to stellate cells (Figures S1 (A1Rsi; Nikon) using a 20x (CFI Plan Apo Lambda 20×, NA 0.75; Nikon) or 40x objective (CFI Plan Fluor 40× Oil, NA 1.3; Nikon). The fluorescence signals of GCaMP6f, Alexa fluor dye 568, and 647 were sequentially collected, except the co-staining of REELIN and WFS1. Since the fluorescence signal of WFS1 was much stronger than that
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
of REELIN, the signal of WFS1 could contaminate the signal of REELIN. We therefore performed a spectrum excitation over the range of 547-733 nm and isolated the emission signals from two major peaks, which corresponded to REELIN and WFS1, using the “blind unmixing” function in the NIS elements confocal software (Nikon). #### Classification of pyramidal and stellate cells In brain slices, pyramidal cells generally exhibited smaller cell body diameters than stellate cells. The diameters of GCaMP6f+ cell bodies in layer 2 showed a bimodal distribution. This bimodal distribution of cell body diameters was also observed _in vivo_ by two-photon imaging, indicating that the diameters could be similarly used to distinguish the two cell types in calcium imaging data. Detailed information is described below. ##### Measuring diameters of cell bodies Since the shapes of the cells in layer 2 of the MEC were mostly elongated in one direction, their diameters were determined as the length of the long axis of their cell bodies and measured _in vitro_ and _in vivo_ as follows. The diameters of cells in _in vitro_ sagittal brain slices were measured based on a confocal z stack of the slice. For each cell, the image containing the maximal size of its cell body was selected and the boundary of its cell body was manually outlined. The long axis of the cell body was defined as the long axis of the ellipse, which best fit the cell shape (using the MATLAB
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
function “regionprops”). For cells in an _in vivo_ field-of-view (FOV), we took a two-photon z stack containing the focal plane of the FOV to identify their maximal cell bodies. We found that the cells with clear boundaries and nuclearly excluded GCaMP6f expression in the FOV were mostly “in-focus” cells and their maximal cell bodies could be found in the current FOV. However, cells with blurry edges and unclear GCaMP6f expression pattern were “out-of-focus” cells and their maximal cell bodies were normally present in adjacent focal planes in the z stack. Therefore, the cell body diameters of “in-focus” cells were directly measured in the current FOV, whereas the diameters of “out-focus” cells were identified in adjacent focal planes in the z stack. We discarded cells that could not be clearly identified in either the current FOV or the z stack. The diameter, which was the long axis of the cell body, was then determined using the method described for _in vitro_ data. ##### Cell classification _in vivo_ (Figures S1 was also observed _in vivo_ (Figures S1, we reasoned that the bimodal distribution of _in vivo_ diameters also correlated with the two cell types. Therefore, we performed k-means clustering on the _in vivo_ cell body diameters and the number of clusters was set to two. The cells in the small and big diameter clusters were classified as pyramidal and stellate cells, respectively.
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
##### Identification of pyramidal cells in the same patch In the same FOV, the pyramidal cells in different patches were identified based on their physical locations (in X and Y axes) in the FOV. The X and Y coordinates of all pyramidal cells were clustered by k-means and the different clusters correspond to individual patches. The optimal number of patches was obtained using the MATLAB function “evalclusters” under the Calinski-Harabasz clustering evaluation. Since the size of the FOV was 410μm × 410μm (0.168mm 2) and the density of pyramidal patches in dorsal MEC is approximately 15 patches/mm 2 (2.5 patches /0.168mm 2) (Naumann et al., 2016 system was similar to that described previously (Low et al., 2014 while their heads were held fixed under a two-photon microscope by clamping the headplate to the arm of a support column located on the right hand side. The treadmill was constrained by a ball bearing-mounted
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
axle inserted into the equator on one side so that the sphere only rotated in the forward/backward direction. Forward and backward motions were measured using an optical motion sensor (ADNS3080; red LED illumination) controlled with an Arduino Due. The VR environment, which was projected onto a toroidal screen surrounding the mouse, was rendered in blue and projected through a blue filter (Edmund Optics 54-462) to reduce the entry of projected light into the microscope’s fluorescence collection system (517-567nm bandpass collection filter). ViRMEn software (Aronov and Tank, 2014 were separately given at the beginning and the end of the track. Upon running to the end of the track, mice were teleported back to the beginning of the track. #### Training in virtual reality Mice were allowed to recover for five days after surgery. Water restriction began on the sixth day and mice received 1ml of water per day. After 2-3 days of water restriction, mice began daily behavioral training (45-60 min) on the VR system at approximately the same time each day. During all training sessions, the mouse’s head was positioned under the microscope and oriented in the same manner as for imaging experiments. Imaging experiments began when mice reached a daily performance criterion of 2-4 rewards per minute (after 10-15 training sessions). #### Two-photon imaging during virtual navigation ##### Imaging setup As described previously, imaging was performed using a custom-built, VR-compatible two-photon microscope (Low et al., 2014 was delivered by a
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
mode-locked Ti:sapphire laser (Chameleon Ultra II, Coherent, 140fs pulses at 80MHz). The laser scanning was achieved by a resonant scanning mirror (Cambridge Tech.). Fluorescence of GCaMP6f was isolated using a bandpass emission filter (542/50nm, Semrock) and detected using GaAsP photomultiplier tubes (1077PA–40, Hamamatsu). Black rubber tubing was attached to the objective (Olympus 40×, 0.8 NA) as a light shield covering the space from the objective to the imaging window. Ultrasound transmission gel (Sonigel, refractive index: 1.3359 (Larson et al., 2011 was used as the immersion medium. The optical axes of the microscope objective and microprism were aligned at the beginning of each experiment as described previously (Low et al., 2014 (Pologruto et al., 2003. Average beam power measured at the front of the objective was typically 60-90mW. Imaging and behavioral data were synchronized as described previously (Low et al., 2014 together with behavioral data from the VR system at a sampling rate of 1kHz, using a Digidata/Clampex acquisition system (Molecular Devices). In general, 18,000-63,000 frames (10-35 min depending on the length of the track and behavioral performance) were collected from each FOV during one behavioral trial. #### General processing of imaging data ##### Motion
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
correction Two-photon image time series were analyzed using custom MATLAB code. Motion correction was performed using a whole-frame, cross-correlation-based method via MATLAB scripts and ImageJ (Schneider et al., 2012. In general, the imaging stacks were read, down-sampled in MATLAB and then imported to ImageJ to obtain the subpixel shifts for each frame, which led to the maximal cross correlation between the frame and the template. Frames were then shifted in MATLAB by applying a rigid transformation with linear interpolation for fractional shifts (Giovannucci et al., 2018, each stack was down-sampled by averaging every three frames (334 frames /stack, down-sampled raw stack). The first 150 frames of the first raw stack were removed due to image distortion during the starting of the resonant scanner. The stack in the middle of the imaging session (reference stack) was first motion corrected using its median as a template. This motion correction was iterated and the template was updated each time. The correlation of the median of the corrected stack with the template was computed each time. The motion correction algorithm iterated until the difference of the correlations in consecutive correction sessions were less than 0.00005 (5-10 iterations were normally required), indicating that the quality of the motion correction was maximally optimized. The median of the corrected reference stack was further used as the template for all other down-sampled raw stacks. Subsequently, each down-sampled stack was
|
{
"page_id": null,
"source": 7370,
"title": "from dpo"
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.