getTypeToTypeTable: Generate a table of type to type connections, keeping only...

Description Usage Arguments Value Examples

View source: R/connectionTables.R

Description

Generate a table of type to type connections, keeping only the significant links

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
getTypeToTypeTable(
  connectionTable,
  majorOutputThreshold = 0.8,
  singleNeuronThreshold = 0.01,
  singleNeuronThresholdN = 3,
  overruleThreshold = Inf,
  pThresh = 0.05,
  typesTable = NULL,
  oldTable = NULL
)

Arguments

connectionTable

A table of neuron to neuron connections (as generated by getConnectionTable)

majorOutputThreshold

Threshold of the fraction of the outputs of a presynaptic type to be accounted for by an output type for us to keep this connection regardless of other criterions. Should be close to 1, the rationale being if a neuron has only one type of partners in the region, one ought to consider it significant

singleNeuronThreshold

If a neuron is the only representent of its type, what fraction of it's input should a presynaptic type represent for the connection to be kept?

singleNeuronThresholdN

If a neuron is the only representent of its type, how many synapses from the presynaptic type should it minimally receive?

pThresh

Significance level of the t-test for a connection to be kept

typesTable

A table of all the instances of the output types (as generated by a search for example). If NULL (the default), it will be computed from the unique types of post synaptic partners. Necessary to use if there are some user defined types

Value

A data frame with the columns: - type.to - type.from - weightRelative : the mean over the outputs of the relative input contribution of the input type to the output type - varWeight : the variance over the outputs of the relative input contribution of the input type to the output type -ci_low : lower bound confidence interval of the relative weight - outputContribution : what proportion of the outputs of type.from does this connection accounts for - n_links : how many individual neuron to neuron connections does this connection contain? -n_type : number of instances of type.to - databaseType.to/databaseType.from : the neuprint defined types that contain the type.to/type.from used here

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
## Not run: 
## Getting a PFL outputs in the LAL table, and summarize it by type
PFLs <- getTypesTable(c("PFL1","PFL2","PFL3"))
PFLConnections <- getConnectionTable(PFLs,"POST","LAL(-GA)(R)")
PFLConnectionByType <- getTypeToTypeTable(PFLConnections)


## Splitting one output type according to left/right in a PFL table
PFLConnections_renamed <- redefineType(table=PFLConnections,
                                       type="AVL01op_pct",
                                       condition=grepl("_L",PFLConnections$name.to),
                                       newTypes=c("AVL01op_pct_L","AVL01op_pct_R"),
                                       type_col = "type.to")
## One now needs to create an ad-hoc table and rename it similarly
outputTypes <- getTypesTable(unique(PFLConnections)[["type.to"]])
outputTypes_renamed <- redefineType(table=outputTypes,
                            type="AVL01op_pct",
                            condition=grepl("_L",OutputTypes$name),
                            newTypes=c("AVL01op_pct_L","AVL01op_pct_R"),
                            type_col = "type")

## This particular transforms can also be achieved with lrSplit
PFLConnections_renamed <- lrSplit(PFLConnections,typeList=c("AVL01op_pct" ))
outputTypes_renamed <- lrSplit(outputTypes,nameCol="name",typeCol="type",typeList=c("AVL01op_pct" ))

## One can then use the function with the table
PFLTypeToType <- getTypeToTypeTable(PFLConnections_renamed,typesTable = outputTypes_renamed)


## End(Not run)

jayaraman-lab/neuprintrExtra documentation built on Dec. 20, 2021, 10 p.m.